Pull changes from 1.3.1-1.3.2 into dev

fuck me
This commit is contained in:
Sophie Marie 2022-12-26 13:26:11 -06:00 committed by GitHub
commit d06d121bea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 171 additions and 24 deletions

View file

@ -11,6 +11,10 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.STRING
}],
async parseMessage (client, config, message, args) {
await message.channel.send(this.handle(client, config, message.author, args.slice(0).join(' ')));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getString('question')));
},

View file

@ -17,6 +17,11 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.STRING
}],
async parseMessage (client, config, message, args) {
const target = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author;
await message.channel.send(this.handle(client, config, message.author, target));
},
async parseInteraction (client, config, interaction) {
const target = interaction.options.getUser('user') || client.users.cache.get(interaction.options.getString('userid')) || interaction.user;
await interaction.reply(this.handle(client, config, interaction.user, target));
@ -32,7 +37,7 @@ module.exports = {
text: config.footerTxt
},
image: {
url: target.displayAvatarURL()
url: target.displayAvatarURL({ dynamic: true })
}
}]
};

View file

@ -11,6 +11,10 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.USER
}],
async parseMessage (client, config, message) {
await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
},

View file

@ -11,6 +11,10 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.USER
}],
async parseMessage (client, config, message) {
await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
},

View file

@ -11,6 +11,13 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.STRING
})),
async parseMessage (client, config, message, args) {
let [head, ...options] = message.content.split(/\s*\n\s*/);
head = head.slice(this.name.length + config.prefix.length);
if (head) options.push(head);
await message.channel.send(this.handle(client, config, message.author, options));
},
async parseInteraction (client, config, interaction) {
console.log([...Array(10).keys()].map(i => interaction.options.getString(`option${i + 1}`)).filter(str => str));
await interaction.reply(this.handle(client, config, interaction.user, [...Array(10).keys()].map(i => interaction.options.getString(`option${i + 1}`)).filter(str => str)));

View file

@ -4,6 +4,10 @@ module.exports = {
description: 'Attributions to open source components used by Anitrox',
options: [],
async parseMessage (_, config, message) {
await message.channel.send(this.handle(config, message.author));
},
async parseInteraction (_, config, interaction) {
await interaction.reply(this.handle(config, interaction.user));
},

View file

@ -18,6 +18,10 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.USER
}],
async parseMessage (client, config, message) {
await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
},

View file

@ -12,6 +12,10 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.STRING
}],
async parseMessage (client, config, message, args) {
await message.channel.send(this.handle(client, config, message.author, args.join(' ')));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getString('code')));
},

View file

@ -10,6 +10,9 @@ module.exports = {
required: false,
type: Constants.ApplicationCommandOptionTypes.STRING
}],
async parseMessage (client, config, message, args) {
await message.channel.send(this.handle(client, config, message.author, args[0]));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getString('help')));

View file

@ -19,6 +19,10 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.USER
}],
async parseMessage (client, config, message) {
await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
},

View file

@ -6,6 +6,11 @@ module.exports = {
description: 'Bot and System information',
options: [],
async parseMessage (client, config, message) {
await message.channel.send(this.handle(client, config, message.author));
},
// We'll be moving solely to Slash Commands in 1.4
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user));
},
@ -26,7 +31,7 @@ module.exports = {
fields: [
{ name: '<:anitrox:831193012699791361> Bot Information', value: '** **' },
{ name: 'Bot Name', value: `${client.user.tag}`, inline: true },
{ name: 'Bot ID', value: '``' + `${client.user.id}` + '``', inline: true },
{ name: 'Bot ID', value: `${client.user.id}`, inline: true },
{ name: 'Bot Owner', value: isNaN(process.env.OWNERID) ? "Owner didn't set an OwnerID :(" : client.users.cache.get(process.env.OWNERID).username, inline: true },
{ name: 'Release Type', value: config.release, inline: true },
{ name: 'Version', value: config.build, inline: true },

View file

@ -4,6 +4,10 @@ module.exports = {
description: 'Add Anitrox to your beautiful server!',
options: [],
async parseMessage (client, config, message) {
await message.channel.send(this.handle(client, config, message.author));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user));
},
@ -23,8 +27,8 @@ module.exports = {
},
fields: [
{ name: 'Anitrox', value: 'Get the ripe off the vine Anitrox! \n [Add Anitrox to your server](https://discord.com/oauth2/authorize?client_id=576805923964715018&scope=bot&permissions=8)' },
{ name: 'Anitrox PTB (Public Test Build)', value: 'Anitrox PTB was discontinued on November 25th, 2022. \n [Learn More](https://docs.google.com/document/d/1cpmJjBEo-blxvirOtDsIT-Hrq40qVseRHBY7asBT47k/)' },
{ name: 'Anitrox Dev, Self hosting and more!', value: 'Self-host your own Anitrox (including dev!), Contribute, and more! The possibilites are endless.\n[Anitrox Source](https://github.com/IDeletedSystem64/anitrox)' },
{ name: 'Anitrox PTB (Public Test Build)', value: 'Anitrox PTB is going to be discontinued on November 25th, 2022. [Learn More](https://docs.google.com/document/d/1cpmJjBEo-blxvirOtDsIT-Hrq40qVseRHBY7asBT47k)' },
{ name: 'Anitrox Dev, Self hosting and more!', value: 'Self-host your own Anitrox (including dev!), Contribute, and more! The possibilites are endless. [Anitrox Source](https://github.com/IDeletedSystem64/anitrox)' },
{ name: 'Need help?', value: 'Come join the Anitrox Support Server, for support and much more!\n [Anitrox Support Server](https://discord.gg/grebRGsBZ3)' }
]
}]

