Merge branch 'ptb' into dev
This commit is contained in:
commit
e6b2c14d25
11
config.json
11
config.json
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"prefix": "n!",
|
"prefix": "n!",
|
||||||
"token": "<token>",
|
|
||||||
"ownerID": "309427567004483586"
|
"token": "<token>",
|
||||||
}
|
"ownerID": "309427567004483586"
|
||||||
|
}
|
||||||
|
|
157
start.js
157
start.js
|
@ -1,77 +1,80 @@
|
||||||
console.log('Preparing to start!')
|
console.log('Preparing to start!')
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const Discord = require('discord.js');
|
const Discord = require('discord.js');
|
||||||
const { prefix, token } = require('./config.json');
|
const { prefix, token } = require('./config.json');
|
||||||
const os = require("os")
|
const os = require("os")
|
||||||
const version = "Test Release 21";
|
|
||||||
const release = "anitrox_unstable"
|
const version = "Public Test Release 1";
|
||||||
console.log('Starting!')
|
const release = "anitrox_ptb"
|
||||||
const client = new Discord.Client();
|
const buildno = "430"
|
||||||
client.commands = new Discord.Collection();
|
|
||||||
const activities_list = [
|
console.log('Starting!')
|
||||||
"with n!help",
|
const client = new Discord.Client();
|
||||||
"Where am I?",
|
client.commands = new Discord.Collection();
|
||||||
"with Sylveons!",
|
const activities_list = [
|
||||||
"on my host's hard disk",
|
"with n!help",
|
||||||
"with Happy",
|
"Where am I?",
|
||||||
"HAAAAAAAAPPPPPPPYYYYYYYYYYYYYYYYYYYY",
|
"with Sylveons!",
|
||||||
"Running on " + process.platform + " / " + os.version() + "!",
|
"on my host's hard disk",
|
||||||
"with the tea machine",
|
"with Happy",
|
||||||
"with Borked Computers",
|
"HAAAAAAAAPPPPPPPYYYYYYYYYYYYYYYYYYYY",
|
||||||
"on Happy's main PC- wait shoot she's coming",
|
"Running on " + process.platform + " / " + os.version() + "!",
|
||||||
"btw I use Debian linux"
|
"with the tea machine",
|
||||||
];
|
"with Borked Computers",
|
||||||
|
"on Happy's main PC- wait shoot she's coming",
|
||||||
|
"btw I use Debian linux"
|
||||||
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
|
];
|
||||||
|
|
||||||
for (const file of commandFiles) {
|
|
||||||
const command = require(`./commands/${file}`);
|
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
|
||||||
client.commands.set(command.name, command);
|
|
||||||
}
|
for (const file of commandFiles) {
|
||||||
|
const command = require(`./commands/${file}`);
|
||||||
client.on("error", (e) => console.error(e));
|
client.commands.set(command.name, command);
|
||||||
client.on("warn", (e) => console.warn(e));
|
}
|
||||||
client.on("debug", (e) => console.info(e))
|
|
||||||
client.once('ready', () => {
|
client.on("error", (e) => console.error(e));
|
||||||
console.log('All systems go.');
|
client.on("warn", (e) => console.warn(e));
|
||||||
});
|
client.on("debug", (e) => console.info(e))
|
||||||
setInterval(() => {
|
client.once('ready', () => {
|
||||||
const index = Math.floor(Math.random() * (activities_list.length - 1) + 1);
|
console.log('All systems go.');
|
||||||
client.user.setActivity(activities_list[index]);
|
});
|
||||||
}, 20000);
|
setInterval(() => {
|
||||||
|
const index = Math.floor(Math.random() * (activities_list.length - 1) + 1);
|
||||||
client.on('message', message => {
|
client.user.setActivity(activities_list[index]);
|
||||||
if (!message.content.startsWith(prefix) || message.author.bot) return;
|
}, 20000);
|
||||||
|
|
||||||
const args = message.content.slice(prefix.length).split(/ +/);
|
client.on('message', message => {
|
||||||
const command = args.shift().toLowerCase();
|
if (!message.content.startsWith(prefix) || message.author.bot) return;
|
||||||
|
|
||||||
if (!client.commands.has(command)) return;
|
const args = message.content.slice(prefix.length).split(/ +/);
|
||||||
|
const command = args.shift().toLowerCase();
|
||||||
try {
|
|
||||||
client.commands.get(command).execute(client, message, args);
|
if (!client.commands.has(command)) return;
|
||||||
} catch (error) {
|
|
||||||
const embed = {
|
try {
|
||||||
"title": "<:NyabotError:697145462347661412> **An error occurred!**",
|
client.commands.get(command).execute(client, message, args);
|
||||||
"color": 13632027,
|
} catch (error) {
|
||||||
"footer": {
|
const embed = {
|
||||||
"icon_url": "https://cdn.discordapp.com/attachments/549707869138714635/793524910172667964/Screenshot_26.png",
|
"title": "<:NyabotError:697145462347661412> **An error occurred!**",
|
||||||
"text": "Anitrox © IDeletedSystem64 2018-2021 All Rights Reserved."
|
"color": 13632027,
|
||||||
},
|
"footer": {
|
||||||
"fields": [
|
"icon_url": "https://cdn.discordapp.com/attachments/549707869138714635/793524910172667964/Screenshot_26.png",
|
||||||
{
|
"text": "Anitrox © IDeletedSystem64 2018-2021 All Rights Reserved."
|
||||||
"name": "**What Happened?**",
|
},
|
||||||
"value": "The command you tried to run failed to execute"
|
"fields": [
|
||||||
},
|
{
|
||||||
{
|
"name": "**What Happened?**",
|
||||||
"name": "Error Info",
|
"value": "The command you tried to run failed to execute"
|
||||||
"value": error.message
|
},
|
||||||
}
|
{
|
||||||
]
|
"name": "Error Info",
|
||||||
};
|
"value": error.message
|
||||||
message.channel.send({ embed });
|
}
|
||||||
}
|
]
|
||||||
});
|
};
|
||||||
|
message.channel.send({ embed });
|
||||||
client.login(token);
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
client.login(token);
|
||||||
|
|
Reference in New Issue