mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-16 00:12:32 +02:00
Giphy Random
This commit is contained in:
@@ -32,7 +32,8 @@ module.exports = class GiphyCommand extends Command {
|
|||||||
api_key: GIPHY_KEY
|
api_key: GIPHY_KEY
|
||||||
});
|
});
|
||||||
if (!body.data.length) throw new Error('No Results.');
|
if (!body.data.length) throw new Error('No Results.');
|
||||||
return msg.say({ files: [body.data[0].images.original.url] })
|
const random = Math.floor(Math.random() * body.data.length) + 1;
|
||||||
|
return msg.say({ files: [body.data[random].images.original.url] })
|
||||||
.catch(err => msg.say(`${err.name}: ${err.message}`));
|
.catch(err => msg.say(`${err.name}: ${err.message}`));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return msg.say(`${err.name}: ${err.message}`);
|
return msg.say(`${err.name}: ${err.message}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user