diff --git a/actions/logToConsole.js b/actions/logToConsole.js index 28602496..e9e03ebd 100644 --- a/actions/logToConsole.js +++ b/actions/logToConsole.js @@ -22,20 +22,10 @@ module.exports = { memberJoin: async function (member) { console.log(`MEMBER JOIN`.blue, `[${member.guild.name}]`.green, `[${member.user.username}]`.yellow) - try { - bot.channels.cache.get(process.env.REPORTING_CHANNEL).send(`**MEMBER JOIN** - [${member.guild.name}] [${member.user.username}]`) - } catch (e) { - console.log(e); - } }, memberLeave: async function (member) { console.log(`MEMBER LEAVE`.blue, `[${member.guild.name}]`.green, `[${member.user.username}]`.yellow) - try { - bot.channels.cache.get(process.env.REPORTING_CHANNEL).send(`**MEMBER LEAVE** - [${member.guild.name}] [${member.user.username}]`) - } catch (e) { - console.log(e); - } }, guildUpdate: async function (oldGuild, newGuild) { diff --git a/commands/admin/adminHelp.js b/commands/admin/adminHelp.js new file mode 100644 index 00000000..e6f7665a --- /dev/null +++ b/commands/admin/adminHelp.js @@ -0,0 +1,34 @@ +const { Command } = require('discord.js-commando'); +const { MessageEmbed } = require('discord.js'); +const channelCheck = require('../../functions/channelCheck') +const logToConsole = require('../../actions/logToConsole') + +module.exports = class AdminHelpCommand extends Command { + constructor(client) { + super(client, { + name: 'adminhelp', + group: 'admin', + memberName: 'adminhelp', + description: 'Shows the bot\'s admin help embed', + examples: ['adminhelp'], + guildOnly: true, + userPermissions: ['MANAGE_MESSAGES'] + }); + } + + async run(message) { + const Embed = new MessageEmbed() + .setColor('#ff3505') + .setURL('https://discord.gg/6pZ2wtGANP') + .setTitle("Admin Help, a list of commands") + .setDescription("**defaultchannel**: Sets the channel the bot will talk in" + + "\n\n **adminchannel**: Sets the channel the bot will send admin messages in" + + "\n\n **dm**: Dm\'s a user that is mentioned. Careful, this is monitored for abuse" + + "\n\n **remove**: Removes all data for the server this command is run in" + + "\n\n **say** or **echo**: Lets you make the bot say something. Careful, this is monitored for abuse" + + "\n\nJoin our support server: https://discord.gg/KKYw763") + .setFooter(`Delivered in: ${Date.now() - message.createdTimestamp}ms | Antares Bot | ${botVersion}`, 'https://cdn.discordapp.com/icons/649703068799336454/1a7ef8f706cd60d62547d2c7dc08d6f0.png'); + message.channel.send(Embed); + logToConsole.command(message.guild, message); + } +}; \ No newline at end of file diff --git a/commands/admin/adefaultChannel.js b/commands/admin/defaultChannel.js similarity index 91% rename from commands/admin/adefaultChannel.js rename to commands/admin/defaultChannel.js index 341a5578..c4f4c973 100644 --- a/commands/admin/adefaultChannel.js +++ b/commands/admin/defaultChannel.js @@ -6,11 +6,11 @@ const logToConsole = require('../../actions/logToConsole') module.exports = class DefaultChannelCommand extends Command { constructor(client) { super(client, { - name: 'adefaultchannel', + name: 'defaultchannel', group: 'admin', - memberName: 'adefaultchannel', + memberName: 'defaultchannel', description: 'Sets the admin channel for the guild.', - examples: ['adefaultchannel "CHANNELID"'], + examples: ['defaultchannel "CHANNELID"'], args: [ { key: 'text', diff --git a/commands/admin/dm.js b/commands/admin/dm.js index e2d0898e..8686dc56 100644 --- a/commands/admin/dm.js +++ b/commands/admin/dm.js @@ -27,12 +27,10 @@ module.exports = class DmCommand extends Command { usages: 1, duration: 3600, }, - guildOnly: true + guildOnly: true, + userPermissions: ['ADMINISTRATOR'] }); } - hasPermission(msg) { - return this.client.isOwner(msg.author); - } run(message, { user, content }) { message.delete(); diff --git a/commands/user/help.js b/commands/user/help.js index 488e5e2e..093bd476 100644 --- a/commands/user/help.js +++ b/commands/user/help.js @@ -10,7 +10,7 @@ module.exports = class HelpCommand extends Command { group: 'user', memberName: 'help', description: 'Shows the bot help embed', - examples: ['privacy'], + examples: ['help'], guildOnly: true }); } @@ -22,6 +22,7 @@ module.exports = class HelpCommand extends Command { .setURL('https://discord.gg/6pZ2wtGANP') .setTitle("Help, a list of commands") .setDescription("**ip**: Sends in a dm, the Minecraft server run by the bot Developer." + + "\n\n **8ball** or **ask**: Ask the bot a question and have it respond" + "\n\n **random**: Sends a random *thing*. Send *random* for more details" + "\n\n **cat**: Sends a random picture of a cat." + "\n\n **dog**: Sends a random picture of a dog." + @@ -31,6 +32,7 @@ module.exports = class HelpCommand extends Command { "\n\n **prefix**: Shows the Prefix for the bot." + "\n\n **invite**: Sends an invite for the bot and the support server." + "\n\n **ping**: Sends the ping time of the bot." + + "\n\n **uptime**: Sends the uptime of the bot" + "\n\n **privacy**: Sends in a dm, the privacy policy for the bot." + "\n\nJoin our support server: https://discord.gg/KKYw763") .setFooter(`Delivered in: ${Date.now() - message.createdTimestamp}ms | Antares Bot | ${botVersion}`, 'https://cdn.discordapp.com/icons/649703068799336454/1a7ef8f706cd60d62547d2c7dc08d6f0.png'); diff --git a/index.js b/index.js index 559c2c3d..a9e5b9dc 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,7 @@ const piiCreate = require('./actions/piiCreate'); const counting = require('./functions/counting'); const messageLog = require('./actions/messageLog') const logToConsole = require('./actions/logToConsole') -global.botVersion = "1.3.2"; +global.botVersion = "1.3.3"; global.bot = new CommandoClient({ @@ -139,4 +139,4 @@ bot.on("warn", (e) => console.warn(e)); console.log('Trying to login to the Discord API\nPlease wait for a connection'.yellow); bot.login(process.env.BOT_TOKEN).catch(e => console.error(e)); console.log("Logged into the Discord API".green.bold); -})() \ No newline at end of file +})() //idk why these () are needed but they are \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 00e3d9cb..80b4af76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "antaresbot", - "version": "1.3.2", + "version": "1.3.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e25360d2..3d7b0687 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antaresbot", - "version": "1.3.2", + "version": "1.3.3", "description": "A rewrite of the Antares bot ", "main": "index.js", "dependencies": {