Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Added a latest command #46

Merged
merged 2 commits into from
Oct 10, 2020
Merged

Added a latest command #46

merged 2 commits into from
Oct 10, 2020

Conversation

Nepgfurmixpro
Copy link
Contributor

Adding a latest command to check Marks newest video and post the link. It works perfectly on my bot so it should work on Oinkbot #18

Adding a latest command to check Marks newest video and post the link. It works perfectly on my bot so it should work on Oinkbot
@Nepgfurmixpro
Copy link
Contributor Author

Oh and also you need to get an API key from google to make request. Then replace '[REPLACE WITH YOUTUBE API KEY]" with your API key

const request = require('request');

module.exports.execute = async (client, message, args) => {
request('https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCNmheQMf9sK1Axv3NCEhbSA&maxResults=1&q=%5BOinkcraft%5D&type=video&key=[REPLACE WITH YOUTUBE API KEY]', function (error, response, data) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be handled in the config instead of inline in the link, as Oinkbot will sync with the repository

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be handled in the config instead of inline in the link, as Oinkbot will sync with the repository

I made some edits to the command. Is the change what you requested?

Copy link
Contributor

@Zaph-x Zaph-x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment

@Zaph-x Zaph-x merged commit b1965d8 into oinkcraft:dev Oct 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants