mirror of
https://github.com/jcreek/MupBot.git
synced 2026-07-13 10:53:44 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e6950df529 | |||
| 39cb0521fe |
+11
-1
@@ -3,6 +3,8 @@ const axios = require('axios');
|
|||||||
const cheerio = require('cheerio');
|
const cheerio = require('cheerio');
|
||||||
const got = require('got');
|
const got = require('got');
|
||||||
|
|
||||||
|
const adultChannelName = 'adult-only-chat';
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
dailyTasks: function (client) {
|
dailyTasks: function (client) {
|
||||||
sendDailyDilbert(client);
|
sendDailyDilbert(client);
|
||||||
@@ -13,7 +15,13 @@ module.exports = {
|
|||||||
commandHelp(Discord, config, logger, message, command, args);
|
commandHelp(Discord, config, logger, message, command, args);
|
||||||
break;
|
break;
|
||||||
case 'ud':
|
case 'ud':
|
||||||
commandUrbanDictionary(Discord, config, logger, message, command, args);
|
if (message.channel.name === adultChannelName) {
|
||||||
|
commandUrbanDictionary(Discord, config, logger, message, command, args);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const channel = message.client.channels.cache.find((channel) => channel.name === adultChannelName);
|
||||||
|
message.channel.send(`This command is restricted to the <#${channel.id}> channel.`);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
message.channel.send(`That command is not one I know yet - but you could add it! To find out more visit ${config.github_url}`);
|
message.channel.send(`That command is not one I know yet - but you could add it! To find out more visit ${config.github_url}`);
|
||||||
@@ -94,6 +102,8 @@ function commandUrbanDictionary(Discord, config, logger, message, command, args)
|
|||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
logger.error('Failed to make GET request to Urban Dictionary API', error);
|
logger.error('Failed to make GET request to Urban Dictionary API', error);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function sendDailyDilbert(client) {
|
async function sendDailyDilbert(client) {
|
||||||
let comicImageUrl;
|
let comicImageUrl;
|
||||||
|
|||||||
Reference in New Issue
Block a user