Merge pull request #48 from Foxinatel/dev

Patch the config-printing issue + indentation fix
This commit is contained in:
Sophie Mondz 2022-03-29 18:07:17 -05:00 committed by GitHub
commit 570edf6da5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 56 additions and 61 deletions

View File

@ -2,7 +2,7 @@ module.exports = {
name: "avatar",
description: "Gets a user's avatar.",
async execute(client, message, args, footerTxt) {
async execute(client, message, args, config) {
const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author;
@ -11,7 +11,7 @@ module.exports = {
"color": 9442302,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"image": {
"url": user.displayAvatarURL()

View File

@ -2,7 +2,7 @@ module.exports = {
name: "bonk",
description: "Bonks a user!",
async execute(client, message, _, footerTxt) {
async execute(client, message, _, config) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
@ -14,7 +14,7 @@ module.exports = {
"color": 9442302,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"image": {
"url": "https://cdn.discordapp.com/attachments/793537380330111028/801194481549312060/HappyBONK.gif"

View File

@ -1,7 +1,7 @@
module.exports = {
name: "cheese",
description: "Cheese an user, or run just ``n!cheese`` for a surprise :eyes:",
async execute(_0, message, _1, footerTxt) {
async execute(_0, message, _1, config) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
await message.channel.send("*slams cheese on desk*\n**Cheese.** https://www.youtube.com/watch?v=Or4IE8fkpn4");
@ -12,7 +12,7 @@ module.exports = {
"color": 16312092,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"image": {
"url": "https://cdn.discordapp.com/attachments/803658122299572255/812867714368536636/R06325af354168febcafd96b8328b7590.png"

View File

@ -9,7 +9,7 @@ module.exports = {
name: "cuddle",
description: "Cuddle an user!",
async execute(client, message, _, footerTxt) {
async execute(client, message, _, config) {
const taggedUser = message.mentions.users.first();
const index = Math.floor(Math.random() * gifchoices.length);
@ -24,7 +24,7 @@ module.exports = {
"color": 9442302,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"image": {
"url": gif

View File

@ -4,14 +4,14 @@ module.exports = {
description: 'Get help on anything from commands, to what the bot does! just not your homework..',
syntax: '<Command>',
async execute(_0, message, _1, footerTxt) {
async execute(_0, message, _1, config) {
await message.channel.send({embed: {
"title": "HELP! SEYMOUR! THE BOT IS ON FIRE!",
"description": "Get help on anything from commands, to what the bot does! just not your homework..",
"color": 9442302,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": `${footerTxt} | No mother it's just the northern lights`
"text": `${config.footerTxt} | No mother it's just the northern lights`
},
"fields": [
{

View File

@ -10,7 +10,7 @@ module.exports = {
name: "hug",
description: "Hugs a user!",
async execute(client, message, _, footerTxt) {
async execute(client, message, _, config) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
@ -23,7 +23,7 @@ module.exports = {
"color": 8311585,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"image": {
"url": gif

View File

@ -1,10 +1,8 @@
const {build, release} = require('../config.json');
module.exports = {
name: 'info',
description: 'Shows bot and host information',
async execute(client, message, _, footerTxt) {
name: 'info',
description: 'Shows bot and host information',
async execute(client, message, _, config) {
function Uptime(uptime) {
const totalSeconds = (uptime / 1000);
@ -31,7 +29,7 @@ module.exports = {
"color": 9442302,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"thumbnail": {
"url": client.user.displayAvatarURL()
@ -43,12 +41,12 @@ module.exports = {
},
{
"name": "Release Type",
"value": release,
"value": config.release,
"inline": true
},
{
"name": "Release Version",
"value": build,
"value": config.build,
"inline": true
},
{

View File

@ -1,16 +1,16 @@
module.exports = {
name: 'invite',
description: 'Add Anitrox to your beautiful server!',
syntax: [],
async execute(_0, message, _1, footerTxt) {
name: 'invite',
description: 'Add Anitrox to your beautiful server!',
syntax: [],
async execute(_0, message, _1, config) {
await message.channel.send({embed: {
"title": "Add Anitrox to your Server!",
"description": "Weather you want stable, or that squeaky clean fresh PTB build, we gotchu.",
"color": 9442302,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"thumbnail": {
"url": "https://cdn.discordapp.com/attachments/803658122299572255/814352905394061322/anitroxaddsrvr.png"
@ -30,5 +30,5 @@ module.exports = {
}
]
}});
},
},
};

View File

@ -10,7 +10,7 @@ module.exports = {
name: "kiss",
description: "Kisses a user!",
async execute(client, message, _, footerTxt) {
async execute(client, message, _, config) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
@ -23,7 +23,7 @@ module.exports = {
"color": 9442302,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"image": {
"url": gif

View File

@ -20,7 +20,7 @@ module.exports = {
name: "leskiss",
description: "Lesbian kiss <:lesbian:803831629428686849>",
async execute(client, message, _, footerTxt) {
async execute(client, message, _, config) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
@ -33,7 +33,7 @@ module.exports = {
"color": 8311585,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"image": {
"url": gif

View File

@ -9,7 +9,7 @@ module.exports = {
name: "lick",
description: "Licks a user!",
async execute(client, message, _, footerTxt) {
async execute(client, message, _, config) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
@ -22,7 +22,7 @@ module.exports = {
"color": 8311585,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"image": {
"url": "https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif"

View File

@ -9,7 +9,7 @@ module.exports = {
name: "nom",
description: "Noms an user!",
async execute(client, message, _, footerTxt) {
async execute(client, message, _, config) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
@ -22,7 +22,7 @@ module.exports = {
"color": 8311585,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"image": {
"url": gif

View File

@ -1,14 +1,14 @@
module.exports = {
name: 'opensource',
description: 'Attributions to open source components used by Anitrox',
async execute(_0, message, _1, footerTxt){
async execute(_0, message, _1, config){
await message.channel.send({embed: {
"title": "Component Attribution",
"description": "Some parts of Anitrox are using open source code, and their attributions are avaliable here!",
"color": 52508,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"thumbnail": {
"url": "https://cdn.discordapp.com/attachments/803658122299572255/838854256471703602/793885335498522685.png"

View File

@ -8,7 +8,7 @@ module.exports = {
name: "pat",
description: "Pats a user!",
async execute(client, message, _, footerTxt) {
async execute(client, message, _, config) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
@ -21,7 +21,7 @@ module.exports = {
"color": 8311585,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"image": {
"url": gif

View File

@ -1,7 +1,7 @@
module.exports = {
name: "ping",
description: "Gets bot ping",
async execute(client, message, args, config) {
async execute(client, message, _, config) {
const index = Math.floor(Math.random() * config.locations.length);
const location = config.locations[index]

View File

@ -8,7 +8,7 @@ module.exports = {
name: "poke",
description: "Pokes a user!",
async execute(client, message, _, footerTxt) {
async execute(client, message, _, config) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
@ -21,7 +21,7 @@ module.exports = {
"color": 8311585,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"image": {
"url": gif

View File

@ -34,7 +34,7 @@ module.exports = {
"color": 13632027,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"fields": [
{
@ -43,6 +43,6 @@ module.exports = {
}
]
}});
}
}
}
}
};

View File

@ -1,5 +1,3 @@
const { token } = require('../config.json');
module.exports = {
name: 'restart',
description: '(Owner Only) Shuts down the bot.',
@ -8,7 +6,7 @@ module.exports = {
await message.channel.send("<a:NyabotWorking:697147309531594843> Restarting...")
try {
client.destroy();
await client.login(token);
await client.login(config.token);
await message.channel.send("<:NyabotSuccess:697211376740859914> Restart Successful")
console.log("All systems go")
} catch(e) {console.log(e);}

View File

@ -1,7 +1,7 @@
module.exports = {
name: 'setnick',
description: 'Sets your nickname',
async execute(client, message, args, footerTxt) {
async execute(client, message, args, config) {
if (message.channel.permissionsFor(message.author).has("CHANGE_NICKNAME")) {
const newnick = args.slice(0).join(" ")
@ -13,7 +13,7 @@ module.exports = {
"color": 9442302,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"fields": [
{

View File

@ -2,7 +2,7 @@ module.exports = {
name: "slap",
description: "Slaps an user!",
async execute(client, message, _, footerTxt) {
async execute(client, message, _, config) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
@ -14,7 +14,7 @@ module.exports = {
"color": 9442302,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"image": {
"url": "https://media1.tenor.com/images/b6d8a83eb652a30b95e87cf96a21e007/tenor.gif?itemid=10426943"

View File

@ -9,7 +9,7 @@ module.exports = {
name: "snuggle",
description: "Snuggle an user!",
async execute(client, message, _, footerTxt) {
async execute(client, message, _, config) {
const taggedUser = message.mentions.users.first();
if(!taggedUser) {
@ -22,7 +22,7 @@ module.exports = {
"color": 9442302,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"image": {
"url": gif

View File

@ -1,7 +1,7 @@
module.exports = {
name: "stop",
description: "IT'S TIME TO STOP!... the bot",
async execute(client, message, config) {
async execute(_, message, config) {
if (message.author.id == config.ownerID) {
await message.channel.send({embed: {
"title": "<a:AnitroxWorking:697147309531594843> **Shutting Down...**",

View File

@ -2,14 +2,14 @@ module.exports = {
name: "uinfo",
description: "Gets info about an user, such as ID, Discord Join date and more",
syntax: "<User>",
async execute(client, message, args, footerTxt) {
async execute(client, message, args, config) {
const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author
await message.channel.send({embed: {
"title": `Everything you've ever wanted to know about ${user.username}!`,
"color": 9442302,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": footerTxt
"text": config.footerTxt
},
"thumbnail": {
"url": user.displayAvatarURL()

View File

@ -2,7 +2,6 @@
const fs = require('fs');
const Discord = require('discord.js');
// const { statuses, build, release, prefix, token, footerTxt } = require('./config.json');
const config = require('./config.json');
console.log('Starting!')
const client = new Discord.Client();
@ -11,8 +10,8 @@ client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
}
client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: {
@ -73,8 +72,8 @@ client.on('message', async (message) => {
"icon_url": message.author.displayAvatarURL(),
"text": config.footerTxt
},
}});
}
}});
}
});
client.login(config.token);