Merge pull request #52 from Foxinatel/dev
Merge Foxinatels changes with base
This commit is contained in:
commit
35605fd9a9
|
@ -7,7 +7,7 @@ Node.JS: 14
|
|||
npm: 6.14
|
||||
# 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.
|
||||
Afterwards fill out the ``config-example.json`` and rename it to ``config.json``, then just run ``node start.js``!
|
||||
Afterwards fill out the ``config-example.json`` and rename it to ``config.json``, then just run ``node start.js`` (or ``./start.js`` on Linux)!
|
||||
⚠️ If you don't specify the Owner ID, Some commands such as the bot controls will be unusable!
|
||||
# Support
|
||||
Anitrox isn't really supported but you can get help from the Discord server if you need any: discord.gg/5nQtMNpf43
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
module.exports = {
|
||||
name: '8ball',
|
||||
|
||||
name: require('path').parse(__filename).name,
|
||||
description: 'Ask Anitrox a question, any question! and they will answer it!',
|
||||
syntax: ["[Question]"],
|
||||
|
||||
async execute(client, message, args, config) {
|
||||
const index = Math.floor(Math.random() * config.answers.length);
|
||||
const answer = config.answers[index]
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
module.exports = {
|
||||
|
||||
name: "avatar",
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "Gets a user's avatar.",
|
||||
async execute(client, message, args, config) {
|
||||
|
||||
const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author;
|
||||
|
||||
async execute(client, message, args, config) {
|
||||
const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author;
|
||||
|
||||
await message.channel.send({embed: {
|
||||
"title": `:frame_photo: ${user.username}'s Beautiful Avatar!`,
|
||||
"color": 9442302,
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
module.exports = {
|
||||
|
||||
name: "bonk",
|
||||
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "Bonks a user!",
|
||||
|
||||
async execute(client, message, _, config) {
|
||||
const taggedUser = message.mentions.users.first();
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
module.exports = {
|
||||
name: "cheese",
|
||||
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "Cheese an user, or run just ``n!cheese`` for a surprise :eyes:",
|
||||
|
||||
async execute(_0, message, _1, config) {
|
||||
const taggedUser = message.mentions.users.first();
|
||||
|
||||
if(!taggedUser) {
|
||||
await message.channel.send("*slams cheese on desk*\n**Cheese.** https://www.youtube.com/watch?v=Or4IE8fkpn4");
|
||||
} else {
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
module.exports = {
|
||||
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "Give some lines of input, and get one back at random",
|
||||
|
||||
async execute(client, message, _, config) {
|
||||
var [head, ...options] = message.content.split(/\s*\n\s*/);
|
||||
head = head.slice(this.name.length + config.prefix.length);
|
||||
if (head) options.push(head);
|
||||
|
||||
if (!options.length) {
|
||||
await message.channel.send(client.generateErrorMessage("You need to provide some input!", message.author.displayAvatarURL()));
|
||||
} else {
|
||||
const answer = options[Math.floor(Math.random() * options.length)];
|
||||
await message.channel.send({embed: {
|
||||
"title": "I have made my decision:",
|
||||
"description": answer,
|
||||
"color": 8311585,
|
||||
"footer": {
|
||||
"icon_url": message.author.displayAvatarURL(),
|
||||
"text": config.footerTxt
|
||||
},
|
||||
}});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,10 +7,10 @@ const gifchoices = [
|
|||
|
||||
module.exports = {
|
||||
|
||||
name: "cuddle",
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "Cuddle an user!",
|
||||
async execute(client, message, _, config) {
|
||||
|
||||
async execute(client, message, _, config) {
|
||||
const taggedUser = message.mentions.users.first();
|
||||
const index = Math.floor(Math.random() * gifchoices.length);
|
||||
const gif = (gifchoices[index]);
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
const { inspect } = require("util");
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: 'eval',
|
||||
name: require('path').parse(__filename).name,
|
||||
description: 'Executes JS code',
|
||||
async execute(client, message, args, config) {
|
||||
|
||||
async execute(_, message, args, config) {
|
||||
if (message.author.id == config.ownerID) {
|
||||
try {
|
||||
const code = args.join(" ");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module.exports = {
|
||||
|
||||
name: 'help',
|
||||
name: require('path').parse(__filename).name,
|
||||
description: 'Get help on anything from commands, to what the bot does! just not your homework..',
|
||||
syntax: '<Command>',
|
||||
|
||||
|
|
|
@ -8,8 +8,9 @@ const gifchoices = [
|
|||
|
||||
module.exports = {
|
||||
|
||||
name: "hug",
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "Hugs a user!",
|
||||
|
||||
async execute(client, message, _, config) {
|
||||
const taggedUser = message.mentions.users.first();
|
||||
|
||||
|
|
|
@ -1,28 +1,29 @@
|
|||
function Uptime(uptime) {
|
||||
const totalSeconds = (uptime / 1000);
|
||||
|
||||
const days = parseInt(totalSeconds / 86400);
|
||||
const hours = parseInt((totalSeconds % 86400) / 3600);
|
||||
const minutes = parseInt((totalSeconds % 3600) / 60);
|
||||
const seconds = parseInt(totalSeconds % 60);
|
||||
|
||||
const daystring = days + (days === 1 ? " day" : " days");
|
||||
const hourstring = hours + (hours === 1 ? " hour" : " hours");
|
||||
const minutetring = minutes + (minutes === 1 ? " minute" : " minutes");
|
||||
const secondstring = seconds + (seconds === 1 ? " second" : " seconds");
|
||||
|
||||
return `${daystring}**, **${hourstring}**, **${minutetring}**, **${secondstring}`;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: 'info',
|
||||
name: require('path').parse(__filename).name,
|
||||
description: 'Shows bot and host information',
|
||||
|
||||
async execute(client, message, _, config) {
|
||||
|
||||
function Uptime(uptime) {
|
||||
const totalSeconds = (uptime / 1000);
|
||||
|
||||
const days = parseInt(totalSeconds / 86400);
|
||||
const hours = parseInt((totalSeconds % 86400) / 3600);
|
||||
const minutes = parseInt((totalSeconds % 3600) / 60);
|
||||
const seconds = parseInt(totalSeconds % 60);
|
||||
|
||||
const daystring = days + (days === 1 ? " day" : " days");
|
||||
const hourstring = hours + (hours === 1 ? " hour" : " hours");
|
||||
const minutetring = minutes + (minutes === 1 ? " minute" : " minutes");
|
||||
const secondstring = seconds + (seconds === 1 ? " second" : " seconds");
|
||||
|
||||
return `${daystring}**, **${hourstring}**, **${minutetring}**, **${secondstring}`;
|
||||
}
|
||||
|
||||
const os = require("os");
|
||||
const osu = require('node-os-utils');
|
||||
const cpu = osu.cpu;
|
||||
|
||||
await message.channel.send({embed: {
|
||||
"title": "<:AnitroxInfo:809651936831733791> Information about Anitrox",
|
||||
"description": "Everything you've ever wanted to know about your favorite bot, Anitrox!",
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
module.exports = {
|
||||
|
||||
name: 'invite',
|
||||
name: require('path').parse(__filename).name,
|
||||
description: 'Add Anitrox to your beautiful server!',
|
||||
syntax: [],
|
||||
|
||||
async execute(_0, message, _1, config) {
|
||||
await message.channel.send({embed: {
|
||||
"title": "Add Anitrox to your Server!",
|
||||
|
|
|
@ -8,8 +8,9 @@ const gifchoices = [
|
|||
|
||||
module.exports = {
|
||||
|
||||
name: "kiss",
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "Kisses a user!",
|
||||
|
||||
async execute(client, message, _, config) {
|
||||
const taggedUser = message.mentions.users.first();
|
||||
|
||||
|
|
|
@ -18,8 +18,9 @@ const gifchoices = [
|
|||
|
||||
module.exports = {
|
||||
|
||||
name: "leskiss",
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "Lesbian kiss <:lesbian:803831629428686849>",
|
||||
|
||||
async execute(client, message, _, config) {
|
||||
const taggedUser = message.mentions.users.first();
|
||||
|
||||
|
|
|
@ -7,8 +7,9 @@ const gifchoices = [
|
|||
|
||||
module.exports = {
|
||||
|
||||
name: "lick",
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "Licks a user!",
|
||||
|
||||
async execute(client, message, _, config) {
|
||||
const taggedUser = message.mentions.users.first();
|
||||
|
||||
|
|
|
@ -7,8 +7,9 @@ const gifchoices = [
|
|||
|
||||
module.exports = {
|
||||
|
||||
name: "nom",
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "Noms an user!",
|
||||
|
||||
async execute(client, message, _, config) {
|
||||
const taggedUser = message.mentions.users.first();
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
module.exports = {
|
||||
name: 'opensource',
|
||||
description: 'Attributions to open source components used by Anitrox',
|
||||
|
||||
name: require('path').parse(__filename).name,
|
||||
description: 'Attributions to open source components used by Anitrox',
|
||||
|
||||
async execute(_0, message, _1, config){
|
||||
await message.channel.send({embed: {
|
||||
"title": "Component Attribution",
|
||||
|
|
|
@ -6,8 +6,9 @@ const gifchoices = [
|
|||
|
||||
module.exports = {
|
||||
|
||||
name: "pat",
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "Pats a user!",
|
||||
|
||||
async execute(client, message, _, config) {
|
||||
const taggedUser = message.mentions.users.first();
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
module.exports = {
|
||||
name: "ping",
|
||||
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "Gets bot ping",
|
||||
|
||||
async execute(client, message, _, config) {
|
||||
const index = Math.floor(Math.random() * config.locations.length);
|
||||
const location = config.locations[index]
|
||||
|
|
|
@ -6,8 +6,9 @@ const gifchoices = [
|
|||
|
||||
module.exports = {
|
||||
|
||||
name: "poke",
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "Pokes a user!",
|
||||
|
||||
async execute(client, message, _, config) {
|
||||
const taggedUser = message.mentions.users.first();
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
module.exports = {
|
||||
name: 'reload',
|
||||
|
||||
name: require('path').parse(__filename).name,
|
||||
description: 'Reloads a command',
|
||||
|
||||
async execute(client, message, args, config) {
|
||||
if (message.author.id = config.ownerID) {
|
||||
if (!args.length) {
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
module.exports = {
|
||||
name: 'restart',
|
||||
|
||||
name: require('path').parse(__filename).name,
|
||||
description: 'Restarts the bot',
|
||||
async execute(client, message, args, config) {
|
||||
|
||||
async execute(client, message, _, config) {
|
||||
if (message.author.id == config.ownerID) {
|
||||
console.log("Anitrox is restarting now!")
|
||||
await message.channel.send("<a:NyabotWorking:697147309531594843> Restarting...")
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
module.exports = {
|
||||
name: 'setnick',
|
||||
|
||||
name: require('path').parse(__filename).name,
|
||||
description: 'Sets your nickname',
|
||||
|
||||
async execute(client, message, args, config) {
|
||||
|
||||
if (message.channel.permissionsFor(message.author).has("CHANGE_NICKNAME")) {
|
||||
const newnick = args.slice(0).join(" ")
|
||||
|
||||
try {
|
||||
await message.member.setNickname(newnick, "Nickname change requested by the server member. If you don't want users to be able to change their nickname disable 'CHANGE_NICKNAME' via Change Nickname in Roles.")
|
||||
await message.channel.send({embed: {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
module.exports = {
|
||||
|
||||
name: "slap",
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "Slaps an user!",
|
||||
|
||||
async execute(client, message, _, config) {
|
||||
const taggedUser = message.mentions.users.first();
|
||||
|
||||
|
|
|
@ -7,8 +7,9 @@ const gifchoices = [
|
|||
|
||||
module.exports = {
|
||||
|
||||
name: "snuggle",
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "Snuggle an user!",
|
||||
|
||||
async execute(client, message, _, config) {
|
||||
const taggedUser = message.mentions.users.first();
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
module.exports = {
|
||||
name: "stop",
|
||||
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "IT'S TIME TO STOP!... the bot",
|
||||
async execute(_, message, args, config) {
|
||||
|
||||
async execute(_0, message, _1, config) {
|
||||
if (message.author.id == config.ownerID) {
|
||||
await message.channel.send({embed: {
|
||||
"title": "<a:AnitroxWorking:697147309531594843> **Shutting Down...**",
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
module.exports = {
|
||||
name: "uinfo",
|
||||
|
||||
name: require('path').parse(__filename).name,
|
||||
description: "Gets info about an user, such as ID, Discord Join date and more",
|
||||
syntax: "<User>",
|
||||
|
||||
async execute(client, message, args, config) {
|
||||
const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author
|
||||
|
||||
await message.channel.send({embed: {
|
||||
"title": `Everything you've ever wanted to know about ${user.username}!`,
|
||||
"color": 9442302,
|
||||
|
|
60
start.js
60
start.js
|
@ -32,48 +32,48 @@ client.generateErrorMessage = (errorMsg, messageAuthorURL) => ({embed: {
|
|||
client.on("error", (e) => console.log(`[ERROR] ${error(e)}`));
|
||||
client.on("warn", (e) => (`[WARN] ${warn(e)}`));
|
||||
client.once('ready', () => {
|
||||
console.clear()
|
||||
console.log(' ___ _ __ ');
|
||||
console.log(' / | ____ (_) /__________ _ __');
|
||||
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 () => {
|
||||
// Picks a status from the config file
|
||||
const index = Math.floor(Math.random() * config.statuses.length);
|
||||
await client.user.setActivity(config.statuses[index]);
|
||||
}, 20000);
|
||||
|
||||
console.clear()
|
||||
console.log(' ___ _ __ ');
|
||||
console.log(' / | ____ (_) /__________ _ __');
|
||||
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 () => {
|
||||
// Picks a status from the config file
|
||||
const index = Math.floor(Math.random() * config.statuses.length);
|
||||
await client.user.setActivity(config.statuses[index]);
|
||||
}, 20000);
|
||||
|
||||
});
|
||||
|
||||
|
||||
// Begin Command Handler
|
||||
client.on('message', async (message) => {
|
||||
|
||||
if (!message.content.startsWith(config.prefix) || message.author.bot) return;
|
||||
if (!message.content.startsWith(config.prefix) || message.author.bot) return;
|
||||
|
||||
const args = message.content.slice(config.prefix.length).split(/ +/);
|
||||
const command = args.shift().toLowerCase();
|
||||
|
||||
if (!client.commands.has(command)) 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).execute(client, message, args, config);
|
||||
} catch (error) {
|
||||
console.stack;
|
||||
message.channel.send({embed: {
|
||||
"title": "<:AnitroxError:809651936563429416> **Something went wrong!**",
|
||||
"description": error.stack,
|
||||
"color": 13632027,
|
||||
try {
|
||||
await client.commands.get(command).execute(client, message, args, config);
|
||||
} catch (error) {
|
||||
console.stack;
|
||||
message.channel.send({embed: {
|
||||
"title": "<:AnitroxError:809651936563429416> **Something went wrong!**",
|
||||
"description": error.stack,
|
||||
"color": 13632027,
|
||||
"footer": {
|
||||
"icon_url": message.author.displayAvatarURL(),
|
||||
"text": config.footerTxt
|
||||
},
|
||||
}});
|
||||
}
|
||||
}});
|
||||
}
|
||||
});
|
||||
|
||||
client.login(config.token);
|
Reference in New Issue