mirror of
https://github.com/jcreek/MupBot.git
synced 2026-07-13 02:43:45 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 01ef3cfb02 | |||
| 202d22b28b | |||
| e6950df529 |
+37
-2
@@ -3,6 +3,9 @@ const axios = require('axios');
|
|||||||
const cheerio = require('cheerio');
|
const cheerio = require('cheerio');
|
||||||
const got = require('got');
|
const got = require('got');
|
||||||
|
|
||||||
|
let enableModCommands = false;
|
||||||
|
const adultChannelName = 'adult-only-chat';
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
dailyTasks: function (client) {
|
dailyTasks: function (client) {
|
||||||
sendDailyDilbert(client);
|
sendDailyDilbert(client);
|
||||||
@@ -13,8 +16,28 @@ 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;
|
||||||
|
case 'enablemod':
|
||||||
|
commandModEnable(Discord, config, logger, message, command, args);
|
||||||
|
break;
|
||||||
|
case 'disablemod':
|
||||||
|
commandModDisable(Discord, config, logger, message, command, args);
|
||||||
|
break;
|
||||||
|
case 'examplemod':
|
||||||
|
if(enableModCommands) {
|
||||||
|
commandModExample(Discord, config, logger, message, command, args);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
message.channel.send(`That command is currently disabled. To find out more visit ${config.github_url}`);
|
||||||
|
}
|
||||||
|
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}`);
|
||||||
}
|
}
|
||||||
@@ -43,7 +66,7 @@ The commands available to you are:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function commandUrbanDictionary(Discord, config, logger, message, command, args) {
|
function commandUrbanDictionary (Discord, config, logger, message, command, args) {
|
||||||
if (!args.length) {
|
if (!args.length) {
|
||||||
//If the command is used incorrectly without arguments
|
//If the command is used incorrectly without arguments
|
||||||
return message.channel.send(`You didn't provide any arguments, ${message.author}!\nCorrect Usage: \`${config.prefix}ud <query>\``);
|
return message.channel.send(`You didn't provide any arguments, ${message.author}!\nCorrect Usage: \`${config.prefix}ud <query>\``);
|
||||||
@@ -97,6 +120,18 @@ function commandUrbanDictionary(Discord, config, logger, message, command, args)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function commandModEnable (Discord, config, logger, message, command, args) {
|
||||||
|
enableModCommands = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function commandModDisable (Discord, config, logger, message, command, args) {
|
||||||
|
enableModCommands = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function commandModExample (Discord, config, logger, message, command, args) {
|
||||||
|
// This would be a Mod command that can be enabled and disabled using the enableModCommands variable
|
||||||
|
}
|
||||||
|
|
||||||
async function sendDailyDilbert(client) {
|
async function sendDailyDilbert(client) {
|
||||||
let comicImageUrl;
|
let comicImageUrl;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user