mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 08:22:37 +02:00
Fix
This commit is contained in:
@@ -195,6 +195,7 @@ API. All are free unless otherwise stated.
|
|||||||
* `OSU_KEY` can be obtained by [signing up at the osu! API page](https://osu.ppy.sh/p/api/). Whether this link takes you to the right page or not is hit-or-miss.
|
* `OSU_KEY` can be obtained by [signing up at the osu! API page](https://osu.ppy.sh/p/api/). Whether this link takes you to the right page or not is hit-or-miss.
|
||||||
* `STACKOVERFLOW_KEY` can be obtained by [registering your app at stackapps](https://stackapps.com/apps/oauth/register).
|
* `STACKOVERFLOW_KEY` can be obtained by [registering your app at stackapps](https://stackapps.com/apps/oauth/register).
|
||||||
* `TENOR_KEY` can be obtained by [Registering an Application at the Tenor website](https://tenor.com/developer/keyregistration).
|
* `TENOR_KEY` can be obtained by [Registering an Application at the Tenor website](https://tenor.com/developer/keyregistration).
|
||||||
|
* `THECATAPI_KEY` can be obtained at the [TheCatAPI website](https://thecatapi.com/).
|
||||||
* `TMDB_KEY` can be obtained by [following these instructions at the TMDB website](https://www.themoviedb.org/documentation/api). Read the "How do I apply for an API key?" section.
|
* `TMDB_KEY` can be obtained by [following these instructions at the TMDB website](https://www.themoviedb.org/documentation/api). Read the "How do I apply for an API key?" section.
|
||||||
* `TUMBLR_KEY` can be obtained at the [Tumblr developer portal](https://www.tumblr.com/oauth/apps).
|
* `TUMBLR_KEY` can be obtained at the [Tumblr developer portal](https://www.tumblr.com/oauth/apps).
|
||||||
* `TWITTER_KEY` and `TWITTER_SECRET` can be obtained at the [Twitter developer portal](https://developer.twitter.com/en/apps).
|
* `TWITTER_KEY` and `TWITTER_SECRET` can be obtained at the [Twitter developer portal](https://developer.twitter.com/en/apps).
|
||||||
|
|||||||
@@ -25,13 +25,13 @@ module.exports = class CatCommand extends Command {
|
|||||||
async run(msg) {
|
async run(msg) {
|
||||||
try {
|
try {
|
||||||
const { body } = await request
|
const { body } = await request
|
||||||
.get('https://api.thecatapi.com/images/search')
|
.get('https://api.thecatapi.com/v1/images/search')
|
||||||
.query({
|
.query({
|
||||||
limit: 1,
|
limit: 1,
|
||||||
mime_types: 'jpg,png'
|
mime_types: 'jpg,png'
|
||||||
})
|
})
|
||||||
.set({ 'x-api-key': THECATAPI_KEY });
|
.set({ 'x-api-key': THECATAPI_KEY });
|
||||||
return msg.say({ files: [body.file] });
|
return msg.say({ files: [body.images[0].url] });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user