Add stuff

This commit is contained in:
= 2021-11-23 00:37:00 +01:00
commit e743f70128
3002 changed files with 1195556 additions and 0 deletions

17
commands/bonk.js Normal file
View file

@ -0,0 +1,17 @@
module.exports = {
api: {
name: "bonk",
description: "Bonks someone",
options: [
{
name: "user",
description: "Who to bonk?",
type: 6,
required: true
}
]
},
run: (int, client, index) => {
int.reply(`<@!${int.options.getUser("user").id}> <a:bonk:912288114238693406>`);
}
}

10
commands/capybara.js Normal file
View file

@ -0,0 +1,10 @@
module.exports = {
api: {
name: "capybara",
description: "Sends a random image of a capybara"
},
run: (int, client, index) => {
var dir = require("fs").readdirSync("capybara");
int.reply({content: "Capybara", files: [__dirname + "/../capybara/" + dir[Math.floor(Math.random()*dir.length)]]});
}
}

12
commands/cat.js Normal file
View file

@ -0,0 +1,12 @@
module.exports = {
api: {
name: "cat",
description: "Sends a random image of a cat"
},
run: (int, client, index) => {
const axios = require("axios").default;
axios("https://api.thecatapi.com/v1/images/search").then(res => {
int.reply({embeds: [{title: "Cat", image: {url: res.data[0].url}, color: 0xFFC0CB}]});
});
}
}

24
commands/clear.js Normal file
View file

@ -0,0 +1,24 @@
module.exports = {
api: {
name: "clear",
description: "Clears out a bunch of messages.",
options: [
{
name: "count",
description: "Amount of messages to clear.",
type: 4,
min_value: 1,
max_value: 100
}
]
},
run: (int, client, index) => {
var messageCount = int.options.getInteger("count");
int.reply("Clearing messages...");
int.channel.bulkDelete(messageCount).then(yes => {
int.followUp("Done.");
}).catch(e => {
int.followUp("Smth happened: " + e.message);
});
}
}

60
commands/delete.js Normal file
View file

@ -0,0 +1,60 @@
function first2k(string){
var sp = string.split("");
var end = [];
for(i=0;i<2000;i++){
if(sp[i] != undefined){
end.push(sp[i]);
}
}
return end.join("");
}
function stringify(res){
var end;
if(typeof(res) == "object"){
end = JSON.stringify(res);
} else{
end = res.toString();
}
return end;
}
module.exports = {
api: {
name: "delete",
description: "Sends a DELETE request to URL provided through arguments and sends response.",
options: [
{
name: "url",
description: "URL to request.",
type: 3,
required: true
},
{
name: "body",
description: "The data to DELETE.",
type: 3,
required: false
},
{
name: "headers",
description: "The headers to use.",
type: 3,
required: false
}
]
},
run: (int, client, index) => {
const axios = require("axios").default;
int.reply("Sending a DELETE request to " + int.options.getString("url"));
try{
axios.request({method: "DELETE", url: int.options.getString("url"), data: int.options.getString("body"), headers: JSON.parse(int.options.getString("headers"))}).then(res => {
int.followUp(first2k(stringify(res.data)));
}).catch(e => {
int.followUp("Error: " + e.stack);
});
} catch(e){
int.followUp("Error: " + e.stack);
}
}
}

29
commands/disable.js Normal file
View file

@ -0,0 +1,29 @@
module.exports = {
addables: {},
api: {
name: "disable",
description: "Disable command specified.",
options: [
{
name: "command",
description: "Command to disable.",
type: 3
}
]
},
run: (int, client, index) => {
var command = int.options.getString("command");
var commandObj = null;
int.guild.commands.cache.forEach(cmd => {
console.log(cmd.options.name);
if(cmd.options.name !== command);
commandObj = cmd;
});
if(commandObj === null) return int.reply("This command does not exist.");
var currDisabled = process.options.get("disabledCommands");
if(currDisabled.includes(command)) return int.reply("Ths command is already disabled.");
currDisabled.push(command);
process.options.set("disabledCommands",currDisabled);
int.reply("Disabled command \"" + command + "\".");
}
}

23
commands/eval.js Normal file
View file

@ -0,0 +1,23 @@
module.exports = {
api: {
name: "eval",
description: "Evaluates code",
options: [
{
name: "code",
description: "Code to evaluate.",
type: 3,
required: false
}
]
},
run: (int, client, index) => {
if(!process.worthy.get("codeExec").includes(int.user.id)) return int.reply("You are not worthy of wielding the power of the eval.");
var args = int.options.getString("code");
try{
int.reply({content: new String(eval(args)).valueOf(), ephemeral: true}).catch(e => {int.reply({content: e.stack, ephemeral: true})});
} catch(e){
int.reply({content: e.stack, ephemeral: true});
}
}
}

13
commands/fox.js Normal file
View file

@ -0,0 +1,13 @@
module.exports = {
api: {
name: "fox",
description: "Sends a random image of a fox"
},
run: (int, client, index) => {
const axios = require("axios").default;
axios("https://randomfox.ca/floof/").then(res => {
console.log(res.data.image);
int.reply({embeds: [{title: "Fox", image: {url: res.data.image}, color: 0xFFA500}]});
});
}
}

54
commands/get.js Normal file
View file

