Compare commits

..

3 commits
dev ... stable

Author SHA1 Message Date
Sophie Marie
a1f6982a90
Update LICENSE.md 2024-01-30 11:53:15 -06:00
3c88b53039
Announce the end of the project 2024-01-30 11:52:39 -06:00
Sophie Marie
53eb34b264
1.3.3
Update to 1.3.3
2022-12-26 16:34:56 -06:00
33 changed files with 1480 additions and 2826 deletions

View file

@ -1,27 +0,0 @@
---
name: Bug report
about: Create a report to help us improve Anitrox for you, for everybody. ❤️
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here, Such as version if applicable (ex: you host Anitrox yourself)

View file

@ -1,20 +0,0 @@
---
name: Feature request
about: Suggest an idea for this Anitrox
title: ''
labels: Suggestion
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

1
.gitignore vendored
View file

@ -3,6 +3,7 @@
# NPM/Yarn stuff. # NPM/Yarn stuff.
node_modules/ node_modules/
package-lock.json
# Let's not leak any tokens now... That would be very bad # Let's not leak any tokens now... That would be very bad
config.json config.json

View file

@ -1,4 +1,4 @@
const { ApplicationCommandOptionType } = require('discord.js'); const { Constants } = 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: ApplicationCommandOptionType.String type: Constants.ApplicationCommandOptionTypes.STRING
}], }],
async parseMessage (client, config, message, args) { async parseMessage (client, config, message, args) {

View file

@ -1,4 +1,4 @@
const { ApplicationCommandOptionType } = require('discord.js'); const { Constants } = 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: ApplicationCommandOptionType.User type: Constants.ApplicationCommandOptionTypes.USER
}, },
{ {
name: 'userid', name: 'userid',
description: "Another user's ID", description: "Another user's ID",
required: false, required: false,
type: ApplicationCommandOptionType.User type: Constants.ApplicationCommandOptionTypes.STRING
}], }],
async parseMessage (client, config, message, args) { async parseMessage (client, config, message, args) {

View file

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

View file

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

View file

@ -1,4 +1,4 @@
const { ApplicationCommandOptionType } = require('discord.js'); const { Constants } = 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: ApplicationCommandOptionType.String type: Constants.ApplicationCommandOptionTypes.STRING
})), })),
async parseMessage (client, config, message, args) { async parseMessage (client, config, message, args) {

View file

@ -37,10 +37,6 @@ module.exports = {
{ {
name: 'Foxinatel', name: 'Foxinatel',
value: 'Foxi has made massive improvements to Anitrox, such as improving error handling, and much more!\n<:GitHub:778165439477841981> [Check out his code!](https://github.com/foxinatel)' value: 'Foxi has made massive improvements to Anitrox, such as improving error handling, and much more!\n<:GitHub:778165439477841981> [Check out his code!](https://github.com/foxinatel)'
},
{
name: 'Zaeroses',
value: 'Zaeroses created the Xenia icon Ive used in about when a user hosts Anitrox on Linux based systems. Its been modified to have a transflag-colored glow in the background. \n<:fediverse:1060390228881322004> [Check out their Mastodon! (chitter.xyz)](https://chitter.xyz/@Zaeroses)\n<:GitHub:778165439477841981> [Checkout their code!](https://github.com/Zaeroses)'
} }
] ]
}] }]

View file

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

View file

