Merge pull request #77 from IDeletedSystem64/mergeconflict

Pull dev changes into v14
This commit is contained in:
Sophie Marie 2022-12-26 16:34:33 -06:00 committed by GitHub
commit cb621c21ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 163 additions and 31 deletions

View File

@ -11,6 +11,10 @@ module.exports = {
type: ApplicationCommandOptionType.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: ApplicationCommandOptionType.User
}],
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));
@ -25,15 +30,12 @@ module.exports = {
handle (_, config, user, target) {
return {
embeds: [{
title: `:frame_photo: ${target.username}'s Beautiful Avatar!`,
title: `:frame_photo: ${target.username}'s Beautiful Profile Picture!`,
description: `[Profile picture link (Mobile users, tap here!)](${target.displayAvatarURL({ dynamic: true })})`,
color: 9442302,
footer: {
icon_url: user.displayAvatarURL(),
text: config.footerTxt
},
image: {
url: target.displayAvatarURL()
}
image: { url: target.displayAvatarURL({ dynamic: true }) },
footer: { icon_url: user.displayAvatarURL(), text: config.footerTxt }
}]
};
}

View File

@ -11,6 +11,10 @@ module.exports = {
type: ApplicationCommandOptionType.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: ApplicationCommandOptionType.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: ApplicationCommandOptionType.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

@ -1,9 +1,13 @@
module.exports = {
name: require('path').parse(__filename).name,
description: 'Attributions to open source components used by Anitrox',
description: 'Attributions to users who have worked on 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));
},
@ -24,11 +28,11 @@ module.exports = {
fields: [
{
name: 'chuu_shi',
value: 'Thanks to Chuu for letting me use some of his resources to host Anitrox!\n <:GitHub:778165439477841981> [Check out his code!](https://github.com/chuushi)'
value: 'Thanks to Chuu for letting me use some of his resources to host Anitrox!\n <:GitHub:778165439477841981> [Check out his code!](https://github.com/chuushi)\n <:discord:1057053513210937444> [Check out his Discord community!](https://port.chuu.sh/)'
},
{
name: 'OfficialTCGMatt',
value: "Matt has helped quite a bit with Anitrox, especially in the early days of Anitrox's development! He even has his own bot!\n <:GitHub:778165439477841981> [Check out his code!](https://github.com/OfficialTCGMatt)\n :robot: [Check out TheCodingBot!](https://github.com/TMC-Software/TheCodingBot)"
name: 'TheCodingGuy',
value: "Matt has helped quite a bit with Anitrox, especially in the early days of Anitrox's development! He even has his own bot!\n <:GitHub:778165439477841981> [Check out his code!](https://github.com/Aisuruneko)\n :robot: [Check out TheCodingBot!](https://github.com/NetroCorp/TheCodingBot)\n :globe_with_meridians: [Check out Netro Corp!](https://netrocorp.net)"
},
{
name: 'Foxinatel',

View File

@ -18,6 +18,10 @@ module.exports = {
type: ApplicationCommandOptionType.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: ApplicationCommandOptionType.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: ApplicationCommandOptionType.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: ApplicationCommandOptionType.String
}],
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: ApplicationCommandOptionType.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: ApplicationCommandOptionType.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: ApplicationCommandOptionType.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: ApplicationCommandOptionType.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: ApplicationCommandOptionType.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: ApplicationCommandOptionType.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: ApplicationCommandOptionType.User
})),
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);
},
@ -12,7 +16,7 @@ module.exports = {
if (user.id === process.env.OWNERID) {
const embeds = [{
title: '<a:AnitroxWorking:997565411212144730> Restart Bot',
description: 'Restarting Anitrox...',
description: '<a:AnitroxWorking:997565411212144730> Restarting now, Be back in a minute!',
color: 9442302,
footer: {
icon_url: user.displayAvatarURL(),

View File

@ -11,6 +11,10 @@ module.exports = {
type: ApplicationCommandOptionType.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: ApplicationCommandOptionType.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 now, Until next time!',
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: ApplicationCommandOptionType.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,7 +1,8 @@
{
"prefix": "n!",
"release": "Developer Release",
"build": "1.4dev",
"footerTxt": "Anitrox, made with <3 by IDeletedSystem64 | 2018-2022",
"build": "1.3.3dev",
"footerTxt": "Anitrox, made with <3 by IDeletedSystem64 | 2018-2023",
"sandbox": {
"enabled": false,
"id": "0",

View File

@ -2,7 +2,6 @@ module.exports = {
event: require('path').parse(__filename).name,
once: false,
listener: (client, config) =>
async (interaction) => {
try {
await client.commands.get(interaction.commandName)?.parseInteraction(client, config, interaction);
} catch (error) {

30
events/messageCreate.js Normal file
View File

@ -0,0 +1,30 @@
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 {
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