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)
This is the development branch, Where all the work happens. Be careful as some features may bite, or be removed without notice!
# Anitrox d.js v14 Development Branch (anitrox_v14)
This is the Anitrox development branch for Discord.JS v14, Once done this will become Anitrox 1.4
# Dependencies to get started
To begin, you will need to satisfy the following dependencies:
Node.JS: 16.6.0
Node.JS: 16.9.0
npm: 6.14
# Dependencies for development
Visual Studio Code (Recommended)
Visual Studio Code (Recommended, Though you can use any other editor.)
ESLint
# 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.
@ -14,4 +14,4 @@ Afterwards fill out the ``.env.example`` and ``config-example.json`` and then re
<br>
⚠️ If you don't specify the Owner ID, Some commands such as the bot controls will be unusable!
# 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 = {
@ -8,7 +8,7 @@ module.exports = {
name: 'question',
description: 'The question to ask Anitrox',
required: true,
type: Constants.ApplicationCommandOptionTypes.STRING
type: ApplicationCommandOptionType.String
}],
async parseMessage (client, config, message, args) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js');
const { ApplicationCommandOptionType } = require('discord.js');
module.exports = {
@ -8,7 +8,7 @@ module.exports = {
name: 'help',
description: 'The command you want information on',
required: false,
type: Constants.ApplicationCommandOptionTypes.STRING
type: ApplicationCommandOptionType.String
}],
async parseMessage (client, config, message, args) {
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 = [
'https://cdn.discordapp.com/attachments/803658122299572255/807670647920001044/hug2.gif',
@ -16,7 +16,7 @@ module.exports = {
name: 'user',
description: 'The user to hug',
required: true,
type: Constants.ApplicationCommandOptionTypes.USER
type: ApplicationCommandOptionType.String
}],
async parseMessage (client, config, message) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
const { Constants } = require('discord.js');
const { ApplicationCommandOptionType } = require('discord.js');
const gifchoices = [
'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',
description: 'The user to snuggle',
required: true,
type: Constants.ApplicationCommandOptionTypes.USER
type: ApplicationCommandOptionType.User
}],
async parseMessage (client, config, message) {

View File

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

View File

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

View File

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

View File

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

1391
yarn.lock

File diff suppressed because it is too large Load Diff