Initial Upload (part1)

Upload start script and configurations to GitHub
This commit is contained in:
Anthony M 2021-01-19 00:10:42 -06:00 committed by GitHub
commit 033e794553
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 273 additions and 0 deletions

5
config.json Normal file
View File

@ -0,0 +1,5 @@
{
"prefix": "n!",
"token": "NTQwOTQxNjc5MDQ2Mjk1NTUz.XotbnA.0hllsNlr9hWaepl3KwB1Bhh5TnA",
"ownerID": "309427567004483586"
}

175
package-lock.json generated Normal file
View File

@ -0,0 +1,175 @@
{
"name": "nyabotcanary",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "nyabotcanary",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"discord.js": "^11.5.1",
"node-os-utils": "^1.3.2"
}
},
"node_modules/@discordjs/uws": {
"version": "10.149.0",
"resolved": "https://registry.npmjs.org/@discordjs/uws/-/uws-10.149.0.tgz",
"integrity": "sha512-N1wjoAD2DOgzevqzyTOWTgyO2divX03JWNQx4JHm/jQ/BRzZNkhwVRO3RC5Guww+srdgs4Tw4gwrzlJrlOhq/Q==",
"hasInstallScript": true,
"peer": true,
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/async-limiter": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
},
"node_modules/discord.js": {
"version": "11.6.4",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-11.6.4.tgz",
"integrity": "sha512-cK6rH1PuGjSjpmEQbnpuTxq1Yv8B89SotyKUFcr4RhnsiZnfBfDOev7DD7v5vhtEyyj51NuMWFoRJzgy/m08Uw==",
"dependencies": {
"long": "^4.0.0",
"prism-media": "^0.0.4",
"snekfetch": "^3.6.4",
"tweetnacl": "^1.0.0",
"ws": "^6.0.0"
},
"engines": {
"node": ">=6.0.0"
},
"peerDependencies": {
"@discordjs/opus": "^0.1.0",
"@discordjs/uws": "^10.149.0",
"bufferutil": "^4.0.0",
"erlpack": "discordapp/erlpack",
"libsodium-wrappers": "^0.7.3",
"node-opus": "^0.2.7",
"opusscript": "^0.0.6",
"sodium": "^2.0.3"
},
"peerDependenciesMeta": {
"@discordjs/opus": {
"optional": true
},
"bufferutil": {
"optional": true
},
"erlpack": {
"optional": true
},
"libsodium-wrappers": {
"optional": true
},
"node-opus": {
"optional": true
},
"opusscript": {
"optional": true
},
"sodium": {
"optional": true
},
"uws": {
"optional": true
}
}
},
"node_modules/long": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
"integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA=="
},
"node_modules/node-os-utils": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/node-os-utils/-/node-os-utils-1.3.2.tgz",
"integrity": "sha512-wUo/q6u77y9+DBaXkn57IDyJlQuN7xP6VU9h6yeIGhKocc9rDQPyc3WmLgX+x5jf4WmbLcEaA3raM05+v5jW3g=="
},
"node_modules/prism-media": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-0.0.4.tgz",
"integrity": "sha512-dG2w7WtovUa4SiYTdWn9H8Bd4JNdei2djtkP/Bk9fXq81j5Q15ZPHYSwhUVvBRbp5zMkGtu0Yk62HuMcly0pRw=="
},
"node_modules/snekfetch": {
"version": "3.6.4",
"resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.6.4.tgz",
"integrity": "sha512-NjxjITIj04Ffqid5lqr7XdgwM7X61c/Dns073Ly170bPQHLm6jkmelye/eglS++1nfTWktpP6Y2bFXjdPlQqdw==",
"deprecated": "use node-fetch instead"
},
"node_modules/tweetnacl": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
"integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
},
"node_modules/ws": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz",
"integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==",
"dependencies": {
"async-limiter": "~1.0.0"
}
}
},
"dependencies": {
"@discordjs/uws": {
"version": "10.149.0",
"resolved": "https://registry.npmjs.org/@discordjs/uws/-/uws-10.149.0.tgz",
"integrity": "sha512-N1wjoAD2DOgzevqzyTOWTgyO2divX03JWNQx4JHm/jQ/BRzZNkhwVRO3RC5Guww+srdgs4Tw4gwrzlJrlOhq/Q==",
"peer": true
},
"async-limiter": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
},
"discord.js": {
"version": "11.6.4",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-11.6.4.tgz",
"integrity": "sha512-cK6rH1PuGjSjpmEQbnpuTxq1Yv8B89SotyKUFcr4RhnsiZnfBfDOev7DD7v5vhtEyyj51NuMWFoRJzgy/m08Uw==",
"requires": {
"long": "^4.0.0",
"prism-media": "^0.0.4",
"snekfetch": "^3.6.4",
"tweetnacl": "^1.0.0",
"ws": "^6.0.0"
}
},
"long": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
"integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA=="
},
"node-os-utils": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/node-os-utils/-/node-os-utils-1.3.2.tgz",
"integrity": "sha512-wUo/q6u77y9+DBaXkn57IDyJlQuN7xP6VU9h6yeIGhKocc9rDQPyc3WmLgX+x5jf4WmbLcEaA3raM05+v5jW3g=="
},
"prism-media": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-0.0.4.tgz",
"integrity": "sha512-dG2w7WtovUa4SiYTdWn9H8Bd4JNdei2djtkP/Bk9fXq81j5Q15ZPHYSwhUVvBRbp5zMkGtu0Yk62HuMcly0pRw=="
},
"snekfetch": {
"version": "3.6.4",
"resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.6.4.tgz",
"integrity": "sha512-NjxjITIj04Ffqid5lqr7XdgwM7X61c/Dns073Ly170bPQHLm6jkmelye/eglS++1nfTWktpP6Y2bFXjdPlQqdw=="
},
"tweetnacl": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
"integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
},
"ws": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz",
"integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==",
"requires": {
"async-limiter": "~1.0.0"
}
}
}
}

