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

View File

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

View File

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

View File

@ -9,7 +9,7 @@ module.exports = {
name: "cuddle", name: "cuddle",
description: "Cuddle an user!", description: "Cuddle an user!",
async execute(client, message, _, footerTxt) { async execute(client, message, _, config) {
const taggedUser = message.mentions.users.first(); const taggedUser = message.mentions.users.first();
const index = Math.floor(Math.random() * gifchoices.length); const index = Math.floor(Math.random() * gifchoices.length);
@ -24,7 +24,7 @@ module.exports = {
"color": 9442302, "color": 9442302,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),
"text": footerTxt "text": config.footerTxt
}, },
"image": { "image": {
"url": gif "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..', description: 'Get help on anything from commands, to what the bot does! just not your homework..',
syntax: '<Command>', syntax: '<Command>',
async execute(_0, message, _1, footerTxt) { async execute(_0, message, _1, config) {
await message.channel.send({embed: { await message.channel.send({embed: {
"title": "HELP! SEYMOUR! THE BOT IS ON FIRE!", "title": "HELP! SEYMOUR! THE BOT IS ON FIRE!",
"description": "Get help on anything from commands, to what the bot does! just not your homework..", "description": "Get help on anything from commands, to what the bot does! just not your homework..",
"color": 9442302, "color": 9442302,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "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": [ "fields": [
{ {

View File

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

View File

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

View File

@ -1,16 +1,16 @@
module.exports = { module.exports = {
name: 'invite', name: 'invite',
description: 'Add Anitrox to your beautiful server!', description: 'Add Anitrox to your beautiful server!',
syntax: [], syntax: [],
async execute(_0, message, _1, footerTxt) { async execute(_0, message, _1, config) {
await message.channel.send({embed: { await message.channel.send({embed: {
"title": "Add Anitrox to your Server!", "title": "Add Anitrox to your Server!",
"description": "Weather you want stable, or that squeaky clean fresh PTB build, we gotchu.", "description": "Weather you want stable, or that squeaky clean fresh PTB build, we gotchu.",
"color": 9442302, "color": 9442302,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),
"text": footerTxt "text": config.footerTxt
}, },
"thumbnail": { "thumbnail": {
"url": "https://cdn.discordapp.com/attachments/803658122299572255/814352905394061322/anitroxaddsrvr.png" "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", name: "kiss",
description: "Kisses a user!", description: "Kisses a user!",
async execute(client, message, _, footerTxt) { async execute(client, message, _, config) {
const taggedUser = message.mentions.users.first(); const taggedUser = message.mentions.users.first();
if(!taggedUser) { if(!taggedUser) {
@ -23,7 +23,7 @@ module.exports = {
"color": 9442302, "color": 9442302,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),
"text": footerTxt "text": config.footerTxt
}, },
"image": { "image": {
"url": gif "url": gif

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
module.exports = { module.exports = {
name: "ping", name: "ping",
description: "Gets bot 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 index = Math.floor(Math.random() * config.locations.length);
const location = config.locations[index] const location = config.locations[index]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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