Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomato6966 authored Feb 25, 2021
1 parent 35d5dab commit 9cc3cc5
Show file tree
Hide file tree
Showing 18 changed files with 739 additions and 96 deletions.
4 changes: 4 additions & 0 deletions botconfig/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"token": "PASTE YOUR TOKEN IN HERE",
"prefix": "!"
}
6 changes: 6 additions & 0 deletions botconfig/embed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"color": "#3498db",
"wrongcolor": "#e01e01",
"footertext": "Your Bot Name | powered by milrato.eu",
"footericon": "https://img.icons8.com/color/452/discord-logo.png"
}
48 changes: 48 additions & 0 deletions commands/Administration/embed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const { MessageEmbed } = require("discord.js");
const config = require("../../botconfig/config.json");
const ee = require("../../botconfig/embed.json");
module.exports = {
name: "embed",
category: "Administration",
aliases: ["say-embed"],
cooldown: 2,
usage: "embed <TITLE> ++ <DESCRIPTION>",
description: "Resends a message from u as an Embed",
run: async (client, message, args, user, text, prefix) => {
try{
if(!args[0])
return message.channel.send(new MessageEmbed()
.setColor(ee.wrongcolor)
.setFooter(ee.footertext, ee.footericon)
.setTitle(`❌ ERROR | You didn't provided a Title, nor a Description`)
.setDescription(`Usage: \`${prefix}embed <TITLE> ++ <DESCRIPTION>\``)
);
let userargs = args.join(" ").split("++");
let title = userargs[0];
let desc = userargs.slice(1).join(" ")
message.channel.send(new MessageEmbed()
.setColor(ee.color)
.setFooter(ee.footertext, ee.footericon)
.setTitle(title ? title : "")
.setDescription(desc ? desc : "")
)
} catch (e) {
console.log(String(e.stack).bgRed)
return message.channel.send(new MessageEmbed()
.setColor(ee.wrongcolor)
.setFooter(ee.footertext, ee.footericon)
.setTitle(`❌ ERROR | An error occurred`)
.setDescription(`\`\`\`${e.stack}\`\`\``)
);
}
}
}
/**
* @INFO
* Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template
* @INFO
* Work for Milrato Development | https://milrato.eu
* @INFO
* Please mention Him / Milrato Development, when using this Code!
* @INFO
*/
40 changes: 40 additions & 0 deletions commands/Administration/say.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const { MessageEmbed } = require("discord.js");
const config = require("../../botconfig/config.json");
const ee = require("../../botconfig/embed.json");
module.exports = {
name: "say",
category: "Administration",
aliases: [""],
cooldown: 2,
usage: "say <TEXT>",
description: "Resends your Text",
run: async (client, message, args, user, text, prefix) => {
try{
if(!args[0])
return message.channel.send(new MessageEmbed()
.setColor(ee.wrongcolor)
.setFooter(ee.footertext, ee.footericon)
.setTitle(`❌ ERROR | You didn't provided a Text`)
.setDescription(`Usage: \`${prefix}say <Your Text>\``)
);
message.channel.send(text);
} catch (e) {
console.log(String(e.stack).bgRed)
return message.channel.send(new MessageEmbed()
.setColor(ee.wrongcolor)
.setFooter(ee.footertext, ee.footericon)
.setTitle(`❌ ERROR | An error occurred`)
.setDescription(`\`\`\`${e.stack}\`\`\``)
);
}
}
}
/**
* @INFO
* Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template
* @INFO
* Work for Milrato Development | https://milrato.eu
* @INFO
* Please mention Him / Milrato Development, when using this Code!
* @INFO
*/
85 changes: 85 additions & 0 deletions commands/Information/help.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
const { MessageEmbed } = require("discord.js");
const config = require("../../botconfig/config.json");
const ee = require("../../botconfig/embed.json");
module.exports = {
name: "help",
category: "Information",
aliases: ["h", "commandinfo", "cmds", "cmd"],
cooldown: 4,
usage: "help [Command]",
description: "Returns all Commmands, or one specific command",
run: async (client, message, args, user, text, prefix) => {
try{
if (args[0]) {
const embed = new MessageEmbed();
const cmd = client.commands.get(args[0].toLowerCase()) || client.commands.get(client.aliases.get(args[0].toLowerCase()));
if (!cmd) {
return message.channel.send(embed.setColor(ee.wrongcolor).setDescription(`No Information found for command **${args[0].toLowerCase()}**`));
}
if (cmd.name) embed.addField("**Command name**", `\`${cmd.name}\``);
if (cmd.name) embed.setTitle(`Detailed Information about:\`${cmd.name}\``);
if (cmd.description) embed.addField("**Description**", `\`${cmd.description}\``);
if (cmd.aliases) embed.addField("**Aliases**", `\`${cmd.aliases.map((a) => `${a}`).join("`, `")}\``);
if (cmd.cooldown) embed.addField("**Cooldown**", `\`${cmd.cooldown} Seconds\``);
else embed.addField("**Cooldown**", `\`1 Second\``);
if (cmd.usage) {
embed.addField("**Usage**", `\`${config.prefix}${cmd.usage}\``);
embed.setFooter("Syntax: <> = required, [] = optional");
}
if (cmd.useage) {
embed.addField("**Useage**", `\`${config.prefix}${cmd.useage}\``);
embed.setFooter("Syntax: <> = required, [] = optional");
}
return message.channel.send(embed.setColor(ee.main));
} else {
const embed = new MessageEmbed()
.setColor(ee.color)
.setThumbnail(client.user.displayAvatarURL())
.setTitle("HELP MENU 🔰 Commands")
.setFooter(`To see command descriptions and inforamtion, type: ${config.prefix}help [CMD NAME]`, client.user.displayAvatarURL());
const commands = (category) => {
return client.commands.filter((cmd) => cmd.category === category).map((cmd) => `\`${cmd.name}\``);
};
try {
for (let i = 0; i < client.categories.length; i += 1) {
const current = client.categories[i];
const items = commands(current);
const n = 3;
const result = [[], [], []];
const wordsPerLine = Math.ceil(items.length / 3);
for (let line = 0; line < n; line++) {
for (let i = 0; i < wordsPerLine; i++) {
const value = items[i + line * wordsPerLine];
if (!value) continue;
result[line].push(value);
}
}
embed.addField(`**${current.toUpperCase()} [${items.length}]**`, `> ${result[0].join("\n> ")}`, true);
embed.addField(`\u200b`, `${result[1].join("\n") ? result[1].join("\n") : "\u200b"}`, true);
embed.addField(`\u200b`, `${result[2].join("\n") ? result[2].join("\n") : "\u200b"}`, true);
}
} catch (e) {
console.log(String(e.stack).red);
}
message.channel.send(embed);
}
} catch (e) {
console.log(String(e.stack).bgRed)
return message.channel.send(new MessageEmbed()
.setColor(ee.wrongcolor)
.setFooter(ee.footertext, ee.footericon)
.setTitle(`❌ ERROR | An error occurred`)
.setDescription(`\`\`\`${e.stack}\`\`\``)
);
}
}
}
/**
* @INFO
* Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template
* @INFO
* Work for Milrato Development | https://milrato.eu
* @INFO
* Please mention Him / Milrato Development, when using this Code!
* @INFO
*/
43 changes: 43 additions & 0 deletions commands/Information/ping.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const { MessageEmbed } = require("discord.js");
const config = require("../../botconfig/config.json");
const ee = require("../../botconfig/embed.json");
module.exports = {
name: "ping",
category: "Information",
aliases: ["latency"],
cooldown: 2,
usage: "ping",
description: "Gives you information on how fast the Bot can respond to you",
run: async (client, message, args, user, text, prefix) => {
try{
message.channel.send(new MessageEmbed()
.setColor(ee.color)
.setFooter(ee.footertext, ee.footericon)
.setTitle(`🏓 Pinging....`)
).then(msg=>{
msg.edit(new MessageEmbed()
.setColor(ee.color)
.setFooter(ee.footertext, ee.footericon)
.setTitle(`🏓 Ping is \`${Math.round(client.ws.ping)}ms\``)
);
})
} catch (e) {
console.log(String(e.stack).bgRed)
return message.channel.send(new MessageEmbed()
.setColor(ee.wrongcolor)
.setFooter(ee.footertext, ee.footericon)
.setTitle(`❌ ERROR | An error occurred`)
.setDescription(`\`\`\`${e.stack}\`\`\``)
);
}
}
}
/**
* @INFO
* Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template
* @INFO
* Work for Milrato Development | https://milrato.eu
* @INFO
* Please mention Him / Milrato Development, when using this Code!
* @INFO
*/
38 changes: 38 additions & 0 deletions commands/Information/uptime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const { MessageEmbed } = require("discord.js");
const config = require("../../botconfig/config.json");
const ee = require("../../botconfig/embed.json");
const { duration } = require("../../handlers/functions")
module.exports = {
name: "uptime",
category: "Information",
aliases: [""],
cooldown: 10,
usage: "uptime",
description: "Returns the duration on how long the Bot is online",
run: async (client, message, args, user, text, prefix) => {
try{
message.channel.send(new MessageEmbed()
.setColor(ee.color)
.setFooter(ee.footertext, ee.footericon)
.setTitle(`:white_check_mark: **${client.user.username}** is since:\n ${duration(client.uptime)} online`)
);
} catch (e) {
console.log(String(e.stack).bgRed)
return message.channel.send(new MessageEmbed()
.setColor(ee.wrongcolor)
.setFooter(ee.footertext, ee.footericon)
.setTitle(`❌ ERROR | An error occurred`)
.setDescription(`\`\`\`${e.stack}\`\`\``)
);
}
}
}
/**
* @INFO
* Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template
* @INFO
* Work for Milrato Development | https://milrato.eu
* @INFO
* Please mention Him / Milrato Development, when using this Code!
* @INFO
*/
13 changes: 13 additions & 0 deletions events/client/disconnect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//here the event starts
module.exports = client => {
console.log(`You have been disconnected at ${new Date()}.`.red)
}
/**
* @INFO
* Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template
* @INFO
* Work for Milrato Development | https://milrato.eu
* @INFO
* Please mention Him / Milrato Development, when using this Code!
* @INFO
*/
13 changes: 13 additions & 0 deletions events/client/error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//here the event starts
module.exports = client => {
console.error();
}
/**
* @INFO
* Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template
* @INFO
* Work for Milrato Development | https://milrato.eu
* @INFO
* Please mention Him / Milrato Development, when using this Code!
* @INFO
*/
37 changes: 37 additions & 0 deletions events/client/ready.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//here the event starts
const config = require("../../botconfig/config.json")
module.exports = client => {
try{
const stringlength = 69;
console.log("\n")
console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.brightGreen)
console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen)
console.log(` ┃ `.bold.brightGreen + `Discord Bot is online!`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-`Discord Bot is online!`.length)+ "┃".bold.brightGreen)
console.log(` ┃ `.bold.brightGreen + ` /--/ ${client.user.tag} /--/ `.bold.brightGreen+ " ".repeat(-1+stringlength-` ┃ `.length-` /--/ ${client.user.tag} /--/ `.length)+ "┃".bold.brightGreen)
console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen)
console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.brightGreen)
}catch{ /* */ }