View file

@ -19,6 +19,10 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.USER
}],
async parseMessage (client, config, message) {
await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
},

View file

@ -29,6 +29,10 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.USER
}],
async parseMessage (client, config, message) {
await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
},

View file

@ -18,6 +18,10 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.USER
}],
async parseMessage (client, config, message) {
await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
},

View file

@ -18,6 +18,10 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.USER
}],
async parseMessage (client, config, message) {
await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
},

View file

@ -17,6 +17,10 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.USER
}],
async parseMessage (client, config, message) {
await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
},

View file

@ -4,6 +4,10 @@ module.exports = {
description: 'Gets bot ping',
options: [],
async parseMessage (client, config, message, args) {
await message.channel.send(await this.handle(client, config, message.author));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(await this.handle(client, config, interaction.user));
},

View file

@ -17,6 +17,10 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.USER
}],
async parseMessage (client, config, message) {
await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
},

View file

@ -11,6 +11,10 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.STRING
})),
async parseMessage (client, config, message, args) {
await message.channel.send(this.handle(client, config, message.author, args));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, [...Array(10).keys()].map(i => interaction.options.getString(`option${i + 1}`)).filter(str => str)));
},

View file

@ -4,6 +4,10 @@ module.exports = {
description: 'Restarts the bot',
options: [],
async parseMessage (client, config, message) {
await this.handle(client, config, message.author, message.channel);
},
async parseInteraction (client, config, interaction) {
await this.handle(client, config, interaction.user, interaction.channel);
},

View file

@ -11,6 +11,10 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.USER
}],
async parseMessage (client, config, message) {
await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
},

View file

@ -17,6 +17,10 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.USER
}],
async parseMessage (client, config, message) {
await message.channel.send(this.handle(client, config, message.author, message.mentions.users.first()));
},
async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getUser('user')));
},

View file

