Skip to content

Commit

Permalink
Add Russia command
Browse files Browse the repository at this point in the history
  • Loading branch information
gideontong committed Jan 12, 2021
1 parent 7881677 commit 1024122
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
19 changes: 19 additions & 0 deletions commands/reddit/russia.js
@@ -0,0 +1,19 @@
const subreddit = 'russiapics';

const { getRedditImage } = require('../../lib/Internet');
const log = require('log4js').getLogger('amy');

/**
* Returns a random photo from /r/RussiasPics
* @param {Message} msg Command
* @param {Array} args Arguments
*/
module.exports = async (msg, args) => {
try {
getRedditImage(function (data = 'Loading...') {
msg.channel.send(data);
}, subreddit);
} catch (err) {
log.error(`While trying to grab a Reddit /r/RussiaPics picture I got ${err}`);
}
}
6 changes: 6 additions & 0 deletions config/commands.json
Expand Up @@ -485,6 +485,12 @@
"description": "Get the server rules!",
"alias": []
},
{
"name": "See Russia",
"command": "russia",
"description": "Communism?",
"alias": []
},
{
"name": "Google",
"command": "search",
Expand Down
1 change: 1 addition & 0 deletions config/foldermap.json
Expand Up @@ -106,6 +106,7 @@
"rockpaperscissors": "games",
"roll": "games",
"rules": "utility",
"russia": "reddit",
"say": "admin",
"search": "internet",
"selfharm": "utility",
Expand Down

0 comments on commit 1024122

Please sign in to comment.