try{
client.user.setActivity(client.user.username, { type: "PLAYING" });
}catch (e) {
console.log(String(e.stack).red);
}
//Change status each 10 minutes
setTimeout(()=>{
try{
client.user.setActivity(client.user.username, { type: "PLAYING" });
}catch (e) {
console.log(String(e.stack).red);
}
}, 10*60*1000)
}
/**
* @INFO
* Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template
* @INFO
* Work for Milrato Development | https://milrato.eu
* @INFO
* Please mention Him / Milrato Development, when using this Code!
* @INFO
*/
14 changes: 14 additions & 0 deletions events/client/reconnecting.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//here the event starts
module.exports = client => {
console.log(`Reconnceting at ${new Date()}.`.bgYellow.black)
}

/**
* @INFO
* Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template
* @INFO
* Work for Milrato Development | https://milrato.eu
* @INFO
* Please mention Him / Milrato Development, when using this Code!
* @INFO
*/
13 changes: 13 additions & 0 deletions events/client/warn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//here the event starts
module.exports = client => {
console.warn();
}
/**
* @INFO
* Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template
* @INFO
* Work for Milrato Development | https://milrato.eu
* @INFO
* Please mention Him / Milrato Development, when using this Code!
* @INFO
*/
Loading

0 comments on commit 9cc3cc5

Please sign in to comment.