@ -0,0 +1,54 @@
function first2k(string){
var sp = string.split("");
var end = [];
for(i=0;i<2000;i++){
if(sp[i] != undefined){
end.push(sp[i]);
}
}
return end.join("");
}
function stringify(res){
var end;
if(typeof(res) == "object"){
end = JSON.stringify(res);
} else{
end = res.toString();
}
return end;
}
module.exports = {
api: {
name: "get",
description: "Sends a GET request to URL provided through arguments and sends response.",
options: [
{
name: "url",
description: "URL to request.",
type: 3,
required: true
},
{
name: "headers",
description: "The headers to use.",
type: 3,
required: false
}
]
},
run: (int, client, index) => {
const axios = require("axios").default;
int.reply("Sending a GET request to " + int.options.getString("url"));
try{
axios.request({url: int.options.getString("url"), headers: JSON.parse(int.options.getString("headers"))}).then(res => {
int.followUp(first2k(stringify(res.data)));
}).catch(e => {
int.followUp("Error: " + e.stack);
});
} catch(e){
int.followUp("Error: " + e.stack);
}
}
}

25
commands/getpercent.js Normal file
View file

@ -0,0 +1,25 @@
module.exports = {
api: {
name: "getpercent",
description: "Get a percentage from and to something.",
options: [
{
name: "from",
description: "Number from",
type: 4,
required: true
},
{
name: "to",
description: "Number to",
type: 4,
required: true
}
]
},
run: (int, client, index) => {
var fromNum = int.options.getInteger("from");
var toNum = int.options.getInteger("to");
int.reply(`Final number: ${(fromNum/toNum*100)}.`);
}
}

View file

@ -0,0 +1,25 @@
module.exports = {
api: {
name: "getwholepercent",
description: "Get a whole percentage from and to something.",
options: [
{
name: "from",
description: "Number from",
type: 4,
required: true
},
{
name: "to",
description: "Number to",
type: 4,
required: true
}
]
},
run: (int, client, index) => {
var fromNum = int.options.getInteger("from");
var toNum = int.options.getInteger("to");
int.reply(`Final number: ${Math.round(fromNum/toNum*100)}.`);
}
}

9
commands/lefishe.js Normal file
View file

@ -0,0 +1,9 @@
module.exports = {
api: {
name: "lefishe",
description: "Vibin :D"
},
run: (int, client, index) => {
int.reply(`<a:lefishe:912288872422051880>`);
}
}

9
commands/ping.js Normal file
View file

@ -0,0 +1,9 @@
module.exports = {
api: {
name: "ping",
description: "Simple command to show latency"
},
run: (int, client, index) => {
int.reply("My ping is: " + client.ws.ping + " ms");
}
}

60
commands/post.js Normal file
View file

@ -0,0 +1,60 @@
function first2k(string){
var sp = string.split("");
var end = [];
for(i=0;i<2000;i++){
if(sp[i] != undefined){
end.push(sp[i]);
}
}
return end.join("");
}
function stringify(res){
var end;
if(typeof(res) == "object"){
end = JSON.stringify(res);
} else{
end = res.toString();
}
return end;
}
module.exports = {
api: {
name: "post",
description: "Sends a POST request to URL provided through arguments and sends response.",
options: [
{
name: "url",
description: "URL to request.",
type: 3,
required: true
},
{
name: "body",
description: "The data to POST.",
type: 3,
required: false
},
{
name: "headers",
description: "The headers to use.",
type: 3,
required: false
}
]
},
run: (int, client, index) => {
const axios = require("axios").default;
int.reply("Sending a POST request to " + int.options.getString("url"));
try{
axios.request({method: "POST", url: int.options.getString("url"), data: int.options.getString("body"), headers: JSON.parse(int.options.getString("headers"))}).then(res => {
int.followUp(first2k(stringify(res.data)));
}).catch(e => {
int.followUp("Error: " + e.stack);
});
} catch(e){
int.followUp("Error: " + e.stack);
}
}
}

27
commands/purge.js Normal file
View file

@ -0,0 +1,27 @@
const request = require("axios").default;
module.exports = {
api: {
name: "purge",
description: "Purges the first 100 messages in a channel."
},
run: (int, client, index) => {
request(
{
url: "https://discord.com/api/v9/channels/" + int.channel.id + "/messages?limit=100",
headers: {
Authorization: "Bot " + client.token
}
}
).then(res => {
request(
{
url: "https://discord.com/api/v9/channels/" + int.channel.id + "/messages/",
method: "DELETE",
headers: {
Authorization: "Bot " + client.token
}
}
);
});
}
}

11
commands/reload.js Normal file
View file

@ -0,0 +1,11 @@
module.exports = {
api: {
name: "reload",
description: "Command to reload all commands."
},
run: async (int, client, index) => {
int.reply(`Reloading...`);
await process.loadCommands();
int.followUp("Reload complete.");
}
}

28
commands/send.js Normal file
View file

@ -0,0 +1,28 @@
module.exports = {
api: {
name: "send",
description: "Sends a message in current or specificed channel.",
options: [
{
name: "message",
description: "Message to send",
type: 3,
required: true
},
{
name: "channel",
description: "Channel to send it in",
type: 7,
required: false
}
]
},
run: (int, client, index) => {
const message = int.options.getString("message");
const specifiedChannel = int.options.getChannel("channel");
const channel = !!specifiedChannel ? specifiedChannel : int.channel;
channel.send(message).then(msg => {
int.reply({content: "Message sent!", ephemeral: true});
});
}
}