@ -4,28 +4,32 @@ module.exports = {
description: "IT'S TIME TO STOP!... the bot",
options: [],
async parseInteraction (client, config, interaction) {
await this.handle(client, config, interaction);
async parseMessage (client, config, message) {
await this.handle(client, config, message.author, message.channel);
},
async handle (client, config, interaction) {
if (interaction.user.id === process.env.OWNERID) {
console.log('[SYSTEM] [INFO] ' + `The bot is going down for shut down. Shutdown requested by ${interaction.user.username}`);
await interaction.reply({
async parseInteraction (client, config, interaction) {
await this.handle(client, config, interaction.user, interaction.channel);
},
async handle (client, config, user, channel) {
if (user.id === process.env.OWNERID) {
console.log('[SYSTEM] [INFO] ' + `The bot is going down for shut down. \nShutdown requested by ${user.username}`);
await channel.send({
embeds: [{
title: 'Shutdown bot',
description: '<a:AnitroxWorking:997565411212144730> Shutting Down...',
title: '**Shut down the bot**',
description: '<a:AnitroxWorking:997565411212144730> **Shutting Down...**',
color: 9442302,
footer: {
icon_url: interaction.user.displayAvatarURL(),
icon_url: user.displayAvatarURL(),
text: config.footerTxt
}
}]
});
process.exit();
} else {
console.error('[SYSTEM] [ERR] User ' + interaction.user.username + " tried to shut down the bot, but doesn't have permission! If this was you, Check your config.json");
await interaction.reply(client.generateErrorMessage('You do not have permission to run this command.', interaction.user.displayAvatarURL()));
console.error('[SYSTEM] [ERR] User ' + user.username + " tried to shut down the bot, but doesn't have permission! If this was you, Check your config.json");
await channel.send(client.generateErrorMessage('You do not have permission to run this command.', user.displayAvatarURL()));
}
}
};

View file

@ -11,6 +11,11 @@ module.exports = {
type: Constants.ApplicationCommandOptionTypes.USER
}],
async parseMessage (client, config, message) {
const target = message.mentions.members.first() || message.member;
await message.channel.send(this.handle(client, config, message.author, target));
},
async parseInteraction (client, config, interaction) {
const target = interaction.options.getUser('user') ? (await interaction.guild.members.fetch(interaction.options.getUser('user'))) : interaction.member;
await interaction.reply(this.handle(client, config, interaction.user, target));

View file

@ -1,4 +1,5 @@
{
"prefix": "n!",
"release": "Developer Release",
"build": "1.4dev",
"footerTxt": "Anitrox, made with <3 by IDeletedSystem64 | 2018-2022",

View file

@ -8,7 +8,7 @@ module.exports = {
await client.commands.get(interaction.commandName)?.parseInteraction(client, config, interaction);
} catch (error) {
console.error(error);
interaction.channel.send({
interaction.reply({
embeds: [{
title: '<:AnitroxError:809651936563429416> **Something went wrong!**',
description: error.stack,

41
events/messageCreate.js Normal file
View file

@ -0,0 +1,41 @@
module.exports = {
event: require('path').parse(__filename).name,
once: false,
listener: (client, config) =>
async (message) => {
if (!message.content.startsWith(config.prefix) || message.author.bot) return;
const args = message.content.slice(config.prefix.length).split(/\s+/);
const command = args.shift()?.toLowerCase() ?? '';
if (!client.commands.has(command)) return;
try {
message.channel.send({
embeds: [{
title: `<:AnitroxWarning:997565364718276669> Attention, ${message.author.username}!`,
description: `Anitrox will be moving entirely to slash commands in 1.4, You will no longer be able to use \`\` ${command} \`\` by typing ${config.prefix}${command}.\n Please use slash commands in the future. [Learn more](https://support.discord.com/hc/en-us/articles/1500000368501-Slash-Commands-FAQ)`,
color: 15548997,
footer: {
icon_url: message.author.displayAvatarURL(),
text: config.footerTxt
}
}]
});
await client.commands.get(command)?.parseMessage(client, config, message, args);
} catch (error) {
console.error(error);
message.channel.send({
embeds: [{
title: '<:AnitroxError:809651936563429416> **Something went wrong!**',
description: error.stack,
color: 13632027,
footer: {
icon_url: message.author.displayAvatarURL(),
text: config.footerTxt
}
}]
});
}
}
};

View file

@ -48,7 +48,7 @@ module.exports = {
console.log('/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| ');
console.log('');
console.log(`${config.release}, ${config.build}`);
console.log('Bot ready. | Anitrox by IDeletedSystem64 | Now with 100% more slash commands!');
console.log('Bot online. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!');
// Statuses
setInterval(async () => {
// Picks a status from the config file

View file

@ -4,19 +4,19 @@
"description": "Discord Bot Based on Discord.JS",
"main": "start.js",
"dependencies": {
"discord.js": "^13.10.0",
"dotenv": "^16.0.3",
"node-fetch": "^3.2.10",
"node-os-utils": "^1.3.7",
"discord.js": "^13.6.0",
"dotenv": "^16.0.1",
"node-fetch": "^3.2.9",
"node-os-utils": "^1.3.2",
"require-all": "^3.0.0"
},
"author": "IDeletedSystem64",
"license": "GPLv3",
"devDependencies": {
"eslint": "^8.26.0",
"eslint": "^8.13.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.3.0",
"eslint-plugin-promise": "^6.1.1"
"eslint-plugin-n": "^15.1.0",
"eslint-plugin-promise": "^6.0.0"
}
}