15
package.json Normal file
View File

@ -0,0 +1,15 @@
{
"name": "nyabotcanary",
"version": "1.0.0",
"description": "Discord Bot Based on Discord.JS",
"main": "main.js",
"dependencies": {
"discord.js": "^11.5.1",
"node-os-utils": "^1.3.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Anthony Mondz",
"license": "ISC"
}

78
start.js Normal file
View File

@ -0,0 +1,78 @@
console.log('Preparing to start!')
const fs = require('fs');
const Discord = require('discord.js');
const { prefix, token } = require('./config.json');
const os = require("os")
const version = "Test Release 21";
const release = "anitrox_unstable"
const buildno = "404"
console.log('Starting!')
const client = new Discord.Client();
client.commands = new Discord.Collection();
const activities_list = [
"with n!help",
"Where am I?",
"with Sylveons!",
"on my host's hard disk",
"with Happy",
"HAAAAAAAAPPPPPPPYYYYYYYYYYYYYYYYYYYY",
"Running on " + process.platform + " / " + os.version() + "!",
"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}`);
client.commands.set(command.name, command);
}
client.on("error", (e) => console.error(e));
client.on("warn", (e) => console.warn(e));
client.on("debug", (e) => console.info(e))
client.once('ready', () => {
console.log('All systems go.');
});
setInterval(() => {
const index = Math.floor(Math.random() * (activities_list.length - 1) + 1);
client.user.setActivity(activities_list[index]);
}, 10000);
client.on('message', message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if (!client.commands.has(command)) return;
try {
client.commands.get(command).execute(client, message, args);
} catch (error) {
const embed = {
"title": "<:NyabotError:697145462347661412> ***An error occurred!***",
"color": 13632027,
"footer": {
"icon_url": "https://cdn.discordapp.com/attachments/549707869138714635/793524910172667964/Screenshot_26.png",
"text": "Anitrox © IDeletedSystem64 2018-2021 All Rights Reserved."
},
"fields": [
{
"name": "**What Happened?**",
"value": "The command you tried to run failed to execute"
},
{
"name": "Error Info",
"value": error.message
}
]
};
message.channel.send({ embed });
}
});
client.login(token);