pull 1.4 dev changes into actual dev branch

pull 1.4 dev changes into actual dev branch, closes #73
This commit is contained in:
Sophie Marie 2023-01-04 20:22:54 -06:00 committed by GitHub
commit fec4dc45ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 79 additions and 1465 deletions

View File

@ -1,12 +1,12 @@
# Anitrox Development Branch (anitrox_dev) # Anitrox d.js v14 Development Branch (anitrox_v14)
This is the development branch, Where all the work happens. Be careful as some features may bite, or be removed without notice! This is the Anitrox development branch for Discord.JS v14, Once done this will become Anitrox 1.4
# Dependencies to get started # Dependencies to get started
To begin, you will need to satisfy the following dependencies: To begin, you will need to satisfy the following dependencies:
Node.JS: 16.6.0 Node.JS: 16.9.0
npm: 6.14 npm: 6.14
# Dependencies for development # Dependencies for development
Visual Studio Code (Recommended) Visual Studio Code (Recommended, Though you can use any other editor.)
ESLint ESLint
# Let's get this ~~party~~ bot started! # Let's get this ~~party~~ bot started!
For first time start up, You will need to run ``npm install`` to install the needed npm packages. For first time start up, You will need to run ``npm install`` to install the needed npm packages.
@ -14,4 +14,4 @@ Afterwards fill out the ``.env.example`` and ``config-example.json`` and then re
<br> <br>
⚠️ If you don't specify the Owner ID, Some commands such as the bot controls will be unusable! ⚠️ If you don't specify the Owner ID, Some commands such as the bot controls will be unusable!
# Support # Support
Support is available on the [Discord Server!](discord.gg/5nQtMNpf43), or @ me on [Twitter!](twitter.com/IDeleteSystem64) [Mastodon!](glaceon.social/@IDeletedSystem64) Support is available on the [Discord Server!](discord.gg/5nQtMNpf43), or @ me on [Mastodon!](glaceon.social/@IDeletedSystem64)

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
module.exports = { module.exports = {
@ -8,7 +8,7 @@ module.exports = {
name: 'question', name: 'question',
description: 'The question to ask Anitrox', description: 'The question to ask Anitrox',
required: true, required: true,
type: Constants.ApplicationCommandOptionTypes.STRING type: ApplicationCommandOptionType.String
}], }],
async parseMessage (client, config, message, args) { async parseMessage (client, config, message, args) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
module.exports = { module.exports = {
@ -8,13 +8,13 @@ module.exports = {
name: 'user', name: 'user',
description: 'Another user', description: 'Another user',
required: false, required: false,
type: Constants.ApplicationCommandOptionTypes.USER type: ApplicationCommandOptionType.User
}, },
{ {
name: 'userid', name: 'userid',
description: "Another user's ID", description: "Another user's ID",
required: false, required: false,
type: Constants.ApplicationCommandOptionTypes.STRING type: ApplicationCommandOptionType.User
}], }],
async parseMessage (client, config, message, args) { async parseMessage (client, config, message, args) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
module.exports = { module.exports = {
@ -8,7 +8,7 @@ module.exports = {
name: 'user', name: 'user',
description: 'The user to bonk', description: 'The user to bonk',
required: true, required: true,
type: Constants.ApplicationCommandOptionTypes.USER type: ApplicationCommandOptionType.User
}], }],
async parseMessage (client, config, message) { async parseMessage (client, config, message) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
module.exports = { module.exports = {
@ -8,7 +8,7 @@ module.exports = {
name: 'user', name: 'user',
description: 'The user to cheese', description: 'The user to cheese',
required: false, required: false,
type: Constants.ApplicationCommandOptionTypes.USER type: ApplicationCommandOptionType.User
}], }],
async parseMessage (client, config, message) { async parseMessage (client, config, message) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
module.exports = { module.exports = {
@ -8,7 +8,7 @@ module.exports = {
name: `option${i + 1}`, name: `option${i + 1}`,
description: 'Another option', description: 'Another option',
required: i === 0, required: i === 0,
type: Constants.ApplicationCommandOptionTypes.STRING type: ApplicationCommandOptionType.String
})), })),
async parseMessage (client, config, message, args) { async parseMessage (client, config, message, args) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
const gifchoices = [ const gifchoices = [
'https://i.pinimg.com/originals/4d/89/d7/4d89d7f963b41a416ec8a55230dab31b.gif', 'https://i.pinimg.com/originals/4d/89/d7/4d89d7f963b41a416ec8a55230dab31b.gif',
@ -15,7 +15,7 @@ module.exports = {
name: 'user', name: 'user',
description: 'The user to cuddle', description: 'The user to cuddle',
required: true, required: true,
type: Constants.ApplicationCommandOptionTypes.USER type: ApplicationCommandOptionType.User
}], }],
async parseMessage (client, config, message) { async parseMessage (client, config, message) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
const { inspect } = require('util'); const { inspect } = require('util');
module.exports = { module.exports = {
@ -9,7 +9,7 @@ module.exports = {
name: 'code', name: 'code',
description: 'The string to evaluate', description: 'The string to evaluate',
required: true, required: true,
type: Constants.ApplicationCommandOptionTypes.STRING type: ApplicationCommandOptionType.String
}], }],
async parseMessage (client, config, message, args) { async parseMessage (client, config, message, args) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
module.exports = { module.exports = {
@ -8,7 +8,7 @@ module.exports = {
name: 'help', name: 'help',
description: 'The command you want information on', description: 'The command you want information on',
required: false, required: false,
type: Constants.ApplicationCommandOptionTypes.STRING type: ApplicationCommandOptionType.String
}], }],
async parseMessage (client, config, message, args) { async parseMessage (client, config, message, args) {
await message.channel.send(this.handle(client, config, message.author, args[0])); await message.channel.send(this.handle(client, config, message.author, args[0]));

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
const gifchoices = [ const gifchoices = [
'https://cdn.discordapp.com/attachments/803658122299572255/807670647920001044/hug2.gif', 'https://cdn.discordapp.com/attachments/803658122299572255/807670647920001044/hug2.gif',
@ -16,7 +16,7 @@ module.exports = {
name: 'user', name: 'user',
description: 'The user to hug', description: 'The user to hug',
required: true, required: true,
type: Constants.ApplicationCommandOptionTypes.USER type: ApplicationCommandOptionType.String
}], }],
async parseMessage (client, config, message) { async parseMessage (client, config, message) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
const gifchoices = [ const gifchoices = [
'https://cdn.discordapp.com/attachments/803658122299572255/807671954055626812/kiss5.gif', 'https://cdn.discordapp.com/attachments/803658122299572255/807671954055626812/kiss5.gif',
@ -16,7 +16,7 @@ module.exports = {
name: 'user', name: 'user',
description: 'The user to kiss', description: 'The user to kiss',
required: true, required: true,
type: Constants.ApplicationCommandOptionTypes.USER type: ApplicationCommandOptionType.User
}], }],
async parseMessage (client, config, message) { async parseMessage (client, config, message) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
const gifchoices = [ const gifchoices = [
'https://cdn.discordapp.com/attachments/793537380330111028/803833954750038066/gif5.gif', 'https://cdn.discordapp.com/attachments/793537380330111028/803833954750038066/gif5.gif',
@ -26,7 +26,7 @@ module.exports = {
name: 'user', name: 'user',
description: 'The user to kiss', description: 'The user to kiss',
required: true, required: true,
type: Constants.ApplicationCommandOptionTypes.USER type: ApplicationCommandOptionType.User
}], }],
async parseMessage (client, config, message) { async parseMessage (client, config, message) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
const gifchoices = [ const gifchoices = [
'https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif', 'https://cdn.discordapp.com/attachments/803658122299572255/805314244123951114/cef569820773b0f5d54ee34cfa18e1f8.gif',
@ -15,7 +15,7 @@ module.exports = {
name: 'user', name: 'user',
description: 'The user to lick', description: 'The user to lick',
required: true, required: true,
type: Constants.ApplicationCommandOptionTypes.USER type: ApplicationCommandOptionType.User
}], }],
async parseMessage (client, config, message) { async parseMessage (client, config, message) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
const gifchoices = [ const gifchoices = [
'https://i.imgur.com/Ns1RBzX.gif', 'https://i.imgur.com/Ns1RBzX.gif',
@ -15,7 +15,7 @@ module.exports = {
name: 'user', name: 'user',
description: 'The user to nom', description: 'The user to nom',
required: true, required: true,
type: Constants.ApplicationCommandOptionTypes.USER type: ApplicationCommandOptionType.User
}], }],
async parseMessage (client, config, message) { async parseMessage (client, config, message) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
const gifchoices = [ const gifchoices = [
'https://cdn.discordapp.com/attachments/803658122299572255/803708174293008474/tenor.gif', 'https://cdn.discordapp.com/attachments/803658122299572255/803708174293008474/tenor.gif',
@ -14,7 +14,7 @@ module.exports = {
name: 'user', name: 'user',
description: 'The user to pat', description: 'The user to pat',
required: true, required: true,
type: Constants.ApplicationCommandOptionTypes.USER type: ApplicationCommandOptionType.User
}], }],
async parseMessage (client, config, message) { async parseMessage (client, config, message) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
const gifchoices = [ const gifchoices = [
'https://i.pinimg.com/originals/b4/95/fb/b495fb19f4b9a1b04f48297b676c497b.gif', 'https://i.pinimg.com/originals/b4/95/fb/b495fb19f4b9a1b04f48297b676c497b.gif',
@ -14,7 +14,7 @@ module.exports = {
name: 'user', name: 'user',
description: 'The user to poke', description: 'The user to poke',
required: true, required: true,
type: Constants.ApplicationCommandOptionTypes.USER type: ApplicationCommandOptionType.User
}], }],
async parseMessage (client, config, message) { async parseMessage (client, config, message) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
module.exports = { module.exports = {
@ -8,7 +8,7 @@ module.exports = {
name: `option${i + 0}`, name: `option${i + 0}`,
description: 'Another option', description: 'Another option',
required: i === 0, required: i === 0,
type: Constants.ApplicationCommandOptionTypes.STRING type: ApplicationCommandOptionType.User
})), })),
async parseMessage (client, config, message, args) { async parseMessage (client, config, message, args) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
module.exports = { module.exports = {
@ -8,7 +8,7 @@ module.exports = {
name: 'user', name: 'user',
description: 'The user to slap', description: 'The user to slap',
required: true, required: true,
type: Constants.ApplicationCommandOptionTypes.USER type: ApplicationCommandOptionType.User
}], }],
async parseMessage (client, config, message) { async parseMessage (client, config, message) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
const gifchoices = [ const gifchoices = [
'https://media.discordapp.net/attachments/803658122299572255/806775382995894282/anime-couple-snuggle-gif-5.gif?width=450&height=238', 'https://media.discordapp.net/attachments/803658122299572255/806775382995894282/anime-couple-snuggle-gif-5.gif?width=450&height=238',
@ -14,7 +14,7 @@ module.exports = {
name: 'user', name: 'user',
description: 'The user to snuggle', description: 'The user to snuggle',
required: true, required: true,
type: Constants.ApplicationCommandOptionTypes.USER type: ApplicationCommandOptionType.User
}], }],
async parseMessage (client, config, message) { async parseMessage (client, config, message) {

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js'); const { ApplicationCommandOptionType } = require('discord.js');
module.exports = { module.exports = {
@ -8,7 +8,7 @@ module.exports = {
name: 'user', name: 'user',
description: 'Another user', description: 'Another user',
required: false, required: false,
type: Constants.ApplicationCommandOptionTypes.USER type: ApplicationCommandOptionType.User
}], }],
async parseMessage (client, config, message) { async parseMessage (client, config, message) {

View File

@ -2,24 +2,22 @@ module.exports = {
event: require('path').parse(__filename).name, event: require('path').parse(__filename).name,
once: false, once: false,
listener: (client, config) => listener: (client, config) =>
async (interaction) => { try {
if (interaction.isApplicationCommand()) { await client.commands.get(interaction.commandName)?.parseInteraction(client, config, interaction);
try { } catch (error) {
await client.commands.get(interaction.commandName)?.parseInteraction(client, config, interaction); console.error(error);
} catch (error) { interaction.channel.send({
console.error(error); embeds: [{
interaction.reply({ title: '<:AnitroxError:809651936563429416> **Something went wrong!**',
embeds: [{ description: error.stack,
title: '<:AnitroxError:809651936563429416> **Something went wrong!**', color: 13632027,
description: error.stack, footer: {
color: 13632027, icon_url: interaction.user.displayAvatarURL(),
footer: { text: config.footerTxt
icon_url: interaction.user.displayAvatarURL(), }
text: config.footerTxt }]
} });
}]
});
}
} }
} }
}; }
;

View File

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

View File

@ -1,13 +1,20 @@
#!/usr/bin/env -S node #!/usr/bin/env -S node
const fs = require('fs'); const fs = require('fs');
const Discord = require('discord.js'); const { Client, Collection, GatewayIntentBits } = require('discord.js');
const config = require('./config.json'); const config = require('./config.json');
require('dotenv').config(); require('dotenv').config();
console.log('Starting!'); console.log('Starting!');
const client = new Discord.Client({ intents: config.intents.map(intent => eval(`Discord.Intents.FLAGS.${intent}`)) }); // const client = new Discord.Client({ intents: config.intents.map(intent => eval(`Discord.Intents.FLAGS.${intent}`)) });
const client = new Client({
client.commands = new Discord.Collection(); intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildPresences
]
});
// todo: move back to file
client.commands = new Collection();
fs.readdirSync('./commands') fs.readdirSync('./commands')
.filter(file => file.endsWith('.js')) .filter(file => file.endsWith('.js'))
.forEach(file => { .forEach(file => {

1391
yarn.lock

File diff suppressed because it is too large Load Diff