Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
|
a1f6982a90 | ||
3c88b53039 | |||
|
53eb34b264 |
33 changed files with 1480 additions and 2826 deletions
27
.github/ISSUE_TEMPLATE/bug_report.md
vendored
27
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
@ -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)
|
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
|
@ -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
1
.gitignore
vendored
|
@ -3,6 +3,7 @@
|
|||
|
||||
# NPM/Yarn stuff.
|
||||
node_modules/
|
||||
package-lock.json
|
||||
|
||||
# Let's not leak any tokens now... That would be very bad
|
||||
config.json
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
|
||||
|
@ -8,7 +8,7 @@ module.exports = {
|
|||
name: 'question',
|
||||
description: 'The question to ask Anitrox',
|
||||
required: true,
|
||||
type: ApplicationCommandOptionType.String
|
||||
type: Constants.ApplicationCommandOptionTypes.STRING
|
||||
}],
|
||||
|
||||
async parseMessage (client, config, message, args) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
|
||||
|
@ -8,13 +8,13 @@ module.exports = {
|
|||
name: 'user',
|
||||
description: 'Another user',
|
||||
required: false,
|
||||
type: ApplicationCommandOptionType.User
|
||||
type: Constants.ApplicationCommandOptionTypes.USER
|
||||
},
|
||||
{
|
||||
name: 'userid',
|
||||
description: "Another user's ID",
|
||||
required: false,
|
||||
type: ApplicationCommandOptionType.User
|
||||
type: Constants.ApplicationCommandOptionTypes.STRING
|
||||
}],
|
||||
|
||||
async parseMessage (client, config, message, args) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
|
||||
|
@ -8,7 +8,7 @@ module.exports = {
|
|||
name: 'user',
|
||||
description: 'The user to bonk',
|
||||
required: true,
|
||||
type: ApplicationCommandOptionType.User
|
||||
type: Constants.ApplicationCommandOptionTypes.USER
|
||||
}],
|
||||
|
||||
async parseMessage (client, config, message) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
|
||||
|
@ -8,7 +8,7 @@ module.exports = {
|
|||
name: 'user',
|
||||
description: 'The user to cheese',
|
||||
required: false,
|
||||
type: ApplicationCommandOptionType.User
|
||||
type: Constants.ApplicationCommandOptionTypes.USER
|
||||
}],
|
||||
|
||||
async parseMessage (client, config, message) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
|
||||
|
@ -8,7 +8,7 @@ module.exports = {
|
|||
name: `option${i + 1}`,
|
||||
description: 'Another option',
|
||||
required: i === 0,
|
||||
type: ApplicationCommandOptionType.String
|
||||
type: Constants.ApplicationCommandOptionTypes.STRING
|
||||
})),
|
||||
|
||||
async parseMessage (client, config, message, args) {
|
||||
|
|
|
@ -37,10 +37,6 @@ module.exports = {
|
|||
{
|
||||
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)'
|
||||
},
|
||||
{
|
||||
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)'
|
||||
}
|
||||
]
|
||||
}]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = 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: ApplicationCommandOptionType.User
|
||||
type: Constants.ApplicationCommandOptionTypes.USER
|
||||
}],
|
||||
|
||||
async parseMessage (client, config, message) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = 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: ApplicationCommandOptionType.String
|
||||
type: Constants.ApplicationCommandOptionTypes.STRING
|
||||
}],
|
||||
|
||||
async parseMessage (client, config, message, args) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
|
||||
|
@ -8,7 +8,7 @@ module.exports = {
|
|||
name: 'help',
|
||||
description: 'The command you want information on',
|
||||
required: false,
|
||||
type: ApplicationCommandOptionType.String
|
||||
type: Constants.ApplicationCommandOptionTypes.STRING
|
||||
}],
|
||||
async parseMessage (client, config, message, args) {
|
||||
await message.channel.send(this.handle(client, config, message.author, args[0]));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = 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: ApplicationCommandOptionType.String
|
||||
type: Constants.ApplicationCommandOptionTypes.USER
|
||||
}],
|
||||
|
||||
async parseMessage (client, config, message) {
|
||||
|
|
|
@ -2,13 +2,14 @@ const Uptime = require('../functions/uptime.js');
|
|||
const os = require('os');
|
||||
const osu = require('node-os-utils');
|
||||
module.exports = {
|
||||
name: 'about',
|
||||
description: 'About this bot, as well as the system its running on',
|
||||
name: 'info',
|
||||
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));
|
||||
|
@ -39,7 +40,7 @@ module.exports = {
|
|||
{ name: ':timer: Bot Uptime', value: Uptime(client.uptime), inline: true },
|
||||
{ name: ':one: Total Servers', value: `** **${client.guilds.cache.size}`, inline: true },
|
||||
{ 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: ':timer: System Uptime', value: Uptime(os.uptime() * 1000), inline: true },
|
||||
{ name: '<:cpu:997565592028598282> System CPU Architecture', value: os.arch(), inline: true },
|
|
@ -27,8 +27,9 @@ 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 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: '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)' }
|
||||
]
|
||||
}]
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = 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: ApplicationCommandOptionType.User
|
||||
type: Constants.ApplicationCommandOptionTypes.USER
|
||||
}],
|
||||
|
||||
async parseMessage (client, config, message) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = 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: ApplicationCommandOptionType.User
|
||||
type: Constants.ApplicationCommandOptionTypes.USER
|
||||
}],
|
||||
|
||||
async parseMessage (client, config, message) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = 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: ApplicationCommandOptionType.User
|
||||
type: Constants.ApplicationCommandOptionTypes.USER
|
||||
}],
|
||||
|
||||
async parseMessage (client, config, message) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = 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: ApplicationCommandOptionType.User
|
||||
type: Constants.ApplicationCommandOptionTypes.USER
|
||||
}],
|
||||
|
||||
async parseMessage (client, config, message) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = 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: ApplicationCommandOptionType.User
|
||||
type: Constants.ApplicationCommandOptionTypes.USER
|
||||
}],
|
||||
|
||||
async parseMessage (client, config, message) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = 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: ApplicationCommandOptionType.User
|
||||
type: Constants.ApplicationCommandOptionTypes.USER
|
||||
}],
|
||||
|
||||
async parseMessage (client, config, message) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
|
||||
|
@ -8,7 +8,7 @@ module.exports = {
|
|||
name: `option${i + 0}`,
|
||||
description: 'Another option',
|
||||
required: i === 0,
|
||||
type: ApplicationCommandOptionType.User
|
||||
type: Constants.ApplicationCommandOptionTypes.STRING
|
||||
})),
|
||||
|
||||
async parseMessage (client, config, message, args) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
|
||||
|
@ -8,7 +8,7 @@ module.exports = {
|
|||
name: 'user',
|
||||
description: 'The user to slap',
|
||||
required: true,
|
||||
type: ApplicationCommandOptionType.User
|
||||
type: Constants.ApplicationCommandOptionTypes.USER
|
||||
}],
|
||||
|
||||
async parseMessage (client, config, message) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = 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: ApplicationCommandOptionType.User
|
||||
type: Constants.ApplicationCommandOptionTypes.USER
|
||||
}],
|
||||
|
||||
async parseMessage (client, config, message) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const { ApplicationCommandOptionType } = require('discord.js');
|
||||
const { Constants } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
|
||||
|
@ -8,7 +8,7 @@ module.exports = {
|
|||
name: 'user',
|
||||
description: 'Another user',
|
||||
required: false,
|
||||
type: ApplicationCommandOptionType.User
|
||||
type: Constants.ApplicationCommandOptionTypes.USER
|
||||
}],
|
||||
|
||||
async parseMessage (client, config, message) {
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
{
|
||||
"prefix": "n!",
|
||||
"build": "1.4",
|
||||
"release": "Developer Release",
|
||||
"build": "1.3.3dev",
|
||||
"footerTxt": "Anitrox, made with <3 by IDeletedSystem64 | 2018-2023",
|
||||
"imageApi": "",
|
||||
"updater": {
|
||||
"enabled": true,
|
||||
"frequency": "360",
|
||||
"gitRepo": "IDeletedSystem64/anitrox"
|
||||
},
|
||||
"sandbox": {
|
||||
"enabled": false,
|
||||
"id": "0",
|
||||
|
@ -69,5 +64,10 @@
|
|||
"Go for it! :smile:",
|
||||
"Good idea!",
|
||||
"Sure"
|
||||
],
|
||||
"intents": [
|
||||
"GUILDS",
|
||||
"GUILD_MESSAGES",
|
||||
"GUILD_PRESENCES"
|
||||
]
|
||||
}
|
|
@ -3,22 +3,23 @@ module.exports = {
|
|||
once: false,
|
||||
listener: (client, config) =>
|
||||
async (interaction) => {
|
||||
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
|
||||
}
|
||||
}],
|
||||
ephemeral: false
|
||||
});
|
||||
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
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -44,19 +44,15 @@ module.exports = {
|
|||
console.log(' ___ _ __ ');
|
||||
console.log(' / | ____ (_) /__________ _ __');
|
||||
console.log(' / /| | / __ \\/ / __/ ___/ __ \\| |/_/');
|
||||
console.log(' / ___ |/ / / / / /_/ / / /_/ /> w < ');
|
||||
console.log(`/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| ${config.build}`);
|
||||
console.log('Ready!| Anitrox by IDeletedSystem64 | Also check out Novetus!');
|
||||
if (config.updater.enabled === true) {
|
||||
await client.updater.checkUpdates(true); // This is probably the wrong way to do it
|
||||
setInterval(async () => {
|
||||
await client.updater.checkUpdates(true);
|
||||
}, parseInt(config.updater.frequency * 60000)); // This is set to 6 hours (360 minutes) by default.
|
||||
}
|
||||
|
||||
console.log(' / ___ |/ / / / / /_/ / / /_/ /> < ');
|
||||
console.log('/_/ |_/_/ /_/_/\\__/_/ \\____/_/|_| ');
|
||||
console.log('');
|
||||
console.log(`${config.release}, ${config.build}`);
|
||||
console.log('Bot online. | Anitrox by IDeletedSystem64 | ALL MY CODE KEEPS BLOWING UP!');
|
||||
// Statuses
|
||||
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]);
|
||||
}, 20000);
|
||||
}
|
||||
|
|
|
@ -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
2626
package-lock.json
generated
File diff suppressed because it is too large
Load diff
16
package.json
16
package.json
|
@ -4,19 +4,19 @@
|
|||
"description": "Discord Bot Based on Discord.JS",
|
||||
"main": "start.js",
|
||||
"dependencies": {
|
||||
"discord.js": "^14.7.1",
|
||||
"dotenv": "^16.0.3",
|
||||
"node-fetch": "^2.6.6",
|
||||
"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.32.0",
|
||||
"eslint": "^8.13.0",
|
||||
"eslint-config-standard": "^17.0.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-n": "^15.6.1",
|
||||
"eslint-plugin-promise": "^6.1.1"
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-n": "^15.1.0",
|
||||
"eslint-plugin-promise": "^6.0.0"
|
||||
}
|
||||
}
|
||||
|
|
18
start.js
18
start.js
|
@ -1,20 +1,13 @@
|
|||
#!/usr/bin/env -S node
|
||||
|
||||
const fs = require('fs');
|
||||
const { Client, Collection, GatewayIntentBits } = require('discord.js');
|
||||
const Discord = 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}`)) });
|
||||
const client = new Client({
|
||||
intents: [
|
||||
GatewayIntentBits.Guilds,
|
||||
GatewayIntentBits.GuildMessages,
|
||||
GatewayIntentBits.GuildPresences
|
||||
]
|
||||
});
|
||||
// todo: move back to file
|
||||
client.commands = new Collection();
|
||||
const client = new Discord.Client({ intents: config.intents.map(intent => eval(`Discord.Intents.FLAGS.${intent}`)) });
|
||||
|
||||
client.commands = new Discord.Collection();
|
||||
fs.readdirSync('./commands')
|
||||
.filter(file => file.endsWith('.js'))
|
||||
.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);
|
||||
// Login to Discord!
|
||||
|
|
Reference in a new issue