mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +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.
|
||||
* `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).
|
||||
* `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.
|
||||
* `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).
|
||||
|
||||
@@ -25,13 +25,13 @@ module.exports = class CatCommand extends Command {
|
||||
async run(msg) {
|
||||
try {
|
||||
const { body } = await request
|
||||
.get('https://api.thecatapi.com/images/search')
|
||||
.get('https://api.thecatapi.com/v1/images/search')
|
||||
.query({
|
||||
limit: 1,
|
||||
mime_types: 'jpg,png'
|
||||
})
|
||||
.set({ 'x-api-key': THECATAPI_KEY });
|
||||
return msg.say({ files: [body.file] });
|
||||
return msg.say({ files: [body.images[0].url] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user