@ -1,4 +1,4 @@
const { ApplicationCommandOptionType } = require('discord.js'); const { Constants } = 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: ApplicationCommandOptionType.String type: Constants.ApplicationCommandOptionTypes.STRING
}], }],
async parseMessage (client, config, message, args) { async parseMessage (client, config, message, args) {

View file

@ -1,4 +1,4 @@
const { ApplicationCommandOptionType } = require('discord.js'); const { Constants } = 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: ApplicationCommandOptionType.String type: Constants.ApplicationCommandOptionTypes.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 { ApplicationCommandOptionType } = require('discord.js'); const { Constants } = 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: ApplicationCommandOptionType.String type: Constants.ApplicationCommandOptionTypes.USER
}], }],
async parseMessage (client, config, message) { async parseMessage (client, config, message) {

View file

@ -2,13 +2,14 @@ const Uptime = require('../functions/uptime.js');
const os = require('os'); const os = require('os');
const osu = require('node-os-utils'); const osu = require('node-os-utils');
module.exports = { module.exports = {
name: 'about', name: 'info',
description: 'About this bot, as well as the system its running on', description: 'Bot and System information',
options: [], options: [],
async parseMessage (client, config, message) { async parseMessage (client, config, message) {
await message.channel.send(this.handle(client, config, message.author)); 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) { async parseInteraction (client, config, interaction) {
await interaction.reply(this.handle(client, config, interaction.user)); await interaction.reply(this.handle(client, config, interaction.user));
@ -39,7 +40,7 @@ module.exports = {
{ name: ':timer: Bot Uptime', value: Uptime(client.uptime), inline: true }, { name: ':timer: Bot Uptime', value: Uptime(client.uptime), inline: true },
{ name: ':one: Total Servers', value: `** **${client.guilds.cache.size}`, inline: true }, { name: ':one: Total Servers', value: `** **${client.guilds.cache.size}`, inline: true },
{ name: '<:hostinfo:997565639352926250> System Information', value: '** **' }, { name: '<:hostinfo:997565639352926250> System Information', value: '** **' },
{ name: `${((process.platform === 'linux') ? '<:linux_xenia_trans:1060380032788353144>' : '<:windows:997919047511453696>')} System Platform`, value: process.platform, inline: true }, { name: `${((process.platform === 'linux') ? '<:linux_tux:997565742960615424>' : '<:windows:997919047511453696>')} System Platform`, value: process.platform, inline: true },
{ name: `${((process.platform === 'linux') ? ':gear: Kernel Version' : ':gear: System Version')}`, value: os.release(), inline: true }, { name: `${((process.platform === 'linux') ? ':gear: Kernel Version' : ':gear: System Version')}`, value: os.release(), inline: true },
{ name: ':timer: System Uptime', value: Uptime(os.uptime() * 1000), inline: true }, { name: ':timer: System Uptime', value: Uptime(os.uptime() * 1000), inline: true },
{ name: '<:cpu:997565592028598282> System CPU Architecture', value: os.arch(), inline: true }, { name: '<:cpu:997565592028598282> System CPU Architecture', value: os.arch(), inline: true },

View file

@ -27,8 +27,9 @@ module.exports = {
}, },
fields: [ 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', 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 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: '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: 'Support', value: 'Come join the Anitrox Support Server, for support with Anitrox, help setting up your own self-hosted Anitrox and more!\n [Anitrox Support Server](https://discord.gg/grebRGsBZ3)' } { 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

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,4 @@
const { ApplicationCommandOptionType } = require('discord.js'); const { Constants } = 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: ApplicationCommandOptionType.User type: Constants.ApplicationCommandOptionTypes.STRING
})), })),
async parseMessage (client, config, message, args) { async parseMessage (client, config, message, args) {

View file

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

View file

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

View file

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

View file

@ -1,13 +1,8 @@
{ {
"prefix": "n!", "prefix": "n!",
"build": "1.4", "release": "Developer Release",
"build": "1.3.3dev",
"footerTxt": "Anitrox, made with <3 by IDeletedSystem64 | 2018-2023", "footerTxt": "Anitrox, made with <3 by IDeletedSystem64 | 2018-2023",
"imageApi": "",
"updater": {
"enabled": true,
"frequency": "360",
"gitRepo": "IDeletedSystem64/anitrox"
},
"sandbox": { "sandbox": {
"enabled": false, "enabled": false,
"id": "0", "id": "0",
@ -69,5 +64,10 @@
"Go for it! :smile:", "Go for it! :smile:",
"Good idea!", "Good idea!",
"Sure" "Sure"
],
"intents": [
"GUILDS",
"GUILD_MESSAGES",
"GUILD_PRESENCES"
] ]
} }

View file

@ -3,22 +3,23 @@ module.exports = {
once: false, once: false,
listener: (client, config) => listener: (client, config) =>
async (interaction) => { 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.reply({ 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
}], }
ephemeral: false }]
}); });
}
} }
} }
}; };

View file

@ -44,19 +44,15 @@ module.exports = {
console.log(' ___ _ __ '); console.log(' ___ _ __ ');
console.log(' / | ____ (_) /__________ _ __'); console.log(' / | ____ (_) /__________ _ __');
console.log(' / /| | / __ \\/ / __/ ___/ __ \\| |/_/'); console.log(' / /| | / __ \\/ / __/ ___/ __ \\| |/_/');
console.log(' / ___ |/ / / / / /_/ / / /_/ /> w < '); console.log(' / ___ |/ / / / / /_/ / / /_/ /> < ');
console.log(`/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| ${config.build}`); console.log('/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| ');
console.log('Ready!| Anitrox by IDeletedSystem64 | Also check out Novetus!'); console.log('');
if (config.updater.enabled === true) { console.log(`${config.release}, ${config.build}`);
await client.updater.checkUpdates(true); // This is probably the wrong way to do it console.log('Bot online. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!');
setInterval(async () => {
await client.updater.checkUpdates(true);
}, parseInt(config.updater.frequency * 60000)); // This is set to 6 hours (360 minutes) by default.
}
// Statuses // Statuses
setInterval(async () => { setInterval(async () => {
const index = Math.floor(Math.random() * config.statuses.length); // Picks a status from the config file // Picks a status from the config file
const index = Math.floor(Math.random() * config.statuses.length);
await client.user?.setActivity(config.statuses[index]); await client.user?.setActivity(config.statuses[index]);
}, 20000); }, 20000);
} }

View file

@ -1,50 +0,0 @@
/* eslint-disable brace-style */ // Tell eslint to stfu :)
const fetch = require('node-fetch');
const config = require('../config.json');
class updateChecker {
constructor () {
this.status = null;
this.failReason = null;
}
checkUpdates = (notify) => {
const repo = `https://api.github.com/repos/${config.updater.gitRepo}/releases/latest`;
const getUpdates = () => {
return fetch(repo)
.then(async (response) => {
if (response.status !== 200) {
this.status = 2; // Error
this.failReason = response.statusText;
} else {
response = await response.json();
if (!response) { this.status = 2; } // Something went wrong while checking for updates :(
const version = {
latest: response.name,
current: config.build
};
if (version.current === version.latest) { this.status = 0; return version; } // Up-to-date!
else if (version.current < version.latest) { this.status = 1; return version; } // Not up to date.
else this.status = 2; // Something went wrong while checking for updates :(
return response;
};
})
.catch(err => { console.error(err); });
};
return getUpdates().then(response => {
if (notify === true) {
if (this.status === 1) console.log(`\n✨ It must be your lucky day! Anitrox ${response.latest} is now available! Download it from github.com/${config.updater.gitRepo}/releases!`); // Log to console about the new release!
else if (this.status === 2) console.error(`\nSomething went wrong while checking for updates... :( | ${this.failReason}`); // This can probably be done more properly, But quite honestly I'm tired of working at this. ^system64
else if (this.status === 0) {} // Up-to-date
else console.error(`Unknown Update Status!! ${this.status}`);
} else return this.status;
});
};
getStatus = () => { return this.status; };
}
module.exports = function () { return new updateChecker(); };

2626
package-lock.json generated

File diff suppressed because it is too large Load diff

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": "^14.7.1", "discord.js": "^13.6.0",
"dotenv": "^16.0.3", "dotenv": "^16.0.1",
"node-fetch": "^2.6.6", "node-fetch": "^3.2.9",
"node-os-utils": "^1.3.7", "node-os-utils": "^1.3.2",
"require-all": "^3.0.0" "require-all": "^3.0.0"
}, },
"author": "IDeletedSystem64", "author": "IDeletedSystem64",
"license": "GPLv3", "license": "GPLv3",
"devDependencies": { "devDependencies": {
"eslint": "^8.32.0", "eslint": "^8.13.0",
"eslint-config-standard": "^17.0.0", "eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.27.5", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.6.1", "eslint-plugin-n": "^15.1.0",
"eslint-plugin-promise": "^6.1.1" "eslint-plugin-promise": "^6.0.0"
} }
} }

View file

@ -1,20 +1,13 @@
#!/usr/bin/env -S node #!/usr/bin/env -S node
const fs = require('fs'); const fs = require('fs');
const { Client, Collection, GatewayIntentBits } = require('discord.js'); const Discord = 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({
intents: [ client.commands = new Discord.Collection();
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 => {
@ -47,9 +40,6 @@ client.generateErrorMessage = (errorMsg, avatarURL) => ({
] ]
}] }]
}); });
// Error message generator.
client.updater = require('./functions/updateCheck.js')(); // da update checker (real)
client.login(process.env.TOKEN); client.login(process.env.TOKEN);
// Login to Discord! // Login to Discord!

1391
yarn.lock Normal file

File diff suppressed because it is too large Load diff