├── .github └── FUNDING.yml ├── LICENSE ├── README.md ├── botconfig ├── config.json └── embed.json ├── bots ├── discordjshandler │ ├── LICENSE │ ├── README.md │ ├── botconfig │ │ ├── config.json │ │ └── embed.json │ ├── commands │ │ ├── Administration │ │ │ ├── embed.js │ │ │ └── say.js │ │ └── Information │ │ │ ├── help.js │ │ │ ├── ping.js │ │ │ └── uptime.js │ ├── events │ │ ├── client │ │ │ ├── disconnect.js │ │ │ ├── error.js │ │ │ ├── ready.js │ │ │ ├── reconnecting.js │ │ │ └── warn.js │ │ └── guild │ │ │ └── message.js │ ├── handlers │ │ ├── command.js │ │ ├── events.js │ │ └── functions.js │ ├── index.js │ └── package.json ├── jointocreate │ ├── LICENSE │ ├── README.md │ ├── botconfig │ │ ├── config.json │ │ └── embed.json │ ├── commands │ │ ├── Information │ │ │ ├── help.js │ │ │ ├── ping.js │ │ │ └── uptime.js │ │ └── Setup │ │ │ ├── addchannel.js │ │ │ └── removechannel.js │ ├── events │ │ ├── client │ │ │ ├── disconnect.js │ │ │ ├── error.js │ │ │ ├── ready.js │ │ │ ├── reconnecting.js │ │ │ └── warn.js │ │ └── guild │ │ │ └── message.js │ ├── handlers │ │ ├── command.js │ │ ├── events.js │ │ └── functions.js │ ├── index.js │ ├── modules │ │ └── jointocreate.js │ └── package.json ├── musicbot │ ├── LICENSE │ ├── README.md │ ├── botconfig │ │ ├── config.json │ │ └── embed.json │ ├── commands │ │ ├── Administration │ │ │ ├── embed.js │ │ │ └── say.js │ │ ├── Information │ │ │ ├── help.js │ │ │ ├── ping.js │ │ │ └── uptime.js │ │ └── Music │ │ │ ├── autoplay.js │ │ │ ├── filter.js │ │ │ ├── forward.js │ │ │ ├── loop.js │ │ │ ├── nowplaying.js │ │ │ ├── pause.js │ │ │ ├── play.js │ │ │ ├── queue.js │ │ │ ├── resume.js │ │ │ ├── rewind.js │ │ │ ├── search.js │ │ │ ├── seek.js │ │ │ ├── shuffle.js │ │ │ ├── skip.js │ │ │ ├── stop.js │ │ │ └── volume.js │ ├── events │ │ ├── client │ │ │ ├── disconnect.js │ │ │ ├── error.js │ │ │ ├── ready.js │ │ │ ├── reconnecting.js │ │ │ └── warn.js │ │ └── guild │ │ │ └── message.js │ ├── handlers │ │ ├── command.js │ │ ├── distube-handler.js │ │ ├── events.js │ │ └── functions.js │ ├── index.js │ └── package.json └── waitingroombot │ ├── LICENSE │ ├── README.md │ ├── botconfig │ ├── config.json │ └── embed.json │ ├── commands │ ├── Information │ │ ├── help.js │ │ ├── ping.js │ │ └── uptime.js │ └── Voice │ │ ├── changeradio.js │ │ ├── join.js │ │ ├── leave.js │ │ ├── play.js │ │ ├── rejoin.js │ │ └── setup.js │ ├── events │ ├── client │ │ ├── disconnect.js │ │ ├── error.js │ │ ├── ready.js │ │ ├── reconnecting.js │ │ └── warn.js │ └── guild │ │ └── message.js │ ├── handlers │ ├── command.js │ ├── events.js │ └── functions.js │ ├── index.js │ ├── modules │ └── radiomodule.js │ └── package.json ├── commands ├── ⚙️ Bot Creation │ ├── discordjshandler.js │ ├── jointocreatebot.js │ ├── musicbot.js │ └── waitingroombot.js ├── ⛔️ Admin │ ├── embed.js │ ├── prefix.js │ └── say.js └── 🔰 Info │ ├── botinfo.js │ ├── developer.js │ ├── github.js │ ├── help.js │ ├── invite.js │ ├── ping.js │ ├── serverinfo.js │ ├── sponsor.js │ ├── stats.js │ ├── uptime.js │ └── userinfo.js ├── databases ├── settings │ └── placeholder.txt └── stats │ └── placeholder.txt ├── events ├── client │ ├── disconnect.js │ ├── error.js │ ├── ready.js │ ├── reconnecting.js │ └── warn.js └── guild │ └── message.js ├── handlers ├── command.js ├── events.js └── functions.js ├── index.js └── package.json /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ['milrato.eu', 'dc.milrato.eu', 'bero.milrato.eu', 'bittmax.milrato.eu' ] 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Discord Bot Maker 2 | 3 | **A Discord Bot that makes yourself Discord Bots** 4 | 5 | [This is the official Source Code of the Public Bot called "DISCORD BOT MAKER#9428"](https://discordbotmaker.milrato.eu) so if you consider to use the source code than please make sure to support [Milrato Development](https://milrato.eu) by [Inviting](https://discordbotmaker.milrato.eu) this Bot! 6 | 7 |
8 | 9 | *** 10 | 11 | ## [Discord Server 😎](https://discord.gg/milrato) | [Website](https://milrato.dev) 12 | 13 | 14 | *** 15 | 16 | ## SUPPORT ME AND MILRATO DEVELOPMENT 17 | 18 | > You can always Support me by inviting one of my **own Discord Bots** 19 | 20 | [![2021's best Music Bot | Lava Music](https://cdn.discordapp.com/attachments/748533465972080670/817088638780440579/test3.png)](https://lava.milrato.dev) 21 | [![Musicium Music Bot](https://cdn.discordapp.com/attachments/742446682381221938/770055673965707264/test1.png)](https://musicium.musicium.dev) 22 | [![Milrato Multi Bot](https://cdn.discordapp.com/attachments/742446682381221938/770056826724679680/test1.png)](https://milrato.milrato.dev) 23 | 24 | # Credits 25 | 26 | > If consider using this Bot, make sure to credit me! 27 | -------------------------------------------------------------------------------- /botconfig/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "token": "YOUR TOKEN GOES HERE", 3 | "prefix": "b!" 4 | } 5 | -------------------------------------------------------------------------------- /botconfig/embed.json: -------------------------------------------------------------------------------- 1 | { 2 | "color": "#ffca4f", 3 | "wrongcolor": "#e01e01", 4 | "footertext": "Discord Bot Maker | powered by milrato.eu", 5 | "footericon": "https://cdn.discordapp.com/attachments/816967454776623123/816973890898362368/discordbotmaker.png" 6 | } 7 | -------------------------------------------------------------------------------- /bots/discordjshandler/README.md: -------------------------------------------------------------------------------- 1 | # Discord-Js-Handler-Template 2 | 3 | For Questions: https://discord.gg/fS6qBSm 4 | 5 | ## BEST HOSTING | Bittmax.de 6 | BITTMAX Quality is their solution. 7 | Bittmax is our first and probably most important sponsor! 8 | 9 | **What they are offering:** 10 | > Quality LXC & KVM (Root) Server 11 | > Minecraft Hosting, as well as BungeeCord Network Hosting support 12 | > Cheap and fast Domains 13 | > WEBHOSTING 14 | > DISCORD, TEAMSPEAK, Setups / Music Bots 15 | > GAME SERVER, Rust, Gary's Mod, .. 16 | 17 | **Discord Server:** 18 | [https://discord.gg/GgjJZCyYKD](https://discord.gg/GgjJZCyYKD) 19 | 20 | **Website:** 21 | [https://bittmax.de/](https://bittmax.de/]) 22 | 23 | GET **5%** OFF EVERYTHING FOR EVER! 24 | Code: **`x10`** 25 | 26 | ## MC-Host24.de 27 | MC-Host24.de is selling the Best Digital Hosting Services ever! 28 | Like For games.. 29 | 30 | **What they are offering:** 31 | > Quality LXC & KVM (Root) Server 32 | > WORLDS BEST Minecraft Hosting, 33 | > Cheap and fast Domains 34 | > WEBHOSTING 35 | > DISCORD, TEAMSPEAK, Setups / Music Bots 36 | > GAME SERVER, Rust, Gary's Mod, .. 37 | 38 | **Discord Server:** 39 | [https://discord.com/invite/4dGuGXK4A4](https://discord.com/invite/4dGuGXK4A4) 40 | 41 | **Website:** 42 | [mc-host24.de](https://mc-host24.de/user/affiliate/3121]) 43 | 44 | 45 | ## SUPPORT ME 46 | 47 | You can always Support me by inviting one of my **own Discord Bots** 48 | 49 | [![Musicium Music Bot](https://cdn.discordapp.com/attachments/742446682381221938/770055673965707264/test1.png)](https://musicium.eu) 50 | [![Milrato Multi Bot](https://cdn.discordapp.com/attachments/742446682381221938/770056826724679680/test1.png)](https://milrato.eu) 51 | 52 | [OTHER BOTS](https://bots.musicium.eu) 53 | 54 | [| fork my repository |](https://github.com/user/repository/fork) 55 | [watch this repo |](https://github.com/user/repository/subscription) 56 | [create issue |](https://github.com/user/repository/issues/new) 57 | 58 | *Both bots are still in Development, and will always be in development, this means always uptodate and always online and always improving!* 59 | -------------------------------------------------------------------------------- /bots/discordjshandler/botconfig/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "token": "", 3 | "prefix": "", 4 | "owner": "" 5 | } -------------------------------------------------------------------------------- /bots/discordjshandler/botconfig/embed.json: -------------------------------------------------------------------------------- 1 | { 2 | "color": "#3498db", 3 | "wrongcolor": "#e01e01" 4 | } 5 | -------------------------------------------------------------------------------- /bots/discordjshandler/commands/Administration/embed.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "embed", 6 | category: "Administration", 7 | aliases: ["say-embed"], 8 | cooldown: 2, 9 | usage: "embed ++ <DESCRIPTION>", 10 | description: "Resends a message from u as an Embed", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | if(!args[0]) 14 | return message.channel.send(new MessageEmbed() 15 | .setColor(ee.wrongcolor) 16 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 17 | .setTitle(`❌ ERROR | You didn't provided a Title, nor a Description`) 18 | .setDescription(`Usage: \`${prefix}embed <TITLE> ++ <DESCRIPTION>\``) 19 | ); 20 | let userargs = args.join(" ").split("++"); 21 | let title = userargs[0]; 22 | let desc = userargs.slice(1).join(" ") 23 | message.channel.send(new MessageEmbed() 24 | .setColor(ee.color) 25 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 26 | .setTitle(title ? title : "") 27 | .setDescription(desc ? desc : "") 28 | ) 29 | } catch (e) { 30 | console.log(String(e.stack).bgRed) 31 | return message.channel.send(new MessageEmbed() 32 | .setColor(ee.wrongcolor) 33 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 34 | .setTitle(`❌ ERROR | An error occurred`) 35 | .setDescription(`\`\`\`${e.message}\`\`\``) 36 | ); 37 | } 38 | } 39 | } 40 | /** 41 | * @INFO 42 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 43 | * @INFO 44 | * Work for Milrato Development | https://milrato.eu 45 | * @INFO 46 | * Please mention Him / Milrato Development, when using this Code! 47 | * @INFO 48 | */ 49 | -------------------------------------------------------------------------------- /bots/discordjshandler/commands/Administration/say.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "say", 6 | category: "Administration", 7 | aliases: [""], 8 | cooldown: 2, 9 | usage: "say <TEXT>", 10 | description: "Resends your Text", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | if(!args[0]) 14 | return message.channel.send(new MessageEmbed() 15 | .setColor(ee.wrongcolor) 16 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 17 | .setTitle(`❌ ERROR | You didn't provided a Text`) 18 | .setDescription(`Usage: \`${prefix}say <Your Text>\``) 19 | ); 20 | message.channel.send(text); 21 | } catch (e) { 22 | console.log(String(e.stack).bgRed) 23 | return message.channel.send(new MessageEmbed() 24 | .setColor(ee.wrongcolor) 25 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 26 | .setTitle(`❌ ERROR | An error occurred`) 27 | .setDescription(`\`\`\`${e.message}\`\`\``) 28 | ); 29 | } 30 | } 31 | } 32 | /** 33 | * @INFO 34 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 35 | * @INFO 36 | * Work for Milrato Development | https://milrato.eu 37 | * @INFO 38 | * Please mention Him / Milrato Development, when using this Code! 39 | * @INFO 40 | */ 41 | -------------------------------------------------------------------------------- /bots/discordjshandler/commands/Information/help.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "help", 6 | category: "Information", 7 | aliases: ["h", "commandinfo", "cmds", "cmd"], 8 | cooldown: 4, 9 | usage: "help [Command]", 10 | description: "Returns all Commmands, or one specific command", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | if (args[0]) { 14 | const embed = new MessageEmbed(); 15 | const cmd = client.commands.get(args[0].toLowerCase()) || client.commands.get(client.aliases.get(args[0].toLowerCase())); 16 | if (!cmd) { 17 | return message.channel.send(embed.setColor(ee.wrongcolor).setDescription(`No Information found for command **${args[0].toLowerCase()}**`)); 18 | } 19 | if (cmd.name) embed.addField("**Command name**", `\`${cmd.name}\``); 20 | if (cmd.name) embed.setTitle(`Detailed Information about:\`${cmd.name}\``); 21 | if (cmd.description) embed.addField("**Description**", `\`${cmd.description}\``); 22 | if (cmd.aliases) embed.addField("**Aliases**", `\`${cmd.aliases.map((a) => `${a}`).join("`, `")}\``); 23 | if (cmd.cooldown) embed.addField("**Cooldown**", `\`${cmd.cooldown} Seconds\``); 24 | else embed.addField("**Cooldown**", `\`1 Second\``); 25 | if (cmd.usage) { 26 | embed.addField("**Usage**", `\`${config.prefix}${cmd.usage}\``); 27 | embed.setFooter("Syntax: <> = required, [] = optional"); 28 | } 29 | if (cmd.useage) { 30 | embed.addField("**Useage**", `\`${config.prefix}${cmd.useage}\``); 31 | embed.setFooter("Syntax: <> = required, [] = optional"); 32 | } 33 | return message.channel.send(embed.setColor(ee.color)); 34 | } else { 35 | const embed = new MessageEmbed() 36 | .setColor(ee.color) 37 | .setThumbnail(client.user.displayAvatarURL()) 38 | .setTitle("HELP MENU 🔰 Commands") 39 | .setFooter(`To see command descriptions and inforamtion, type: ${config.prefix}help [CMD NAME]`, client.user.displayAvatarURL()); 40 | const commands = (category) => { 41 | return client.commands.filter((cmd) => cmd.category === category).map((cmd) => `\`${cmd.name}\``); 42 | }; 43 | try { 44 | for (let i = 0; i < client.categories.length; i += 1) { 45 | const current = client.categories[i]; 46 | const items = commands(current); 47 | const n = 3; 48 | const result = [[], [], []]; 49 | const wordsPerLine = Math.ceil(items.length / 3); 50 | for (let line = 0; line < n; line++) { 51 | for (let i = 0; i < wordsPerLine; i++) { 52 | const value = items[i + line * wordsPerLine]; 53 | if (!value) continue; 54 | result[line].push(value); 55 | } 56 | } 57 | embed.addField(`**${current.toUpperCase()} [${items.length}]**`, `> ${result[0].join("\n> ")}`, true); 58 | embed.addField(`\u200b`, `${result[1].join("\n") ? result[1].join("\n") : "\u200b"}`, true); 59 | embed.addField(`\u200b`, `${result[2].join("\n") ? result[2].join("\n") : "\u200b"}`, true); 60 | } 61 | } catch (e) { 62 | console.log(String(e.stack).red); 63 | } 64 | message.channel.send(embed); 65 | } 66 | } catch (e) { 67 | console.log(String(e.stack).bgRed) 68 | return message.channel.send(new MessageEmbed() 69 | .setColor(ee.wrongcolor) 70 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 71 | .setTitle(`❌ ERROR | An error occurred`) 72 | .setDescription(`\`\`\`${e.message}\`\`\``) 73 | ); 74 | } 75 | } 76 | } 77 | /** 78 | * @INFO 79 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 80 | * @INFO 81 | * Work for Milrato Development | https://milrato.eu 82 | * @INFO 83 | * Please mention Him / Milrato Development, when using this Code! 84 | * @INFO 85 | */ 86 | -------------------------------------------------------------------------------- /bots/discordjshandler/commands/Information/ping.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "ping", 6 | category: "Information", 7 | aliases: ["latency"], 8 | cooldown: 2, 9 | usage: "ping", 10 | description: "Gives you information on how fast the Bot can respond to you", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | message.channel.send(new MessageEmbed() 14 | .setColor(ee.color) 15 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 16 | .setTitle(`🏓 Pinging....`) 17 | ).then(msg=>{ 18 | msg.edit(new MessageEmbed() 19 | .setColor(ee.color) 20 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 21 | .setTitle(`🏓 Ping is \`${Math.round(client.ws.ping)}ms\``) 22 | ); 23 | }) 24 | } catch (e) { 25 | console.log(String(e.stack).bgRed) 26 | return message.channel.send(new MessageEmbed() 27 | .setColor(ee.wrongcolor) 28 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 29 | .setTitle(`❌ ERROR | An error occurred`) 30 | .setDescription(`\`\`\`${e.message}\`\`\``) 31 | ); 32 | } 33 | } 34 | } 35 | /** 36 | * @INFO 37 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 38 | * @INFO 39 | * Work for Milrato Development | https://milrato.eu 40 | * @INFO 41 | * Please mention Him / Milrato Development, when using this Code! 42 | * @INFO 43 | */ 44 | -------------------------------------------------------------------------------- /bots/discordjshandler/commands/Information/uptime.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const { duration } = require("../../handlers/functions") 5 | module.exports = { 6 | name: "uptime", 7 | category: "Information", 8 | aliases: [""], 9 | cooldown: 10, 10 | usage: "uptime", 11 | description: "Returns the duration on how long the Bot is online", 12 | run: async (client, message, args, user, text, prefix) => { 13 | try{ 14 | message.channel.send(new MessageEmbed() 15 | .setColor(ee.color) 16 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 17 | .setTitle(`:white_check_mark: **${client.user.username}** is since:\n ${duration(client.uptime)} online`) 18 | ); 19 | } catch (e) { 20 | console.log(String(e.stack).bgRed) 21 | return message.channel.send(new MessageEmbed() 22 | .setColor(ee.wrongcolor) 23 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 24 | .setTitle(`❌ ERROR | An error occurred`) 25 | .setDescription(`\`\`\`${e.message}\`\`\``) 26 | ); 27 | } 28 | } 29 | } 30 | /** 31 | * @INFO 32 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 33 | * @INFO 34 | * Work for Milrato Development | https://milrato.eu 35 | * @INFO 36 | * Please mention Him / Milrato Development, when using this Code! 37 | * @INFO 38 | */ 39 | -------------------------------------------------------------------------------- /bots/discordjshandler/events/client/disconnect.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.log(`You have been disconnected at ${new Date()}.`.red) 4 | } 5 | /** 6 | * @INFO 7 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 8 | * @INFO 9 | * Work for Milrato Development | https://milrato.eu 10 | * @INFO 11 | * Please mention Him / Milrato Development, when using this Code! 12 | * @INFO 13 | */ 14 | -------------------------------------------------------------------------------- /bots/discordjshandler/events/client/error.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.error(); 4 | } 5 | /** 6 | * @INFO 7 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 8 | * @INFO 9 | * Work for Milrato Development | https://milrato.eu 10 | * @INFO 11 | * Please mention Him / Milrato Development, when using this Code! 12 | * @INFO 13 | */ 14 | -------------------------------------------------------------------------------- /bots/discordjshandler/events/client/ready.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | const config = require("../../botconfig/config.json") 3 | module.exports = client => { 4 | try{ 5 | const stringlength = 69; 6 | console.log("\n") 7 | console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.brightGreen) 8 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 9 | console.log(` ┃ `.bold.brightGreen + `Discord Bot is online!`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-`Discord Bot is online!`.length)+ "┃".bold.brightGreen) 10 | console.log(` ┃ `.bold.brightGreen + ` /--/ ${client.user.tag} /--/ `.bold.brightGreen+ " ".repeat(-1+stringlength-` ┃ `.length-` /--/ ${client.user.tag} /--/ `.length)+ "┃".bold.brightGreen) 11 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 12 | console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.brightGreen) 13 | }catch{ /* */ } 14 | 15 | try{ 16 | client.user.setActivity(client.user.username, { type: "PLAYING" }); 17 | }catch (e) { 18 | console.log(String(e.stack).red); 19 | } 20 | //Change status each 10 minutes 21 | setInterval(()=>{ 22 | try{ 23 | client.user.setActivity(client.user.username, { type: "PLAYING" }); 24 | }catch (e) { 25 | console.log(String(e.stack).red); 26 | } 27 | }, 10*60*1000) 28 | } 29 | /** 30 | * @INFO 31 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 32 | * @INFO 33 | * Work for Milrato Development | https://milrato.eu 34 | * @INFO 35 | * Please mention Him / Milrato Development, when using this Code! 36 | * @INFO 37 | */ 38 | -------------------------------------------------------------------------------- /bots/discordjshandler/events/client/reconnecting.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.log(`Reconnceting at ${new Date()}.`.bgYellow.black) 4 | } 5 | 6 | /** 7 | * @INFO 8 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 9 | * @INFO 10 | * Work for Milrato Development | https://milrato.eu 11 | * @INFO 12 | * Please mention Him / Milrato Development, when using this Code! 13 | * @INFO 14 | */ 15 | -------------------------------------------------------------------------------- /bots/discordjshandler/events/client/warn.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.warn(); 4 | } 5 | /** 6 | * @INFO 7 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 8 | * @INFO 9 | * Work for Milrato Development | https://milrato.eu 10 | * @INFO 11 | * Please mention Him / Milrato Development, when using this Code! 12 | * @INFO 13 | */ 14 | -------------------------------------------------------------------------------- /bots/discordjshandler/handlers/command.js: -------------------------------------------------------------------------------- 1 | const { readdirSync } = require("fs"); 2 | const ascii = require("ascii-table"); 3 | let table = new ascii("Commands"); 4 | table.setHeading("Command", "Load status"); 5 | console.log("Welcome to SERVICE HANDLER /--/ By https://milrato.eu /--/ Discord: Tomato#6966".yellow); 6 | module.exports = (client) => { 7 | try{ 8 | readdirSync("./commands/").forEach((dir) => { 9 | const commands = readdirSync(`./commands/${dir}/`).filter((file) => file.endsWith(".js")); 10 | for (let file of commands) { 11 | let pull = require(`../commands/${dir}/${file}`); 12 | if (pull.name) { 13 | client.commands.set(pull.name, pull); 14 | table.addRow(file, "Ready"); 15 | } else { 16 | table.addRow(file, `error->missing a help.name,or help.name is not a string.`); 17 | continue; 18 | } 19 | if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach((alias) => client.aliases.set(alias, pull.name)); 20 | } 21 | }); 22 | console.log(table.toString().cyan); 23 | }catch (e){ 24 | console.log(String(e.stack).bgRed) 25 | } 26 | }; 27 | /** 28 | * @INFO 29 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 30 | * @INFO 31 | * Work for Milrato Development | https://milrato.eu 32 | * @INFO 33 | * Please mention Him / Milrato Development, when using this Code! 34 | * @INFO 35 | */ 36 | -------------------------------------------------------------------------------- /bots/discordjshandler/handlers/events.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const ascii = require("ascii-table"); 3 | let table = new ascii("Events"); 4 | table.setHeading("Events", "Load status"); 5 | const allevents = []; 6 | module.exports = async (client) => { 7 | try{ 8 | const load_dir = (dir) => { 9 | const event_files = fs.readdirSync(`./events/${dir}`).filter((file) => file.endsWith(".js")); 10 | for (const file of event_files){ 11 | const event = require(`../events/${dir}/${file}`) 12 | let eventName = file.split(".")[0]; 13 | allevents.push(eventName); 14 | client.on(eventName, event.bind(null, client)); 15 | } 16 | } 17 | await ["client", "guild"].forEach(e=>load_dir(e)); 18 | for (let i = 0; i < allevents.length; i++) { 19 | try { 20 | table.addRow(allevents[i], "Ready"); 21 | } catch (e) { 22 | console.log(String(e.stack).red); 23 | } 24 | } 25 | console.log(table.toString().cyan); 26 | try{ 27 | const stringlength = 69; 28 | console.log("\n") 29 | console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.brightGreen) 30 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 31 | console.log(` ┃ `.bold.brightGreen + `Welcome to SERVICE HANDLER!`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-`Welcome to SERVICE HANDLER!`.length)+ "┃".bold.brightGreen) 32 | console.log(` ┃ `.bold.brightGreen + ` /-/ By https://milrato.eu /-/`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-` /-/ By https://milrato.eu /-/`.length)+ "┃".bold.brightGreen) 33 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 34 | console.log(` ┃ `.bold.brightGreen + ` /-/ Discord: Tomato#6966 /-/`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-` /-/ By Discord: Tomato#6966 /-/`.length)+ " ┃".bold.brightGreen) 35 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 36 | console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.brightGreen) 37 | }catch{ /* */ } 38 | try{ 39 | const stringlength2 = 69; 40 | console.log("\n") 41 | console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.yellow) 42 | console.log(` ┃ `.bold.yellow + " ".repeat(-1+stringlength2-` ┃ `.length)+ "┃".bold.yellow) 43 | console.log(` ┃ `.bold.yellow + `Logging into the BOT...`.bold.yellow + " ".repeat(-1+stringlength2-` ┃ `.length-`Logging into the BOT...`.length)+ "┃".bold.yellow) 44 | console.log(` ┃ `.bold.yellow + " ".repeat(-1+stringlength2-` ┃ `.length)+ "┃".bold.yellow) 45 | console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.yellow) 46 | }catch{ /* */ } 47 | }catch (e){ 48 | console.log(String(e.stack).bgRed) 49 | } 50 | }; 51 | /** 52 | * @INFO 53 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 54 | * @INFO 55 | * Work for Milrato Development | https://milrato.eu 56 | * @INFO 57 | * Please mention Him / Milrato Development, when using this Code! 58 | * @INFO 59 | */ 60 | -------------------------------------------------------------------------------- /bots/discordjshandler/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @INFO 3 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 4 | * @INFO 5 | * Work for Milrato Development | https://milrato.eu 6 | * @INFO 7 | * Please mention Him / Milrato Development, when using this Code! 8 | * @INFO 9 | */ 10 | //Importing all needed Commands 11 | const Discord = require("discord.js"); //this is the official discord.js wrapper for the Discord Api, which we use! 12 | const colors = require("colors"); //this Package is used, to change the colors of our Console! (optional and doesnt effect performance) 13 | const fs = require("fs"); //this package is for reading files and getting their inputs 14 | //Creating the Discord.js Client for This Bot with some default settings ;) and with partials, so you can fetch OLD messages 15 | const client = new Discord.Client({ 16 | messageCacheLifetime: 60, 17 | fetchAllMembers: false, 18 | messageCacheMaxSize: 10, 19 | restTimeOffset: 0, 20 | restWsBridgetimeout: 100, 21 | disableEveryone: true, 22 | partials: ['MESSAGE', 'CHANNEL', 'REACTION'] 23 | }); 24 | //Client variables to use everywhere 25 | client.commands = new Discord.Collection(); //an collection (like a digital map(database)) for all your commands 26 | client.aliases = new Discord.Collection(); //an collection for all your command-aliases 27 | client.categories = fs.readdirSync("./commands/"); //categories 28 | client.cooldowns = new Discord.Collection(); //an collection for cooldown commands of each user 29 | 30 | //Loading files, with the client variable like Command Handler, Event Handler, ... 31 | ["command", "events"].forEach(handler => { 32 | require(`./handlers/${handler}`)(client); 33 | }); 34 | //login into the bot 35 | client.login(require("./botconfig/config.json").token); 36 | /** 37 | * @INFO 38 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 39 | * @INFO 40 | * Work for Milrato Development | https://milrato.eu 41 | * @INFO 42 | * Please mention Him / Milrato Development, when using this Code! 43 | * @INFO 44 | */ 45 | -------------------------------------------------------------------------------- /bots/discordjshandler/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "discord-js-handler-template", 3 | "version": "1.0.0", 4 | "description": "Discord.js Command and Event Handler Template with example Command usages! For Questions: https://discord.gg/fS6qBSm", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node index.js" 9 | }, 10 | "author": "Tomato#6966", 11 | "license": "ISC", 12 | "dependencies": { 13 | "ascii-table": "0.0.9", 14 | "discord.js": "^12.5.1" 15 | }, 16 | "devDependencies": { 17 | "ascii-table": "0.0.9", 18 | "colors": "^1.4.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /bots/jointocreate/README.md: -------------------------------------------------------------------------------- 1 | # Discord-Js-Handler-Template 2 | 3 | For Questions: https://discord.gg/fS6qBSm 4 | 5 | ## BEST HOSTING | Bittmax.de 6 | BITTMAX Quality is their solution. 7 | Bittmax is our first and probably most important sponsor! 8 | 9 | **What they are offering:** 10 | > Quality LXC & KVM (Root) Server 11 | > Minecraft Hosting, as well as BungeeCord Network Hosting support 12 | > Cheap and fast Domains 13 | > WEBHOSTING 14 | > DISCORD, TEAMSPEAK, Setups / Music Bots 15 | > GAME SERVER, Rust, Gary's Mod, .. 16 | 17 | **Discord Server:** 18 | [https://discord.gg/GgjJZCyYKD](https://discord.gg/GgjJZCyYKD) 19 | 20 | **Website:** 21 | [https://bittmax.de/](https://bittmax.de/]) 22 | 23 | GET **5%** OFF EVERYTHING FOR EVER! 24 | Code: **`x10`** 25 | 26 | ## MC-Host24.de 27 | MC-Host24.de is selling the Best Digital Hosting Services ever! 28 | Like For games.. 29 | 30 | **What they are offering:** 31 | > Quality LXC & KVM (Root) Server 32 | > WORLDS BEST Minecraft Hosting, 33 | > Cheap and fast Domains 34 | > WEBHOSTING 35 | > DISCORD, TEAMSPEAK, Setups / Music Bots 36 | > GAME SERVER, Rust, Gary's Mod, .. 37 | 38 | **Discord Server:** 39 | [https://discord.com/invite/4dGuGXK4A4](https://discord.com/invite/4dGuGXK4A4) 40 | 41 | **Website:** 42 | [mc-host24.de](https://mc-host24.de/user/affiliate/3121]) 43 | 44 | 45 | ## SUPPORT ME 46 | 47 | You can always Support me by inviting one of my **own Discord Bots** 48 | 49 | [![Musicium Music Bot](https://cdn.discordapp.com/attachments/742446682381221938/770055673965707264/test1.png)](https://musicium.eu) 50 | [![Milrato Multi Bot](https://cdn.discordapp.com/attachments/742446682381221938/770056826724679680/test1.png)](https://milrato.eu) 51 | 52 | [OTHER BOTS](https://bots.musicium.eu) 53 | 54 | [| fork my repository |](https://github.com/user/repository/fork) 55 | [watch this repo |](https://github.com/user/repository/subscription) 56 | [create issue |](https://github.com/user/repository/issues/new) 57 | 58 | *Both bots are still in Development, and will always be in development, this means always uptodate and always online and always improving!* 59 | -------------------------------------------------------------------------------- /bots/jointocreate/botconfig/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "token": "", 3 | "prefix": "", 4 | "owner": "", 5 | "channels": [], 6 | "guild": "" 7 | } -------------------------------------------------------------------------------- /bots/jointocreate/botconfig/embed.json: -------------------------------------------------------------------------------- 1 | { 2 | "color": "#3498db", 3 | "wrongcolor": "#e01e01" 4 | } 5 | -------------------------------------------------------------------------------- /bots/jointocreate/commands/Information/help.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "help", 6 | category: "Information", 7 | aliases: ["h", "commandinfo", "cmds", "cmd"], 8 | cooldown: 4, 9 | usage: "help [Command]", 10 | description: "Returns all Commmands, or one specific command", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | if (args[0]) { 14 | const embed = new MessageEmbed(); 15 | const cmd = client.commands.get(args[0].toLowerCase()) || client.commands.get(client.aliases.get(args[0].toLowerCase())); 16 | if (!cmd) { 17 | return message.channel.send(embed.setColor(ee.wrongcolor).setDescription(`No Information found for command **${args[0].toLowerCase()}**`)); 18 | } 19 | if (cmd.name) embed.addField("**Command name**", `\`${cmd.name}\``); 20 | if (cmd.name) embed.setTitle(`Detailed Information about:\`${cmd.name}\``); 21 | if (cmd.description) embed.addField("**Description**", `\`${cmd.description}\``); 22 | if (cmd.aliases) embed.addField("**Aliases**", `\`${cmd.aliases.map((a) => `${a}`).join("`, `")}\``); 23 | if (cmd.cooldown) embed.addField("**Cooldown**", `\`${cmd.cooldown} Seconds\``); 24 | else embed.addField("**Cooldown**", `\`1 Second\``); 25 | if (cmd.usage) { 26 | embed.addField("**Usage**", `\`${config.prefix}${cmd.usage}\``); 27 | embed.setFooter("Syntax: <> = required, [] = optional"); 28 | } 29 | if (cmd.useage) { 30 | embed.addField("**Useage**", `\`${config.prefix}${cmd.useage}\``); 31 | embed.setFooter("Syntax: <> = required, [] = optional"); 32 | } 33 | return message.channel.send(embed.setColor(ee.color)); 34 | } else { 35 | const embed = new MessageEmbed() 36 | .setColor(ee.color) 37 | .setThumbnail(client.user.displayAvatarURL()) 38 | .setTitle("HELP MENU 🔰 Commands") 39 | .setFooter(`To see command descriptions and inforamtion, type: ${config.prefix}help [CMD NAME]`, client.user.displayAvatarURL()); 40 | const commands = (category) => { 41 | return client.commands.filter((cmd) => cmd.category === category).map((cmd) => `\`${cmd.name}\``); 42 | }; 43 | try { 44 | for (let i = 0; i < client.categories.length; i += 1) { 45 | const current = client.categories[i]; 46 | const items = commands(current); 47 | const n = 3; 48 | const result = [[], [], []]; 49 | const wordsPerLine = Math.ceil(items.length / 3); 50 | for (let line = 0; line < n; line++) { 51 | for (let i = 0; i < wordsPerLine; i++) { 52 | const value = items[i + line * wordsPerLine]; 53 | if (!value) continue; 54 | result[line].push(value); 55 | } 56 | } 57 | embed.addField(`**${current.toUpperCase()} [${items.length}]**`, `> ${result[0].join("\n> ")}`, true); 58 | embed.addField(`\u200b`, `${result[1].join("\n") ? result[1].join("\n") : "\u200b"}`, true); 59 | embed.addField(`\u200b`, `${result[2].join("\n") ? result[2].join("\n") : "\u200b"}`, true); 60 | } 61 | } catch (e) { 62 | console.log(String(e.stack).red); 63 | } 64 | message.channel.send(embed); 65 | } 66 | } catch (e) { 67 | console.log(String(e.stack).bgRed) 68 | return message.channel.send(new MessageEmbed() 69 | .setColor(ee.wrongcolor) 70 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 71 | .setTitle(`❌ ERROR | An error occurred`) 72 | .setDescription(`\`\`\`${e.stack}\`\`\``) 73 | ); 74 | } 75 | } 76 | } 77 | /** 78 | * @INFO 79 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 80 | * @INFO 81 | * Work for Milrato Development | https://milrato.eu 82 | * @INFO 83 | * Please mention Him / Milrato Development, when using this Code! 84 | * @INFO 85 | */ 86 | -------------------------------------------------------------------------------- /bots/jointocreate/commands/Information/ping.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "ping", 6 | category: "Information", 7 | aliases: ["latency"], 8 | cooldown: 2, 9 | usage: "ping", 10 | description: "Gives you information on how fast the Bot can respond to you", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | message.channel.send(new MessageEmbed() 14 | .setColor(ee.color) 15 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 16 | .setTitle(`🏓 Pinging....`) 17 | ).then(msg=>{ 18 | msg.edit(new MessageEmbed() 19 | .setColor(ee.color) 20 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 21 | .setTitle(`🏓 Ping is \`${Math.round(client.ws.ping)}ms\``) 22 | ); 23 | }) 24 | } catch (e) { 25 | console.log(String(e.stack).bgRed) 26 | return message.channel.send(new MessageEmbed() 27 | .setColor(ee.wrongcolor) 28 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 29 | .setTitle(`❌ ERROR | An error occurred`) 30 | .setDescription(`\`\`\`${e.stack}\`\`\``) 31 | ); 32 | } 33 | } 34 | } 35 | /** 36 | * @INFO 37 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 38 | * @INFO 39 | * Work for Milrato Development | https://milrato.eu 40 | * @INFO 41 | * Please mention Him / Milrato Development, when using this Code! 42 | * @INFO 43 | */ 44 | -------------------------------------------------------------------------------- /bots/jointocreate/commands/Information/uptime.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const { duration } = require("../../handlers/functions") 5 | module.exports = { 6 | name: "uptime", 7 | category: "Information", 8 | aliases: [""], 9 | cooldown: 10, 10 | usage: "uptime", 11 | description: "Returns the duration on how long the Bot is online", 12 | run: async (client, message, args, user, text, prefix) => { 13 | try{ 14 | message.channel.send(new MessageEmbed() 15 | .setColor(ee.color) 16 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 17 | .setTitle(`:white_check_mark: **${client.user.username}** is since:\n ${duration(client.uptime)} online`) 18 | ); 19 | } catch (e) { 20 | console.log(String(e.stack).bgRed) 21 | return message.channel.send(new MessageEmbed() 22 | .setColor(ee.wrongcolor) 23 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 24 | .setTitle(`❌ ERROR | An error occurred`) 25 | .setDescription(`\`\`\`${e.stack}\`\`\``) 26 | ); 27 | } 28 | } 29 | } 30 | /** 31 | * @INFO 32 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 33 | * @INFO 34 | * Work for Milrato Development | https://milrato.eu 35 | * @INFO 36 | * Please mention Him / Milrato Development, when using this Code! 37 | * @INFO 38 | */ 39 | -------------------------------------------------------------------------------- /bots/jointocreate/commands/Setup/addchannel.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const fs = require("fs") 5 | module.exports = { 6 | name: "addchannel", 7 | category: "Setup", 8 | aliases: ["addch"], 9 | cooldown: 2, 10 | usage: "addchannel <ID>", 11 | description: "Adds a Channel, which should be used as an Setup | Source for Join to Creates!", 12 | run: async (client, message, args, user, text, prefix) => { 13 | try{ 14 | if(!args[0]) 15 | return message.channel.send(new MessageEmbed() 16 | .setColor(ee.wrongcolor) 17 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 18 | .setTitle(`❌ ERROR | Please add a Channel ID!`) 19 | ); 20 | let channel = message.guild.channels.cache.get(args[0]) 21 | if(!channel) 22 | return message.channel.send(new MessageEmbed() 23 | .setColor(ee.wrongcolor) 24 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 25 | .setTitle(`❌ ERROR | Cannot find your Channel by ID!`) 26 | ); 27 | if(channel.type !== "voice") 28 | return message.channel.send(new MessageEmbed() 29 | .setColor(ee.wrongcolor) 30 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 31 | .setTitle(`❌ ERROR | Your granted Channel is not a Voice Channel`) 32 | ); 33 | if(config.guild.length === 18 && config.guild !== message.guild.id) 34 | return message.channel.send(new MessageEmbed() 35 | .setColor(ee.wrongcolor) 36 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 37 | .setTitle(`❌ ERROR | You are not allowed to add a Channel cause you are not in the right guild!`) 38 | ); 39 | let oldconfig = config; 40 | oldconfig.guild = message.guild.id; 41 | oldconfig.channels.push(channel.id); 42 | fs.writeFile("./botconfig/config.json", JSON.stringify(oldconfig, null, 3), async (e) => { 43 | if (e) { 44 | console.log(String(e.stack).red); 45 | return message.channel.send(new MessageEmbed() 46 | .setFooter(ee.footertext,ee.footericon) 47 | .setColor(ee.wrongcolor) 48 | .setTitle("❌ ERROR Writing the File") 49 | .setDescription(`\`\`\`${e.stack}\`\`\``) 50 | ) 51 | } 52 | return message.channel.send(new MessageEmbed() 53 | .setColor(ee.color) 54 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 55 | .setTitle(`✅ Success | You can now use: \`${channel.name}\` as a Join to Create Channel!`) 56 | ) 57 | }); 58 | } catch (e) { 59 | console.log(String(e.stack).bgRed) 60 | return message.channel.send(new MessageEmbed() 61 | .setColor(ee.wrongcolor) 62 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 63 | .setTitle(`❌ ERROR | An error occurred`) 64 | .setDescription(`\`\`\`${e.stack}\`\`\``) 65 | ); 66 | } 67 | } 68 | } 69 | /** 70 | * @INFO 71 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 72 | * @INFO 73 | * Work for Milrato Development | https://milrato.eu 74 | * @INFO 75 | * Please mention Him / Milrato Development, when using this Code! 76 | * @INFO 77 | */ 78 | -------------------------------------------------------------------------------- /bots/jointocreate/commands/Setup/removechannel.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const fs = require("fs") 5 | module.exports = { 6 | name: "removechannel", 7 | category: "Setup", 8 | aliases: ["removech"], 9 | cooldown: 2, 10 | usage: "removechannel <ID>", 11 | description: "Removes a Channel, which should be not used as an Setup anymore | Source for Join to Creates!", 12 | run: async (client, message, args, user, text, prefix) => { 13 | try{ 14 | if(!args[0]) 15 | return message.channel.send(new MessageEmbed() 16 | .setColor(ee.wrongcolor) 17 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 18 | .setTitle(`❌ ERROR | Please add a Channel ID!`) 19 | ); 20 | let channel = message.guild.channels.cache.get(args[0]) 21 | if(!channel) 22 | return message.channel.send(new MessageEmbed() 23 | .setColor(ee.wrongcolor) 24 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 25 | .setTitle(`❌ ERROR | Cannot find your Channel by ID!`) 26 | ); 27 | if(channel.type !== "voice") 28 | return message.channel.send(new MessageEmbed() 29 | .setColor(ee.wrongcolor) 30 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 31 | .setTitle(`❌ ERROR | Your granted Channel is not a Voice Channel`) 32 | ); 33 | if(config.guild.length === 18 && config.guild !== message.guild.id) 34 | return message.channel.send(new MessageEmbed() 35 | .setColor(ee.wrongcolor) 36 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 37 | .setTitle(`❌ ERROR | You are not allowed to add a Channel cause you are not in the right guild!`) 38 | ); 39 | 40 | let oldconfig = config; 41 | oldconfig.guild = message.guild.id; 42 | const index = oldconfig.channels.indexOf(channel.id); 43 | if (index > -1) { 44 | oldconfig.channels.splice(index, 1); 45 | } 46 | else { 47 | return message.channel.send(new MessageEmbed() 48 | .setColor(ee.wrongcolor) 49 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 50 | .setTitle(`❌ ERROR | Your granted ID is not saved so I can't remove it!`) 51 | ); 52 | } 53 | 54 | fs.writeFile("./botconfig/config.json", JSON.stringify(oldconfig, null, 3), async (e) => { 55 | if (e) { 56 | console.log(String(e.stack).red); 57 | return message.channel.send(new MessageEmbed() 58 | .setFooter(ee.footertext,ee.footericon) 59 | .setColor(ee.wrongcolor) 60 | .setTitle("❌ ERROR Writing the File") 61 | .setDescription(`\`\`\`${e.stack}\`\`\``) 62 | ) 63 | } 64 | return message.channel.send(new MessageEmbed() 65 | .setColor(ee.color) 66 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 67 | .setTitle(`✅ Success | Removed: \`${channel.name}\` from the Join to Create Channels!`) 68 | ) 69 | }); 70 | } catch (e) { 71 | console.log(String(e.stack).bgRed) 72 | return message.channel.send(new MessageEmbed() 73 | .setColor(ee.wrongcolor) 74 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 75 | .setTitle(`❌ ERROR | An error occurred`) 76 | .setDescription(`\`\`\`${e.stack}\`\`\``) 77 | ); 78 | } 79 | } 80 | } 81 | /** 82 | * @INFO 83 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 84 | * @INFO 85 | * Work for Milrato Development | https://milrato.eu 86 | * @INFO 87 | * Please mention Him / Milrato Development, when using this Code! 88 | * @INFO 89 | */ 90 | -------------------------------------------------------------------------------- /bots/jointocreate/events/client/disconnect.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.log(`You have been disconnected at ${new Date()}.`.red) 4 | } 5 | /** 6 | * @INFO 7 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 8 | * @INFO 9 | * Work for Milrato Development | https://milrato.eu 10 | * @INFO 11 | * Please mention Him / Milrato Development, when using this Code! 12 | * @INFO 13 | */ 14 | -------------------------------------------------------------------------------- /bots/jointocreate/events/client/error.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.error(); 4 | } 5 | /** 6 | * @INFO 7 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 8 | * @INFO 9 | * Work for Milrato Development | https://milrato.eu 10 | * @INFO 11 | * Please mention Him / Milrato Development, when using this Code! 12 | * @INFO 13 | */ 14 | -------------------------------------------------------------------------------- /bots/jointocreate/events/client/ready.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | const config = require("../../botconfig/config.json") 3 | module.exports = client => { 4 | try{ 5 | const stringlength = 69; 6 | console.log("\n") 7 | console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.brightGreen) 8 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 9 | console.log(` ┃ `.bold.brightGreen + `Discord Bot is online!`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-`Discord Bot is online!`.length)+ "┃".bold.brightGreen) 10 | console.log(` ┃ `.bold.brightGreen + ` /--/ ${client.user.tag} /--/ `.bold.brightGreen+ " ".repeat(-1+stringlength-` ┃ `.length-` /--/ ${client.user.tag} /--/ `.length)+ "┃".bold.brightGreen) 11 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 12 | console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.brightGreen) 13 | }catch{ /* */ } 14 | 15 | try{ 16 | client.user.setActivity(client.user.username, { type: "PLAYING" }); 17 | }catch (e) { 18 | console.log(String(e.stack).red); 19 | } 20 | //Change status each 10 minutes 21 | setTimeout(()=>{ 22 | try{ 23 | client.user.setActivity(client.user.username, { type: "PLAYING" }); 24 | }catch (e) { 25 | console.log(String(e.stack).red); 26 | } 27 | }, 10*60*1000) 28 | } 29 | /** 30 | * @INFO 31 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 32 | * @INFO 33 | * Work for Milrato Development | https://milrato.eu 34 | * @INFO 35 | * Please mention Him / Milrato Development, when using this Code! 36 | * @INFO 37 | */ 38 | -------------------------------------------------------------------------------- /bots/jointocreate/events/client/reconnecting.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.log(`Reconnceting at ${new Date()}.`.bgYellow.black) 4 | } 5 | 6 | /** 7 | * @INFO 8 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 9 | * @INFO 10 | * Work for Milrato Development | https://milrato.eu 11 | * @INFO 12 | * Please mention Him / Milrato Development, when using this Code! 13 | * @INFO 14 | */ 15 | -------------------------------------------------------------------------------- /bots/jointocreate/events/client/warn.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.warn(); 4 | } 5 | /** 6 | * @INFO 7 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 8 | * @INFO 9 | * Work for Milrato Development | https://milrato.eu 10 | * @INFO 11 | * Please mention Him / Milrato Development, when using this Code! 12 | * @INFO 13 | */ 14 | -------------------------------------------------------------------------------- /bots/jointocreate/handlers/command.js: -------------------------------------------------------------------------------- 1 | const { readdirSync } = require("fs"); 2 | const ascii = require("ascii-table"); 3 | let table = new ascii("Commands"); 4 | table.setHeading("Command", "Load status"); 5 | console.log("Welcome to SERVICE HANDLER /--/ By https://milrato.eu /--/ Discord: Tomato#6966".yellow); 6 | module.exports = (client) => { 7 | try{ 8 | readdirSync("./commands/").forEach((dir) => { 9 | const commands = readdirSync(`./commands/${dir}/`).filter((file) => file.endsWith(".js")); 10 | for (let file of commands) { 11 | let pull = require(`../commands/${dir}/${file}`); 12 | if (pull.name) { 13 | client.commands.set(pull.name, pull); 14 | table.addRow(file, "Ready"); 15 | } else { 16 | table.addRow(file, `error->missing a help.name,or help.name is not a string.`); 17 | continue; 18 | } 19 | if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach((alias) => client.aliases.set(alias, pull.name)); 20 | } 21 | }); 22 | console.log(table.toString().cyan); 23 | }catch (e){ 24 | console.log(String(e.stack).bgRed) 25 | } 26 | }; 27 | /** 28 | * @INFO 29 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 30 | * @INFO 31 | * Work for Milrato Development | https://milrato.eu 32 | * @INFO 33 | * Please mention Him / Milrato Development, when using this Code! 34 | * @INFO 35 | */ 36 | -------------------------------------------------------------------------------- /bots/jointocreate/handlers/events.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const ascii = require("ascii-table"); 3 | let table = new ascii("Events"); 4 | table.setHeading("Events", "Load status"); 5 | const allevents = []; 6 | module.exports = async (client) => { 7 | try{ 8 | const load_dir = (dir) => { 9 | const event_files = fs.readdirSync(`./events/${dir}`).filter((file) => file.endsWith(".js")); 10 | for (const file of event_files){ 11 | const event = require(`../events/${dir}/${file}`) 12 | let eventName = file.split(".")[0]; 13 | allevents.push(eventName); 14 | client.on(eventName, event.bind(null, client)); 15 | } 16 | } 17 | await ["client", "guild"].forEach(e=>load_dir(e)); 18 | for (let i = 0; i < allevents.length; i++) { 19 | try { 20 | table.addRow(allevents[i], "Ready"); 21 | } catch (e) { 22 | console.log(String(e.stack).red); 23 | } 24 | } 25 | console.log(table.toString().cyan); 26 | try{ 27 | const stringlength = 69; 28 | console.log("\n") 29 | console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.brightGreen) 30 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 31 | console.log(` ┃ `.bold.brightGreen + `Welcome to SERVICE HANDLER!`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-`Welcome to SERVICE HANDLER!`.length)+ "┃".bold.brightGreen) 32 | console.log(` ┃ `.bold.brightGreen + ` /-/ By https://milrato.eu /-/`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-` /-/ By https://milrato.eu /-/`.length)+ "┃".bold.brightGreen) 33 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 34 | console.log(` ┃ `.bold.brightGreen + ` /-/ Discord: Tomato#6966 /-/`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-` /-/ By Discord: Tomato#6966 /-/`.length)+ " ┃".bold.brightGreen) 35 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 36 | console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.brightGreen) 37 | }catch{ /* */ } 38 | try{ 39 | const stringlength2 = 69; 40 | console.log("\n") 41 | console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.yellow) 42 | console.log(` ┃ `.bold.yellow + " ".repeat(-1+stringlength2-` ┃ `.length)+ "┃".bold.yellow) 43 | console.log(` ┃ `.bold.yellow + `Logging into the BOT...`.bold.yellow + " ".repeat(-1+stringlength2-` ┃ `.length-`Logging into the BOT...`.length)+ "┃".bold.yellow) 44 | console.log(` ┃ `.bold.yellow + " ".repeat(-1+stringlength2-` ┃ `.length)+ "┃".bold.yellow) 45 | console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.yellow) 46 | }catch{ /* */ } 47 | }catch (e){ 48 | console.log(String(e.stack).bgRed) 49 | } 50 | }; 51 | /** 52 | * @INFO 53 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 54 | * @INFO 55 | * Work for Milrato Development | https://milrato.eu 56 | * @INFO 57 | * Please mention Him / Milrato Development, when using this Code! 58 | * @INFO 59 | */ 60 | -------------------------------------------------------------------------------- /bots/jointocreate/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @INFO 3 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 4 | * @INFO 5 | * Work for Milrato Development | https://milrato.eu 6 | * @INFO 7 | * Please mention Him / Milrato Development, when using this Code! 8 | * @INFO 9 | */ 10 | //Importing all needed Commands 11 | const Discord = require("discord.js"); //this is the official discord.js wrapper for the Discord Api, which we use! 12 | const colors = require("colors"); //this Package is used, to change the colors of our Console! (optional and doesnt effect performance) 13 | const fs = require("fs"); //this package is for reading files and getting their inputs 14 | //Creating the Discord.js Client for This Bot with some default settings ;) and with partials, so you can fetch OLD messages 15 | const client = new Discord.Client({ 16 | messageCacheLifetime: 60, 17 | fetchAllMembers: false, 18 | messageCacheMaxSize: 10, 19 | restTimeOffset: 0, 20 | restWsBridgetimeout: 100, 21 | disableEveryone: true, 22 | partials: ['MESSAGE', 'CHANNEL', 'REACTION'] 23 | }); 24 | //Client variables to use everywhere 25 | client.commands = new Discord.Collection(); //an collection (like a digital map(database)) for all your commands 26 | client.aliases = new Discord.Collection(); //an collection for all your command-aliases 27 | client.categories = fs.readdirSync("./commands/"); //categories 28 | client.cooldowns = new Discord.Collection(); //an collection for cooldown commands of each user 29 | 30 | //Loading files, with the client variable like Command Handler, Event Handler, ... 31 | ["command", "events"].forEach(handler => { 32 | require(`./handlers/${handler}`)(client); 33 | }); 34 | //Loading files, with the client variable like Command Handler, Event Handler, ... 35 | ["jointocreate"].forEach(handler => { 36 | require(`./modules/${handler}`)(client); 37 | }); 38 | //login into the bot 39 | client.login(require("./botconfig/config.json").token); 40 | /** 41 | * @INFO 42 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 43 | * @INFO 44 | * Work for Milrato Development | https://milrato.eu 45 | * @INFO 46 | * Please mention Him / Milrato Development, when using this Code! 47 | * @INFO 48 | */ 49 | -------------------------------------------------------------------------------- /bots/jointocreate/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "discord-js-handler-template", 3 | "version": "1.0.0", 4 | "description": "Discord.js Command and Event Handler Template with example Command usages! For Questions: https://discord.gg/fS6qBSm", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node index.js" 9 | }, 10 | "author": "Tomato#6966", 11 | "license": "ISC", 12 | "dependencies": { 13 | "ascii-table": "0.0.9", 14 | "discord.js": "^12.5.1" 15 | }, 16 | "devDependencies": { 17 | "ascii-table": "0.0.9", 18 | "colors": "^1.4.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /bots/musicbot/README.md: -------------------------------------------------------------------------------- 1 | # Discord Music Bot 2 | 3 | In This tutorial Series I am explaining you how to do an advanced Music Bot in Discord, using the Distube Package 4 | 5 | It is fast and very good! 6 | 7 | First I will explain in several videos how to do specific Commands from skip to forward and lyrics! 8 | 9 | After that i will cover some more backend stuff, like adding reactions, filters, how to use cookies, spotify playlist supports etc. etc. 10 | 11 | ## Installation | How to use the Bot 12 | 13 | **1.** Install [node.js v12+](https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode) or higher 14 | 15 | **2.** Download this repo and unzip it | or git clone it 16 | 17 | **3.** Install all of the packages with **`npm install`** 18 | 19 | **4** Fill in the parameters, RIGHT in `./botconfig/config.json`! 20 | 21 | **5.** start the bot with **`node index.js`** 22 | 23 | #### **NOTE:** 24 | 25 | *If you are having errors/problems with starting delete the package.json file and do, before you install the packages `npm init`* 26 | 27 | *MAKE SURE THAT THE BOT HAS ADMIN* 28 | 29 | # TUTORIAL LISTS 30 | 31 | - **1. BASICS - play - skip - stop ...** 32 | 33 | - Tutorial Video: [Click Here](https://youtu.be/tF2hYHW3H4w) 34 | 35 | - Source Code: [Click Here]() 36 | 37 | - **2. Handeling the Commands** 38 | 39 | # SUPPORT ME 40 | BY [INVITING MY PUBLIC MUSIC BOT 24/7 UPTIME!](https://discord.com/api/oauth2/authorize?client_id=742672021422342165&permissions=8&scope=bot) 41 | 42 | This repository only exists, because of this DISCORD BOT, so make sure to invite it, so that i can keep this Repo up to date ;) 43 | 44 | ## BEST HOSTING | Bittmax.de 45 | BITTMAX Quality is their solution. 46 | Bittmax is our first and probably most important sponsor! 47 | 48 | **What they are offering:** 49 | > Quality LXC & KVM (Root) Server 50 | > Minecraft Hosting, as well as BungeeCord Network Hosting support 51 | > Cheap and fast Domains 52 | > WEBHOSTING 53 | > DISCORD, TEAMSPEAK, Setups / Music Bots 54 | > GAME SERVER, Rust, Gary's Mod, .. 55 | 56 | **Discord Server:** 57 | [https://discord.gg/GgjJZCyYKD](https://discord.gg/GgjJZCyYKD) 58 | 59 | **Website:** 60 | [https://bittmax.de/](https://bittmax.de/]) 61 | 62 | GET **5%** OFF EVERYTHING FOR EVER! 63 | Code: **`x10`** 64 | 65 | ## MC-Host24.de 66 | MC-Host24.de is selling the Best Digital Hosting Services ever! 67 | Like For games.. 68 | 69 | **What they are offering:** 70 | > Quality LXC & KVM (Root) Server 71 | > WORLDS BEST Minecraft Hosting, 72 | > Cheap and fast Domains 73 | > WEBHOSTING 74 | > DISCORD, TEAMSPEAK, Setups / Music Bots 75 | > GAME SERVER, Rust, Gary's Mod, .. 76 | 77 | **Discord Server:** 78 | [https://discord.com/invite/4dGuGXK4A4](https://discord.com/invite/4dGuGXK4A4) 79 | 80 | **Website:** 81 | [mc-host24.de](https://mc-host24.de/user/affiliate/3121]) 82 | 83 | # DISCORD BOTS 84 | 85 | You can always Support me by inviting one of my **own Discord Bots** 86 | 87 | [![Musicium Music Bot](https://cdn.discordapp.com/attachments/742446682381221938/770055673965707264/test1.png)](https://musicium.eu) 88 | [![Milrato Multi Bot](https://cdn.discordapp.com/attachments/742446682381221938/770056826724679680/test1.png)](https://milrato.eu) 89 | 90 | [OTHER BOTS](https://bots.musicium.eu) 91 | 92 | [| fork my repository |](https://github.com/user/repository/fork) 93 | [watch this repo |](https://github.com/user/repository/subscription) 94 | [create issue |](https://github.com/user/repository/issues/new) 95 | 96 | *Both bots are still in Development, and will always be in development, this means always uptodate and always online and always improving!* 97 | -------------------------------------------------------------------------------- /bots/musicbot/botconfig/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "token": "", 3 | "prefix": "", 4 | "owner": "", 5 | "music_settings": { 6 | "searchSongs": false, 7 | "emitNewSongOnly": false, 8 | "highWaterMark": 67108864, 9 | "leaveOnEmpty": false, 10 | "leaveOnFinish": false, 11 | "leaveOnStop": true, 12 | "youtubeDL": true, 13 | "updateYouTubeDL": true, 14 | "youtube_cookie": "Set your Cookie here, to prevent 429! TUTORIAL https://youtu.be/qymuvhBetnM" 15 | } 16 | } -------------------------------------------------------------------------------- /bots/musicbot/botconfig/embed.json: -------------------------------------------------------------------------------- 1 | { 2 | "color": "#3498db", 3 | "wrongcolor": "#e01e01" 4 | } 5 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Administration/embed.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "embed", 6 | category: "Administration", 7 | aliases: ["say-embed"], 8 | cooldown: 2, 9 | useage: "embed <TITLE> ++ <DESCRIPTION>", 10 | description: "Resends a message from u as an Embed", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | if(!args[0]) 14 | return message.channel.send(new MessageEmbed() 15 | .setColor(ee.wrongcolor) 16 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 17 | .setTitle(`❌ ERROR | You didn't provided a Title, nor a Description`) 18 | .setDescription(`Usage: \`${prefix}embed <TITLE> ++ <DESCRIPTION>\``) 19 | ); 20 | let userargs = args.join(" ").split("++"); 21 | let title = userargs[0]; 22 | let desc = userargs.slice(1).join(" ") 23 | message.channel.send(new MessageEmbed() 24 | .setColor(ee.color) 25 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 26 | .setTitle(title ? title : "") 27 | .setDescription(desc ? desc : "") 28 | ) 29 | } catch (e) { 30 | console.log(String(e.stack).bgRed) 31 | return message.channel.send(new MessageEmbed() 32 | .setColor(ee.wrongcolor) 33 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 34 | .setTitle(`❌ ERROR | An error occurred`) 35 | .setDescription(`\`\`\`${e.stack}\`\`\``) 36 | ); 37 | } 38 | } 39 | } 40 | /** 41 | * @INFO 42 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 43 | * @INFO 44 | * Work for Milrato Development | https://milrato.eu 45 | * @INFO 46 | * Please mention Him / Milrato Development, when using this Code! 47 | * @INFO 48 | */ 49 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Administration/say.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "say", 6 | category: "Administration", 7 | aliases: [""], 8 | cooldown: 2, 9 | useage: "say <TEXT>", 10 | description: "Resends your Text", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | if(!args[0]) 14 | return message.channel.send(new MessageEmbed() 15 | .setColor(ee.wrongcolor) 16 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 17 | .setTitle(`❌ ERROR | You didn't provided a Text`) 18 | .setDescription(`Usage: \`${prefix}say <Your Text>\``) 19 | ); 20 | message.channel.send(text); 21 | } catch (e) { 22 | console.log(String(e.stack).bgRed) 23 | return message.channel.send(new MessageEmbed() 24 | .setColor(ee.wrongcolor) 25 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 26 | .setTitle(`❌ ERROR | An error occurred`) 27 | .setDescription(`\`\`\`${e.stack}\`\`\``) 28 | ); 29 | } 30 | } 31 | } 32 | /** 33 | * @INFO 34 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 35 | * @INFO 36 | * Work for Milrato Development | https://milrato.eu 37 | * @INFO 38 | * Please mention Him / Milrato Development, when using this Code! 39 | * @INFO 40 | */ 41 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Information/help.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "help", 6 | category: "Information", 7 | aliases: ["h", "commandinfo", "cmds", "cmd"], 8 | cooldown: 4, 9 | useage: "help [Command]", 10 | description: "Returns all Commmands, or one specific command", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | if (args[0]) { 14 | const embed = new MessageEmbed(); 15 | const cmd = client.commands.get(args[0].toLowerCase()) || client.commands.get(client.aliases.get(args[0].toLowerCase())); 16 | if (!cmd) { 17 | return message.channel.send(embed.setColor(ee.wrongcolor).setDescription(`No Information found for command **${args[0].toLowerCase()}**`)); 18 | } 19 | if (cmd.name) embed.addField("**Command name**", `\`${cmd.name}\``); 20 | if (cmd.name) embed.setTitle(`Detailed Information about:\`${cmd.name}\``); 21 | if (cmd.description) embed.addField("**Description**", `\`${cmd.description}\``); 22 | if (cmd.aliases) embed.addField("**Aliases**", `\`${cmd.aliases.map((a) => `${a}`).join("`, `")}\``); 23 | if (cmd.cooldown) embed.addField("**Cooldown**", `\`${cmd.cooldown} Seconds\``); 24 | else embed.addField("**Cooldown**", `\`1 Second\``); 25 | if (cmd.usage) { 26 | embed.addField("**Usage**", `\`${config.prefix}${cmd.usage}\``); 27 | embed.setFooter("Syntax: <> = required, [] = optional"); 28 | } 29 | if (cmd.useage) { 30 | embed.addField("**Useage**", `\`${config.prefix}${cmd.useage}\``); 31 | embed.setFooter("Syntax: <> = required, [] = optional"); 32 | } 33 | return message.channel.send(embed.setColor(ee.color)); 34 | } else { 35 | const embed = new MessageEmbed() 36 | .setColor(ee.color) 37 | .setThumbnail(client.user.displayAvatarURL()) 38 | .setTitle("HELP MENU 🔰 Commands") 39 | .setFooter(`To see command descriptions and inforamtion, type: ${config.prefix}help [CMD NAME]`, client.user.displayAvatarURL()); 40 | const commands = (category) => { 41 | return client.commands.filter((cmd) => cmd.category === category).map((cmd) => `\`${cmd.name}\``); 42 | }; 43 | try { 44 | for (let i = 0; i < client.categories.length; i += 1) { 45 | const current = client.categories[i]; 46 | const items = commands(current); 47 | const n = 3; 48 | const result = [[], [], []]; 49 | const wordsPerLine = Math.ceil(items.length / 3); 50 | for (let line = 0; line < n; line++) { 51 | for (let i = 0; i < wordsPerLine; i++) { 52 | const value = items[i + line * wordsPerLine]; 53 | if (!value) continue; 54 | result[line].push(value); 55 | } 56 | } 57 | embed.addField(`**${current.toUpperCase()} [${items.length}]**`, `> ${result[0].join("\n> ")}`, true); 58 | embed.addField(`\u200b`, `${result[1].join("\n") ? result[1].join("\n") : "\u200b"}`, true); 59 | embed.addField(`\u200b`, `${result[2].join("\n") ? result[2].join("\n") : "\u200b"}`, true); 60 | } 61 | } catch (e) { 62 | console.log(String(e.stack).red); 63 | } 64 | message.channel.send(embed); 65 | } 66 | } catch (e) { 67 | console.log(String(e.stack).bgRed) 68 | return message.channel.send(new MessageEmbed() 69 | .setColor(ee.wrongcolor) 70 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 71 | .setTitle(`❌ ERROR | An error occurred`) 72 | .setDescription(`\`\`\`${e.stack}\`\`\``) 73 | ); 74 | } 75 | } 76 | } 77 | /** 78 | * @INFO 79 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 80 | * @INFO 81 | * Work for Milrato Development | https://milrato.eu 82 | * @INFO 83 | * Please mention Him / Milrato Development, when using this Code! 84 | * @INFO 85 | */ 86 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Information/ping.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "ping", 6 | category: "Information", 7 | aliases: ["latency"], 8 | cooldown: 2, 9 | useage: "ping", 10 | description: "Gives you information on how fast the Bot can respond to you", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | message.channel.send(new MessageEmbed() 14 | .setColor(ee.color) 15 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 16 | .setTitle(`🏓 Pinging....`) 17 | ).then(msg=>{ 18 | msg.edit(new MessageEmbed() 19 | .setColor(ee.color) 20 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 21 | .setTitle(`🏓 Ping is \`${Math.round(client.ws.ping)}ms\``) 22 | ); 23 | }) 24 | } catch (e) { 25 | console.log(String(e.stack).bgRed) 26 | return message.channel.send(new MessageEmbed() 27 | .setColor(ee.wrongcolor) 28 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 29 | .setTitle(`❌ ERROR | An error occurred`) 30 | .setDescription(`\`\`\`${e.stack}\`\`\``) 31 | ); 32 | } 33 | } 34 | } 35 | /** 36 | * @INFO 37 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 38 | * @INFO 39 | * Work for Milrato Development | https://milrato.eu 40 | * @INFO 41 | * Please mention Him / Milrato Development, when using this Code! 42 | * @INFO 43 | */ 44 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Information/uptime.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const { duration } = require("../../handlers/functions") 5 | module.exports = { 6 | name: "uptime", 7 | category: "Information", 8 | aliases: [""], 9 | cooldown: 10, 10 | useage: "uptime", 11 | description: "Returns the duration on how long the Bot is online", 12 | run: async (client, message, args, user, text, prefix) => { 13 | try{ 14 | message.channel.send(new MessageEmbed() 15 | .setColor(ee.color) 16 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 17 | .setTitle(`:white_check_mark: **${client.user.username}** is since:\n ${duration(client.uptime)} online`) 18 | ); 19 | } catch (e) { 20 | console.log(String(e.stack).bgRed) 21 | return message.channel.send(new MessageEmbed() 22 | .setColor(ee.wrongcolor) 23 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 24 | .setTitle(`❌ ERROR | An error occurred`) 25 | .setDescription(`\`\`\`${e.stack}\`\`\``) 26 | ); 27 | } 28 | } 29 | } 30 | /** 31 | * @INFO 32 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 33 | * @INFO 34 | * Work for Milrato Development | https://milrato.eu 35 | * @INFO 36 | * Please mention Him / Milrato Development, when using this Code! 37 | * @INFO 38 | */ 39 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Music/autoplay.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const { format } = require("../../handlers/functions") 5 | module.exports = { 6 | name: "autoplay", 7 | category: "Music", 8 | aliases: ["ap"], 9 | cooldown: 4, 10 | useage: "autoplay", 11 | description: "Toggles Autoplay", 12 | run: async (client, message, args, cmduser, text, prefix) => { 13 | try{ 14 | const { channel } = message.member.voice; // { message: { member: { voice: { channel: { name: "Allgemein", members: [{user: {"username"}, {user: {"username"}] }}}}} 15 | if(!channel) 16 | return message.channel.send(new MessageEmbed() 17 | .setColor(ee.wrongcolor) 18 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 19 | .setTitle(`❌ ERROR | Please join a Channel first`) 20 | ); 21 | if(!client.distube.getQueue(message)) 22 | return message.channel.send(new MessageEmbed() 23 | .setColor(ee.wrongcolor) 24 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 25 | .setTitle(`❌ ERROR | I am not playing Something`) 26 | .setDescription(`The Queue is empty`) 27 | ); 28 | if(client.distube.getQueue(message) && channel.id !== message.guild.me.voice.channel.id) 29 | return message.channel.send(new MessageEmbed() 30 | .setColor(ee.wrongcolor) 31 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 32 | .setTitle(`❌ ERROR | Please join **my** Channel first`) 33 | .setDescription(`Channelname: \`${message.guild.me.voice.channel.name}\``) 34 | ); 35 | message.channel.send(new MessageEmbed() 36 | .setColor(ee.color) 37 | .setFooter(client.user.username + " | powered by: milrato.eu",client.user.displayAvatarURL()) 38 | .setTitle(`✅ Successfully toggled Autoplay! It's now: ${client.distube.toggleAutoplay(message) ? "ON" : "OFF"}`) 39 | ).then(msg=>msg.delete({timeout: 4000}).catch(e=>console.log(e.message))) 40 | } catch (e) { 41 | console.log(String(e.stack).bgRed) 42 | return message.channel.send(new MessageEmbed() 43 | .setColor(ee.wrongcolor) 44 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 45 | .setTitle(`❌ ERROR | An error occurred`) 46 | .setDescription(`\`\`\`${e.stack}\`\`\``) 47 | ); 48 | } 49 | } 50 | } 51 | /** 52 | * @INFO 53 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 54 | * @INFO 55 | * Work for Milrato Development | https://milrato.eu 56 | * @INFO 57 | * Please mention Him / Milrato Development, when using this Code! 58 | * @INFO 59 | */ 60 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Music/filter.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const filters = [ 5 | "clear", 6 | "lowbass", 7 | "bassboost", 8 | "purebass", 9 | "8D", 10 | "vaporwave", 11 | "nightcore", 12 | "phaser", 13 | "tremolo", 14 | "vibrato", 15 | "reverse", 16 | "treble", 17 | "normalizer", 18 | "surrounding", 19 | "pulsator", 20 | "subboost", 21 | "karaoke", 22 | "flanger", 23 | "gate", 24 | "haas", 25 | "mcompand" 26 | ] 27 | module.exports = { 28 | name: "filter", 29 | category: "Music", 30 | aliases: ["ap"], 31 | cooldown: 4, 32 | useage: "filter <Filtertype>", 33 | description: "Changes the audio Filter", 34 | run: async (client, message, args, cmduser, text, prefix) => { 35 | try{ 36 | const { channel } = message.member.voice; // { message: { member: { voice: { channel: { name: "Allgemein", members: [{user: {"username"}, {user: {"username"}] }}}}} 37 | if(!channel) 38 | return message.channel.send(new MessageEmbed() 39 | .setColor(ee.wrongcolor) 40 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 41 | .setTitle(`❌ ERROR | Please join a Channel first`) 42 | ); 43 | if(!client.distube.getQueue(message)) 44 | return message.channel.send(new MessageEmbed() 45 | .setColor(ee.wrongcolor) 46 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 47 | .setTitle(`❌ ERROR | I am not playing Something`) 48 | .setDescription(`The Queue is empty`) 49 | ); 50 | if(client.distube.getQueue(message) && channel.id !== message.guild.me.voice.channel.id) 51 | return message.channel.send(new MessageEmbed() 52 | .setColor(ee.wrongcolor) 53 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 54 | .setTitle(`❌ ERROR | Please join **my** Channel first`) 55 | .setDescription(`Channelname: \`${message.guild.me.voice.channel.name}\``) 56 | ); 57 | if(!args[0]) 58 | return message.channel.send(new MessageEmbed() 59 | .setColor(ee.wrongcolor) 60 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 61 | .setTitle(`❌ ERROR | Please add a Filtertype`) 62 | .setDescription(`Usage: \`${prefix}filter <Filtertype>\`\nExample: \`${prefix}filter bassboost\``) 63 | ); 64 | if(!filters.join(" ").toLowerCase().split(" ").includes(args[0].toLowerCase())) 65 | return message.channel.send(new MessageEmbed() 66 | .setColor(ee.wrongcolor) 67 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 68 | .setTitle(`❌ ERROR | Not a valid Filtertype`) 69 | .setDescription(`Usage: \`${prefix}filter <Filtertype>\`\nFilter types:\n> \`${filters.join("`, `")}\``.substr(0, 2048)) 70 | ); 71 | client.distube.setFilter(message, args[0]); 72 | 73 | message.channel.send(new MessageEmbed() 74 | .setColor(ee.color) 75 | .setFooter(client.user.username + " | powered by: milrato.eu",client.user.displayAvatarURL()) 76 | .setTitle(`✅ Successfully set Filter to: \`${args[0]}\``) 77 | ).then(msg=>msg.delete({timeout: 4000}).catch(e=>console.log(e.message))) 78 | } catch (e) { 79 | console.log(String(e.stack).bgRed) 80 | return message.channel.send(new MessageEmbed() 81 | .setColor(ee.wrongcolor) 82 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 83 | .setTitle(`❌ ERROR | An error occurred`) 84 | .setDescription(`\`\`\`${e.stack}\`\`\``) 85 | ); 86 | } 87 | } 88 | } 89 | /** 90 | * @INFO 91 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 92 | * @INFO 93 | * Work for Milrato Development | https://milrato.eu 94 | * @INFO 95 | * Please mention Him / Milrato Development, when using this Code! 96 | * @INFO 97 | */ 98 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Music/forward.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const { format } = require("../../handlers/functions") 5 | module.exports = { 6 | name: "forward", 7 | category: "Music", 8 | aliases: ["fwd"], 9 | cooldown: 4, 10 | useage: "forward <Time in Seconds>", 11 | description: "Forwards for a specific amount of Time", 12 | run: async (client, message, args, cmduser, text, prefix) => { 13 | try{ 14 | const { channel } = message.member.voice; // { message: { member: { voice: { channel: { name: "Allgemein", members: [{user: {"username"}, {user: {"username"}] }}}}} 15 | if(!channel) 16 | return message.channel.send(new MessageEmbed() 17 | .setColor(ee.wrongcolor) 18 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 19 | .setTitle(`❌ ERROR | Please join a Channel first`) 20 | ); 21 | if(!client.distube.getQueue(message)) 22 | return message.channel.send(new MessageEmbed() 23 | .setColor(ee.wrongcolor) 24 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 25 | .setTitle(`❌ ERROR | I am not playing Something`) 26 | .setDescription(`The Queue is empty`) 27 | ); 28 | if(client.distube.getQueue(message) && channel.id !== message.guild.me.voice.channel.id) 29 | return message.channel.send(new MessageEmbed() 30 | .setColor(ee.wrongcolor) 31 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 32 | .setTitle(`❌ ERROR | Please join **my** Channel first`) 33 | .setDescription(`Channelname: \`${message.guild.me.voice.channel.name}\``) 34 | ); 35 | if(!args[0]) 36 | return message.channel.send(new MessageEmbed() 37 | .setColor(ee.wrongcolor) 38 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 39 | .setTitle(`❌ ERROR | You didn't provided a Time you want to seek to!`) 40 | .setDescription(`Usage: \`${prefix}seek 10\``) 41 | ) 42 | 43 | let queue = client.distube.getQueue(message); 44 | let seektime = queue.currentTime + Number(args[0]) * 1000; 45 | if(seektime < 0) 46 | seektime = queue.songs[0].duration * 1000; 47 | if(seektime >= queue.songs[0].duration * 1000) 48 | seektime = queue.songs[0].duration * 1000 - 1000; 49 | 50 | client.distube.seek(message, seektime); 51 | 52 | message.channel.send(new MessageEmbed() 53 | .setColor(ee.color) 54 | .setFooter(client.user.username + " | powered by: milrato.eu",client.user.displayAvatarURL()) 55 | .setTitle(`⏩ Forwarded for \`${args[0]} Seconds\` to: ${format(seektime)}`) 56 | ).then(msg=>msg.delete({timeout: 4000}).catch(e=>console.log(e.message))) 57 | } catch (e) { 58 | console.log(String(e.stack).bgRed) 59 | return message.channel.send(new MessageEmbed() 60 | .setColor(ee.wrongcolor) 61 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 62 | .setTitle(`❌ ERROR | An error occurred`) 63 | .setDescription(`\`\`\`${e.stack}\`\`\``) 64 | ); 65 | } 66 | } 67 | } 68 | /** 69 | * @INFO 70 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 71 | * @INFO 72 | * Work for Milrato Development | https://milrato.eu 73 | * @INFO 74 | * Please mention Him / Milrato Development, when using this Code! 75 | * @INFO 76 | */ 77 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Music/nowplaying.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const { format, createBar } = require("../../handlers/functions") 5 | module.exports = { 6 | name: "nowplaying", 7 | category: "Music", 8 | aliases: ["np"], 9 | cooldown: 4, 10 | useage: "nowplaying", 11 | description: "Shows current Track information", 12 | run: async (client, message, args, cmduser, text, prefix) => { 13 | try{ 14 | const { channel } = message.member.voice; // { message: { member: { voice: { channel: { name: "Allgemein", members: [{user: {"username"}, {user: {"username"}] }}}}} 15 | if(!channel) 16 | return message.channel.send(new MessageEmbed() 17 | .setColor(ee.wrongcolor) 18 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 19 | .setTitle(`❌ ERROR | Please join a Channel first`) 20 | ); 21 | if(!client.distube.getQueue(message)) 22 | return message.channel.send(new MessageEmbed() 23 | .setColor(ee.wrongcolor) 24 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 25 | .setTitle(`❌ ERROR | I am not playing Something`) 26 | .setDescription(`The Queue is empty`) 27 | ); 28 | if(client.distube.getQueue(message) && channel.id !== message.guild.me.voice.channel.id) 29 | return message.channel.send(new MessageEmbed() 30 | .setColor(ee.wrongcolor) 31 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 32 | .setTitle(`❌ ERROR | Please join **my** Channel first`) 33 | .setDescription(`Channelname: \`${message.guild.me.voice.channel.name}\``) 34 | ); 35 | let queue = client.distube.getQueue(message); 36 | let track = queue.songs[0]; 37 | console.log(track) 38 | message.channel.send(new MessageEmbed() 39 | .setColor(ee.color) 40 | .setFooter(client.user.username + " | powered by: milrato.eu",client.user.displayAvatarURL()) 41 | .setTitle(`Now playing :notes: ${track.name}`.substr(0, 256)) 42 | .setURL(track.url) 43 | .setThumbnail(track.thumbnail) 44 | .addField("Views", `▶ ${track.views}`,true) 45 | .addField("Dislikes", `:thumbsdown: ${track.dislikes}`,true) 46 | .addField("Likes", `:thumbsup: ${track.likes}`,true) 47 | .addField("Duration: ", createBar(queue.currentTime)) 48 | ).then(msg=>msg.delete({timeout: 4000}).catch(e=>console.log(e.message))) 49 | } catch (e) { 50 | console.log(String(e.stack).bgRed) 51 | return message.channel.send(new MessageEmbed() 52 | .setColor(ee.wrongcolor) 53 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 54 | .setTitle(`❌ ERROR | An error occurred`) 55 | .setDescription(`\`\`\`${e.stack}\`\`\``) 56 | ); 57 | } 58 | } 59 | } 60 | /** 61 | * @INFO 62 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 63 | * @INFO 64 | * Work for Milrato Development | https://milrato.eu 65 | * @INFO 66 | * Please mention Him / Milrato Development, when using this Code! 67 | * @INFO 68 | */ 69 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Music/pause.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "pause", 6 | category: "Music", 7 | aliases: [""], 8 | cooldown: 4, 9 | useage: "pause", 10 | description: "Pauses the Music", 11 | run: async (client, message, args, cmduser, text, prefix) => { 12 | try{ 13 | const { channel } = message.member.voice; // { message: { member: { voice: { channel: { name: "Allgemein", members: [{user: {"username"}, {user: {"username"}] }}}}} 14 | if(!channel) 15 | return message.channel.send(new MessageEmbed() 16 | .setColor(ee.wrongcolor) 17 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 18 | .setTitle(`❌ ERROR | Please join a Channel first`) 19 | ); 20 | if(!client.distube.getQueue(message)) 21 | return message.channel.send(new MessageEmbed() 22 | .setColor(ee.wrongcolor) 23 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 24 | .setTitle(`❌ ERROR | I am not playing Something`) 25 | .setDescription(`The Queue is empty`) 26 | ); 27 | if(client.distube.getQueue(message) && channel.id !== message.guild.me.voice.channel.id) 28 | return message.channel.send(new MessageEmbed() 29 | .setColor(ee.wrongcolor) 30 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 31 | .setTitle(`❌ ERROR | Please join **my** Channel first`) 32 | .setDescription(`Channelname: \`${message.guild.me.voice.channel.name}\``) 33 | ); 34 | if(client.distube.isPaused(message)) 35 | return message.channel.send(new MessageEmbed() 36 | .setColor(ee.wrongcolor) 37 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 38 | .setTitle(`❌ ERROR | Cannot pause the Song`) 39 | .setDescription(`It's already paused, so I cant!`) 40 | ); 41 | message.channel.send(new MessageEmbed() 42 | .setColor(ee.color) 43 | .setFooter(client.user.username + " | powered by: milrato.eu",client.user.displayAvatarURL()) 44 | .setTitle("⏸ Paused the Song") 45 | ).then(msg=>msg.delete({timeout: 4000}).catch(e=>console.log(e.message))) 46 | 47 | client.distube.pause(message); 48 | } catch (e) { 49 | console.log(String(e.stack).bgRed) 50 | return message.channel.send(new MessageEmbed() 51 | .setColor(ee.wrongcolor) 52 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 53 | .setTitle(`❌ ERROR | An error occurred`) 54 | .setDescription(`\`\`\`${e.stack}\`\`\``) 55 | ); 56 | } 57 | } 58 | } 59 | /** 60 | * @INFO 61 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 62 | * @INFO 63 | * Work for Milrato Development | https://milrato.eu 64 | * @INFO 65 | * Please mention Him / Milrato Development, when using this Code! 66 | * @INFO 67 | */ 68 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Music/play.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const { getTracks, getPreview } = require("spotify-url-info") 5 | module.exports = { 6 | name: "play", 7 | category: "Music", 8 | aliases: ["p", "playsong", "playtrack"], 9 | cooldown: 4, 10 | useage: "play <URL / TITLE>", 11 | description: "PLays a song from youtube", 12 | run: async (client, message, args, cmduser, text, prefix) => { 13 | try{ 14 | const { channel } = message.member.voice; // { message: { member: { voice: { channel: { name: "Allgemein", members: [{user: {"username"}, {user: {"username"}] }}}}} 15 | if(!channel) 16 | return message.channel.send(new MessageEmbed() 17 | .setColor(ee.wrongcolor) 18 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 19 | .setTitle(`❌ ERROR | Please join a Channel first`) 20 | ); 21 | if(client.distube.getQueue(message) && channel.id !== message.guild.me.voice.channel.id) 22 | return message.channel.send(new MessageEmbed() 23 | .setColor(ee.wrongcolor) 24 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 25 | .setTitle(`❌ ERROR | Please join **my** Channel first`) 26 | .setDescription(`Channelname: \`${message.guild.me.voice.channel.name}\``) 27 | ); 28 | if(!args[0]) 29 | return message.channel.send(new MessageEmbed() 30 | .setColor(ee.wrongcolor) 31 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 32 | .setTitle(`❌ ERROR | You didn't provided a Searchterm`) 33 | .setDescription(`Usage: \`${prefix}play <URL / TITLE>\``) 34 | ); 35 | message.channel.send(new MessageEmbed() 36 | .setColor(ee.color) 37 | .setFooter(client.user.username + " | powered by: milrato.eu",client.user.displayAvatarURL()) 38 | .setTitle("Searching Song") 39 | .setDescription(`\`\`\`fix\n${text}\n\`\`\``) 40 | ).then(msg=>msg.delete({timeout: 3000}).catch(e=>console.log(e.message))) 41 | //https://open.spotify.com/track/5nTtCOCds6I0PHMNtqelas 42 | if(args.join(" ").toLowerCase().includes("spotify") && args.join(" ").toLowerCase().includes("track")){ 43 | getPreview(args.join(" ")).then(result => { 44 | client.distube.play(message, result.title); 45 | }) 46 | } 47 | else if(args.join(" ").toLowerCase().includes("spotify") && args.join(" ").toLowerCase().includes("playlist")){ 48 | getTracks(args.join(" ")).then(result => { 49 | for(const song of result) 50 | client.distube.play(message, song.name); 51 | }) 52 | } 53 | else { 54 | client.distube.play(message, text); 55 | } 56 | } catch (e) { 57 | console.log(String(e.stack).bgRed) 58 | return message.channel.send(new MessageEmbed() 59 | .setColor(ee.wrongcolor) 60 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 61 | .setTitle(`❌ ERROR | An error occurred`) 62 | .setDescription(`\`\`\`${e.stack}\`\`\``) 63 | ); 64 | } 65 | } 66 | } 67 | /** 68 | * @INFO 69 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 70 | * @INFO 71 | * Work for Milrato Development | https://milrato.eu 72 | * @INFO 73 | * Please mention Him / Milrato Development, when using this Code! 74 | * @INFO 75 | */ 76 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Music/queue.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "queue", 6 | category: "Music", 7 | aliases: ["qu"], 8 | cooldown: 4, 9 | useage: "queue", 10 | description: "Shows the current queue", 11 | run: async (client, message, args, cmduser, text, prefix) => { 12 | try{ 13 | const { channel } = message.member.voice; // { message: { member: { voice: { channel: { name: "Allgemein", members: [{user: {"username"}, {user: {"username"}] }}}}} 14 | if(!channel) 15 | return message.channel.send(new MessageEmbed() 16 | .setColor(ee.wrongcolor) 17 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 18 | .setTitle(`❌ ERROR | Please join a Channel first`) 19 | ); 20 | if(!client.distube.getQueue(message)) 21 | return message.channel.send(new MessageEmbed() 22 | .setColor(ee.wrongcolor) 23 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 24 | .setTitle(`❌ ERROR | I am not playing Something`) 25 | .setDescription(`The Queue is empty`) 26 | ); 27 | if(client.distube.getQueue(message) && channel.id !== message.guild.me.voice.channel.id) 28 | return message.channel.send(new MessageEmbed() 29 | .setColor(ee.wrongcolor) 30 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 31 | .setTitle(`❌ ERROR | Please join **my** Channel first`) 32 | .setDescription(`Channelname: \`${message.guild.me.voice.channel.name}\``) 33 | ); 34 | let queue = client.distube.getQueue(message); 35 | if(!queue) 36 | return message.channel.send(new MessageEmbed() 37 | .setColor(ee.wrongcolor) 38 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 39 | .setTitle(`❌ ERROR | I am not playing Something`) 40 | .setDescription(`The Queue is empty`) 41 | ); 42 | 43 | let embed = new MessageEmbed() 44 | .setColor(ee.color) 45 | .setFooter(client.user.username + " | powered by: milrato.eu",client.user.displayAvatarURL()) 46 | .setTitle(`Queue for: ${message.guild.name}`) 47 | 48 | let counter = 0; 49 | for(let i = 0; i < queue.songs.length; i+=20){ 50 | if(counter >= 10) break; 51 | let k = queue.songs; 52 | let songs = k.slice(i, i + 20); 53 | message.channel.send(embed.setDescription(songs.map((song, index) => `**${index + 1 + counter * 20}** [${song.name}](${song.url}) - ${song.formattedDuration}`))) 54 | counter++; 55 | } 56 | 57 | } catch (e) { 58 | console.log(String(e.stack).bgRed) 59 | return message.channel.send(new MessageEmbed() 60 | .setColor(ee.wrongcolor) 61 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 62 | .setTitle(`❌ ERROR | An error occurred`) 63 | .setDescription(`\`\`\`${e.stack}\`\`\``) 64 | ); 65 | } 66 | } 67 | } 68 | /** 69 | * @INFO 70 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 71 | * @INFO 72 | * Work for Milrato Development | https://milrato.eu 73 | * @INFO 74 | * Please mention Him / Milrato Development, when using this Code! 75 | * @INFO 76 | */ 77 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Music/resume.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const {delay} = require("../../handlers/functions") 5 | module.exports = { 6 | name: "resume", 7 | category: "Music", 8 | aliases: ["r"], 9 | cooldown: 4, 10 | useage: "resume", 11 | description: "Resumes the Song", 12 | run: async (client, message, args, cmduser, text, prefix) => { 13 | try{ 14 | const { channel } = message.member.voice; // { message: { member: { voice: { channel: { name: "Allgemein", members: [{user: {"username"}, {user: {"username"}] }}}}} 15 | if(!channel) 16 | return message.channel.send(new MessageEmbed() 17 | .setColor(ee.wrongcolor) 18 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 19 | .setTitle(`❌ ERROR | Please join a Channel first`) 20 | ); 21 | if(!client.distube.getQueue(message)) 22 | return message.channel.send(new MessageEmbed() 23 | .setColor(ee.wrongcolor) 24 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 25 | .setTitle(`❌ ERROR | I am not playing Something`) 26 | .setDescription(`The Queue is empty`) 27 | ); 28 | if(client.distube.getQueue(message) && channel.id !== message.guild.me.voice.channel.id) 29 | return message.channel.send(new MessageEmbed() 30 | .setColor(ee.wrongcolor) 31 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 32 | .setTitle(`❌ ERROR | Please join **my** Channel first`) 33 | .setDescription(`Channelname: \`${message.guild.me.voice.channel.name}\``) 34 | ); 35 | if(client.distube.isPlaying(message)) 36 | return message.channel.send(new MessageEmbed() 37 | .setColor(ee.wrongcolor) 38 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 39 | .setTitle(`❌ ERROR | Cannot resume the Song`) 40 | .setDescription(`It's not paused, so I cant!`) 41 | ); 42 | message.channel.send(new MessageEmbed() 43 | .setColor(ee.color) 44 | .setFooter(client.user.username + " | powered by: milrato.eu",client.user.displayAvatarURL()) 45 | .setTitle("▶ Resumed the Song") 46 | ).then(msg=>msg.delete({timeout: 4000}).catch(e=>console.log(e.message))) 47 | 48 | client.distube.resume(message); 49 | //those 4 lines with the delay, fixes the bug that it doesnt resume by repausing and reresuming ;) 50 | await delay(100); 51 | client.distube.pause(message); 52 | await delay(100); 53 | client.distube.resume(message); 54 | } catch (e) { 55 | console.log(String(e.stack).bgRed) 56 | return message.channel.send(new MessageEmbed() 57 | .setColor(ee.wrongcolor) 58 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 59 | .setTitle(`❌ ERROR | An error occurred`) 60 | .setDescription(`\`\`\`${e.stack}\`\`\``) 61 | ); 62 | } 63 | } 64 | } 65 | /** 66 | * @INFO 67 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 68 | * @INFO 69 | * Work for Milrato Development | https://milrato.eu 70 | * @INFO 71 | * Please mention Him / Milrato Development, when using this Code! 72 | * @INFO 73 | */ 74 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Music/rewind.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const { format } = require("../../handlers/functions") 5 | module.exports = { 6 | name: "rewind", 7 | category: "Music", 8 | aliases: ["rew"], 9 | cooldown: 4, 10 | useage: "rewind <Time in Seconds>", 11 | description: "Rewinds for a specific amount of Time", 12 | run: async (client, message, args, cmduser, text, prefix) => { 13 | try{ 14 | const { channel } = message.member.voice; // { message: { member: { voice: { channel: { name: "Allgemein", members: [{user: {"username"}, {user: {"username"}] }}}}} 15 | if(!channel) 16 | return message.channel.send(new MessageEmbed() 17 | .setColor(ee.wrongcolor) 18 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 19 | .setTitle(`❌ ERROR | Please join a Channel first`) 20 | ); 21 | if(!client.distube.getQueue(message)) 22 | return message.channel.send(new MessageEmbed() 23 | .setColor(ee.wrongcolor) 24 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 25 | .setTitle(`❌ ERROR | I am not playing Something`) 26 | .setDescription(`The Queue is empty`) 27 | ); 28 | if(client.distube.getQueue(message) && channel.id !== message.guild.me.voice.channel.id) 29 | return message.channel.send(new MessageEmbed() 30 | .setColor(ee.wrongcolor) 31 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 32 | .setTitle(`❌ ERROR | Please join **my** Channel first`) 33 | .setDescription(`Channelname: \`${message.guild.me.voice.channel.name}\``) 34 | ); 35 | if(!args[0]) 36 | return message.channel.send(new MessageEmbed() 37 | .setColor(ee.wrongcolor) 38 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 39 | .setTitle(`❌ ERROR | You didn't provided a Time you want to seek to!`) 40 | .setDescription(`Usage: \`${prefix}seek 10\``) 41 | ) 42 | 43 | let queue = client.distube.getQueue(message); 44 | let seektime = queue.currentTime - Number(args[0]) * 1000; 45 | if(seektime < 0) 46 | seektime = 0; 47 | if(seektime >= queue.songs[0].duration * 1000 - queue.currentTime) 48 | seektime = 0; 49 | 50 | client.distube.seek(message, seektime); 51 | 52 | message.channel.send(new MessageEmbed() 53 | .setColor(ee.color) 54 | .setFooter(client.user.username + " | powered by: milrato.eu",client.user.displayAvatarURL()) 55 | .setTitle(`⏪ Rewinded for \`${args[0]} Seconds\` to: ${format(seektime)}`) 56 | ).then(msg=>msg.delete({timeout: 4000}).catch(e=>console.log(e.message))) 57 | } catch (e) { 58 | console.log(String(e.stack).bgRed) 59 | return message.channel.send(new MessageEmbed() 60 | .setColor(ee.wrongcolor) 61 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 62 | .setTitle(`❌ ERROR | An error occurred`) 63 | .setDescription(`\`\`\`${e.stack}\`\`\``) 64 | ); 65 | } 66 | } 67 | } 68 | /** 69 | * @INFO 70 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 71 | * @INFO 72 | * Work for Milrato Development | https://milrato.eu 73 | * @INFO 74 | * Please mention Him / Milrato Development, when using this Code! 75 | * @INFO 76 | */ 77 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Music/search.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const { getTracks, getPreview } = require("spotify-url-info") 5 | module.exports = { 6 | name: "search", 7 | category: "Music", 8 | aliases: ["findtrack"], 9 | cooldown: 4, 10 | useage: "search <URL / TITLE>", 11 | description: "Seraches 10 songs from youtube", 12 | run: async (client, message, args, cmduser, text, prefix) => { 13 | try{ 14 | const { channel } = message.member.voice; // { message: { member: { voice: { channel: { name: "Allgemein", members: [{user: {"username"}, {user: {"username"}] }}}}} 15 | if(!channel) 16 | return message.channel.send(new MessageEmbed() 17 | .setColor(ee.wrongcolor) 18 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 19 | .setTitle(`❌ ERROR | Please join a Channel first`) 20 | ); 21 | if(client.distube.getQueue(message) && channel.id !== message.guild.me.voice.channel.id) 22 | return message.channel.send(new MessageEmbed() 23 | .setColor(ee.wrongcolor) 24 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 25 | .setTitle(`❌ ERROR | Please join **my** Channel first`) 26 | .setDescription(`Channelname: \`${message.guild.me.voice.channel.name}\``) 27 | ); 28 | if(!args[0]) 29 | return message.channel.send(new MessageEmbed() 30 | .setColor(ee.wrongcolor) 31 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 32 | .setTitle(`❌ ERROR | You didn't provided a Searchterm`) 33 | .setDescription(`Usage: \`${prefix}search <URL / TITLE>\``) 34 | ); 35 | let result = await client.distube.search(args.join(" ")); 36 | let searchresult = ""; 37 | for(let i =0; i < 10; i++){ 38 | try{ 39 | searchresult += `**${i+1}.** [${result[i].name}](${result[i].url}) - \`${result[i].formattedDuration}\`\n` 40 | }catch{ 41 | searchresult = "\n"; 42 | } 43 | } 44 | message.channel.send(new MessageEmbed() 45 | .setColor(ee.color) 46 | .setFooter(client.user.username + " | powered by: milrato.eu",client.user.displayAvatarURL()) 47 | .setTitle(`Searchresult for: ${args.join(" ")}`.substr(0, 256)) 48 | .setDescription(searchresult.substr(0, 2048)) 49 | ).then(msg=>{ 50 | msg.channel.awaitMessages(m => m.author.id === message.author.id, {max: 1, time: 60000, errors: ["time"]}).then(collected =>{ 51 | let userinput = collected.first().content; 52 | if(Number(userinput) <= 0 && Number(userinput) > 10){ 53 | message.reply("NOT A VALID NUMBER, so i use the FIRST TRACK") 54 | userinput = 0; 55 | } 56 | client.distube.play(message, result[userinput - 1].url); 57 | }).catch(e=>{ 58 | console.log(String(e.stack).bgRed) 59 | return message.channel.send(new MessageEmbed() 60 | .setColor(ee.wrongcolor) 61 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 62 | .setTitle(`❌ ERROR | An error occurred | Time ran out`) 63 | .setDescription(`\`\`\`${e.message}\`\`\``) 64 | ); 65 | }) 66 | }) 67 | } catch (e) { 68 | console.log(String(e.stack).bgRed) 69 | return message.channel.send(new MessageEmbed() 70 | .setColor(ee.wrongcolor) 71 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 72 | .setTitle(`❌ ERROR | An error occurred`) 73 | .setDescription(`\`\`\`${e.stack}\`\`\``) 74 | ); 75 | } 76 | } 77 | } 78 | /** 79 | * @INFO 80 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 81 | * @INFO 82 | * Work for Milrato Development | https://milrato.eu 83 | * @INFO 84 | * Please mention Him / Milrato Development, when using this Code! 85 | * @INFO 86 | */ 87 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Music/seek.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const { format } = require("../../handlers/functions") 5 | module.exports = { 6 | name: "seek", 7 | category: "Music", 8 | aliases: [""], 9 | cooldown: 4, 10 | useage: "seek <Pos. in Seconds>", 11 | description: "Seek to a position in the track <Seconds>", 12 | run: async (client, message, args, cmduser, text, prefix) => { 13 | try{ 14 | const { channel } = message.member.voice; // { message: { member: { voice: { channel: { name: "Allgemein", members: [{user: {"username"}, {user: {"username"}] }}}}} 15 | if(!channel) 16 | return message.channel.send(new MessageEmbed() 17 | .setColor(ee.wrongcolor) 18 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 19 | .setTitle(`❌ ERROR | Please join a Channel first`) 20 | ); 21 | if(!client.distube.getQueue(message)) 22 | return message.channel.send(new MessageEmbed() 23 | .setColor(ee.wrongcolor) 24 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 25 | .setTitle(`❌ ERROR | I am not playing Something`) 26 | .setDescription(`The Queue is empty`) 27 | ); 28 | if(client.distube.getQueue(message) && channel.id !== message.guild.me.voice.channel.id) 29 | return message.channel.send(new MessageEmbed() 30 | .setColor(ee.wrongcolor) 31 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 32 | .setTitle(`❌ ERROR | Please join **my** Channel first`) 33 | .setDescription(`Channelname: \`${message.guild.me.voice.channel.name}\``) 34 | ); 35 | if(!args[0]) 36 | return message.channel.send(new MessageEmbed() 37 | .setColor(ee.wrongcolor) 38 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 39 | .setTitle(`❌ ERROR | You didn't provided a Time you want to seek to!`) 40 | .setDescription(`Usage: \`${prefix}seek 10\``) 41 | ) 42 | 43 | let seektime = Number(args[0]); 44 | 45 | if(seektime < 0) 46 | seektime = 0; 47 | 48 | if(seektime >= client.distube.getQueue(message).songs[0].duration) 49 | seektime = client.distube.getQueue(message).songs[0].duration - 1; 50 | 51 | client.distube.seek(message, seektime*1000); 52 | 53 | message.channel.send(new MessageEmbed() 54 | .setColor(ee.color) 55 | .setFooter(client.user.username + " | powered by: milrato.eu",client.user.displayAvatarURL()) 56 | .setTitle(`⏩ Seeking to: ${format(seektime)}`) 57 | ).then(msg=>msg.delete({timeout: 4000}).catch(e=>console.log(e.message))) 58 | 59 | } catch (e) { 60 | console.log(String(e.stack).bgRed) 61 | return message.channel.send(new MessageEmbed() 62 | .setColor(ee.wrongcolor) 63 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 64 | .setTitle(`❌ ERROR | An error occurred`) 65 | .setDescription(`\`\`\`${e.stack}\`\`\``) 66 | ); 67 | } 68 | } 69 | } 70 | /** 71 | * @INFO 72 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 73 | * @INFO 74 | * Work for Milrato Development | https://milrato.eu 75 | * @INFO 76 | * Please mention Him / Milrato Development, when using this Code! 77 | * @INFO 78 | */ 79 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Music/shuffle.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "shuffle", 6 | category: "Music", 7 | aliases: ["mix"], 8 | cooldown: 4, 9 | useage: "shuffle", 10 | description: "Shuffles the Queue", 11 | run: async (client, message, args, cmduser, text, prefix) => { 12 | try{ 13 | const { channel } = message.member.voice; // { message: { member: { voice: { channel: { name: "Allgemein", members: [{user: {"username"}, {user: {"username"}] }}}}} 14 | if(!channel) 15 | return message.channel.send(new MessageEmbed() 16 | .setColor(ee.wrongcolor) 17 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 18 | .setTitle(`❌ ERROR | Please join a Channel first`) 19 | ); 20 | if(!client.distube.getQueue(message)) 21 | return message.channel.send(new MessageEmbed() 22 | .setColor(ee.wrongcolor) 23 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 24 | .setTitle(`❌ ERROR | I am not playing Something`) 25 | .setDescription(`The Queue is empty`) 26 | ); 27 | if(client.distube.getQueue(message) && channel.id !== message.guild.me.voice.channel.id) 28 | return message.channel.send(new MessageEmbed() 29 | .setColor(ee.wrongcolor) 30 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 31 | .setTitle(`❌ ERROR | Please join **my** Channel first`) 32 | .setDescription(`Channelname: \`${message.guild.me.voice.channel.name}\``) 33 | ); 34 | 35 | message.channel.send(new MessageEmbed() 36 | .setColor(ee.color) 37 | .setFooter(client.user.username + " | powered by: milrato.eu",client.user.displayAvatarURL()) 38 | .setTitle("🔀 Shuffled the Queue") 39 | ).then(msg=>msg.delete({timeout: 4000}).catch(e=>console.log(e.message))) 40 | 41 | client.distube.shuffle(message); 42 | } catch (e) { 43 | console.log(String(e.stack).bgRed) 44 | return message.channel.send(new MessageEmbed() 45 | .setColor(ee.wrongcolor) 46 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 47 | .setTitle(`❌ ERROR | An error occurred`) 48 | .setDescription(`\`\`\`${e.stack}\`\`\``) 49 | ); 50 | } 51 | } 52 | } 53 | /** 54 | * @INFO 55 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 56 | * @INFO 57 | * Work for Milrato Development | https://milrato.eu 58 | * @INFO 59 | * Please mention Him / Milrato Development, when using this Code! 60 | * @INFO 61 | */ 62 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Music/skip.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "skip", 6 | category: "Music", 7 | aliases: ["s"], 8 | cooldown: 4, 9 | useage: "skip", 10 | description: "Skips a track", 11 | run: async (client, message, args, cmduser, text, prefix) => { 12 | try{ 13 | const { channel } = message.member.voice; // { message: { member: { voice: { channel: { name: "Allgemein", members: [{user: {"username"}, {user: {"username"}] }}}}} 14 | if(!channel) 15 | return message.channel.send(new MessageEmbed() 16 | .setColor(ee.wrongcolor) 17 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 18 | .setTitle(`❌ ERROR | Please join a Channel first`) 19 | ); 20 | if(!client.distube.getQueue(message)) 21 | return message.channel.send(new MessageEmbed() 22 | .setColor(ee.wrongcolor) 23 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 24 | .setTitle(`❌ ERROR | I am not playing Something`) 25 | .setDescription(`The Queue is empty`) 26 | ); 27 | if(client.distube.getQueue(message) && channel.id !== message.guild.me.voice.channel.id) 28 | return message.channel.send(new MessageEmbed() 29 | .setColor(ee.wrongcolor) 30 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 31 | .setTitle(`❌ ERROR | Please join **my** Channel first`) 32 | .setDescription(`Channelname: \`${message.guild.me.voice.channel.name}\``) 33 | ); 34 | 35 | message.channel.send(new MessageEmbed() 36 | .setColor(ee.color) 37 | .setFooter(client.user.username + " | powered by: milrato.eu",client.user.displayAvatarURL()) 38 | .setTitle("⏭ Skipped the Current Track") 39 | ).then(msg=>msg.delete({timeout: 4000}).catch(e=>console.log(e.message))) 40 | 41 | client.distube.skip(message); 42 | } catch (e) { 43 | console.log(String(e.stack).bgRed) 44 | return message.channel.send(new MessageEmbed() 45 | .setColor(ee.wrongcolor) 46 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 47 | .setTitle(`❌ ERROR | An error occurred`) 48 | .setDescription(`\`\`\`${e.stack}\`\`\``) 49 | ); 50 | } 51 | } 52 | } 53 | /** 54 | * @INFO 55 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 56 | * @INFO 57 | * Work for Milrato Development | https://milrato.eu 58 | * @INFO 59 | * Please mention Him / Milrato Development, when using this Code! 60 | * @INFO 61 | */ 62 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Music/stop.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "stop", 6 | category: "Music", 7 | aliases: ["leave"], 8 | cooldown: 4, 9 | useage: "stop", 10 | description: "Stops a track", 11 | run: async (client, message, args, cmduser, text, prefix) => { 12 | try{ 13 | const { channel } = message.member.voice; // { message: { member: { voice: { channel: { name: "Allgemein", members: [{user: {"username"}, {user: {"username"}] }}}}} 14 | if(!channel) 15 | return message.channel.send(new MessageEmbed() 16 | .setColor(ee.wrongcolor) 17 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 18 | .setTitle(`❌ ERROR | Please join a Channel first`) 19 | ); 20 | if(!client.distube.getQueue(message)) 21 | return message.channel.send(new MessageEmbed() 22 | .setColor(ee.wrongcolor) 23 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 24 | .setTitle(`❌ ERROR | I am not playing Something`) 25 | .setDescription(`The Queue is empty`) 26 | ); 27 | if(client.distube.getQueue(message) && channel.id !== message.guild.me.voice.channel.id) 28 | return message.channel.send(new MessageEmbed() 29 | .setColor(ee.wrongcolor) 30 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 31 | .setTitle(`❌ ERROR | Please join **my** Channel first`) 32 | .setDescription(`Channelname: \`${message.guild.me.voice.channel.name}\``) 33 | ); 34 | 35 | message.channel.send(new MessageEmbed() 36 | .setColor(ee.color) 37 | .setFooter(client.user.username + " | powered by: milrato.eu",client.user.displayAvatarURL()) 38 | .setTitle("⏹ Stopped playing Music and left your Channel") 39 | ).then(msg=>msg.delete({timeout: 4000}).catch(e=>console.log(e.message))) 40 | 41 | client.distube.stop(message); 42 | } catch (e) { 43 | console.log(String(e.stack).bgRed) 44 | return message.channel.send(new MessageEmbed() 45 | .setColor(ee.wrongcolor) 46 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 47 | .setTitle(`❌ ERROR | An error occurred`) 48 | .setDescription(`\`\`\`${e.stack}\`\`\``) 49 | ); 50 | } 51 | } 52 | } 53 | /** 54 | * @INFO 55 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 56 | * @INFO 57 | * Work for Milrato Development | https://milrato.eu 58 | * @INFO 59 | * Please mention Him / Milrato Development, when using this Code! 60 | * @INFO 61 | */ 62 | -------------------------------------------------------------------------------- /bots/musicbot/commands/Music/volume.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "volume", 6 | category: "Music", 7 | aliases: ["vol"], 8 | cooldown: 4, 9 | useage: "volume <0-150>", 10 | description: "Changes volume of the BOT!", 11 | run: async (client, message, args, cmduser, text, prefix) => { 12 | try{ 13 | const { channel } = message.member.voice; // { message: { member: { voice: { channel: { name: "Allgemein", members: [{user: {"username"}, {user: {"username"}] }}}}} 14 | if(!channel) 15 | return message.channel.send(new MessageEmbed() 16 | .setColor(ee.wrongcolor) 17 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 18 | .setTitle(`❌ ERROR | Please join a Channel first`) 19 | ); 20 | if(!client.distube.getQueue(message)) 21 | return message.channel.send(new MessageEmbed() 22 | .setColor(ee.wrongcolor) 23 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 24 | .setTitle(`❌ ERROR | I am not playing Something`) 25 | .setDescription(`The Queue is empty`) 26 | ); 27 | if(client.distube.getQueue(message) && channel.id !== message.guild.me.voice.channel.id) 28 | return message.channel.send(new MessageEmbed() 29 | .setColor(ee.wrongcolor) 30 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 31 | .setTitle(`❌ ERROR | Please join **my** Channel first`) 32 | .setDescription(`Channelname: \`${message.guild.me.voice.channel.name}\``) 33 | ); 34 | if(!args[0]) 35 | return message.channel.send(new MessageEmbed() 36 | .setColor(ee.wrongcolor) 37 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 38 | .setTitle(`❌ ERROR | You didn't provided a Loop method`) 39 | .setDescription(`Current Volume: \`${client.distube.getQueue(message).volume}%\`\nUsage: \`${prefix}volume <0-150>\``) 40 | ); 41 | 42 | if(!(0 <= Number(args[0]) && Number(args[0]) <= 500)) 43 | return message.channel.send(new MessageEmbed() 44 | .setColor(ee.wrongcolor) 45 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 46 | .setTitle(`❌ ERROR | Volume out of Range`) 47 | .setDescription(`Usage: \`${prefix}volume <0-150>\``) 48 | ); 49 | 50 | client.distube.setVolume(message, Number(args[0])); 51 | return message.channel.send(new MessageEmbed() 52 | .setColor(ee.color) 53 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 54 | .setTitle(`🔊 Changed the Volume to: \`${args[0]}%\``) 55 | ); 56 | } catch (e) { 57 | console.log(String(e.stack).bgRed) 58 | return message.channel.send(new MessageEmbed() 59 | .setColor(ee.wrongcolor) 60 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 61 | .setTitle(`❌ ERROR | An error occurred`) 62 | .setDescription(`\`\`\`${e.stack}\`\`\``) 63 | ); 64 | } 65 | } 66 | } 67 | /** 68 | * @INFO 69 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 70 | * @INFO 71 | * Work for Milrato Development | https://milrato.eu 72 | * @INFO 73 | * Please mention Him / Milrato Development, when using this Code! 74 | * @INFO 75 | */ 76 | -------------------------------------------------------------------------------- /bots/musicbot/events/client/disconnect.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.log(`You have been disconnected at ${new Date()}.`.red) 4 | } 5 | /** 6 | * @INFO 7 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 8 | * @INFO 9 | * Work for Milrato Development | https://milrato.eu 10 | * @INFO 11 | * Please mention Him / Milrato Development, when using this Code! 12 | * @INFO 13 | */ 14 | -------------------------------------------------------------------------------- /bots/musicbot/events/client/error.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.error(); 4 | } 5 | /** 6 | * @INFO 7 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 8 | * @INFO 9 | * Work for Milrato Development | https://milrato.eu 10 | * @INFO 11 | * Please mention Him / Milrato Development, when using this Code! 12 | * @INFO 13 | */ 14 | -------------------------------------------------------------------------------- /bots/musicbot/events/client/ready.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | const config = require("../../botconfig/config.json") 3 | module.exports = client => { 4 | try{ 5 | const stringlength = 69; 6 | console.log("\n") 7 | console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.brightGreen) 8 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 9 | console.log(` ┃ `.bold.brightGreen + `Discord Bot is online!`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-`Discord Bot is online!`.length)+ "┃".bold.brightGreen) 10 | console.log(` ┃ `.bold.brightGreen + ` /--/ ${client.user.tag} /--/ `.bold.brightGreen+ " ".repeat(-1+stringlength-` ┃ `.length-` /--/ ${client.user.tag} /--/ `.length)+ "┃".bold.brightGreen) 11 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 12 | console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.brightGreen) 13 | }catch{ /* */ } 14 | 15 | try{ 16 | client.user.setActivity(client.user.username, { type: "PLAYING" }); 17 | }catch (e) { 18 | console.log(String(e.stack).red); 19 | } 20 | //Change status each 10 minutes 21 | setTimeout(()=>{ 22 | try{ 23 | client.user.setActivity(client.user.username, { type: "PLAYING" }); 24 | }catch (e) { 25 | console.log(String(e.stack).red); 26 | } 27 | }, 10*60*1000) 28 | } 29 | /** 30 | * @INFO 31 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 32 | * @INFO 33 | * Work for Milrato Development | https://milrato.eu 34 | * @INFO 35 | * Please mention Him / Milrato Development, when using this Code! 36 | * @INFO 37 | */ 38 | -------------------------------------------------------------------------------- /bots/musicbot/events/client/reconnecting.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.log(`Reconnceting at ${new Date()}.`.bgYellow.black) 4 | } 5 | 6 | /** 7 | * @INFO 8 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 9 | * @INFO 10 | * Work for Milrato Development | https://milrato.eu 11 | * @INFO 12 | * Please mention Him / Milrato Development, when using this Code! 13 | * @INFO 14 | */ 15 | -------------------------------------------------------------------------------- /bots/musicbot/events/client/warn.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.warn(); 4 | } 5 | /** 6 | * @INFO 7 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 8 | * @INFO 9 | * Work for Milrato Development | https://milrato.eu 10 | * @INFO 11 | * Please mention Him / Milrato Development, when using this Code! 12 | * @INFO 13 | */ 14 | -------------------------------------------------------------------------------- /bots/musicbot/handlers/command.js: -------------------------------------------------------------------------------- 1 | const { readdirSync } = require("fs"); 2 | const ascii = require("ascii-table"); 3 | let table = new ascii("Commands"); 4 | table.setHeading("Command", "Load status"); 5 | console.log("Welcome to SERVICE HANDLER /--/ By https://milrato.eu /--/ Discord: Tomato#6966".yellow); 6 | module.exports = (client) => { 7 | try{ 8 | readdirSync("./commands/").forEach((dir) => { 9 | const commands = readdirSync(`./commands/${dir}/`).filter((file) => file.endsWith(".js")); 10 | for (let file of commands) { 11 | let pull = require(`../commands/${dir}/${file}`); 12 | if (pull.name) { 13 | client.commands.set(pull.name, pull); 14 | table.addRow(file, "Ready"); 15 | } else { 16 | table.addRow(file, `error->missing a help.name,or help.name is not a string.`); 17 | continue; 18 | } 19 | if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach((alias) => client.aliases.set(alias, pull.name)); 20 | } 21 | }); 22 | console.log(table.toString().cyan); 23 | }catch (e){ 24 | console.log(String(e.stack).bgRed) 25 | } 26 | }; 27 | /** 28 | * @INFO 29 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 30 | * @INFO 31 | * Work for Milrato Development | https://milrato.eu 32 | * @INFO 33 | * Please mention Him / Milrato Development, when using this Code! 34 | * @INFO 35 | */ 36 | -------------------------------------------------------------------------------- /bots/musicbot/handlers/events.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const ascii = require("ascii-table"); 3 | let table = new ascii("Events"); 4 | table.setHeading("Events", "Load status"); 5 | const allevents = []; 6 | module.exports = async (client) => { 7 | try{ 8 | const load_dir = (dir) => { 9 | const event_files = fs.readdirSync(`./events/${dir}`).filter((file) => file.endsWith(".js")); 10 | for (const file of event_files){ 11 | const event = require(`../events/${dir}/${file}`) 12 | let eventName = file.split(".")[0]; 13 | allevents.push(eventName); 14 | client.on(eventName, event.bind(null, client)); 15 | } 16 | } 17 | await ["client", "guild"].forEach(e=>load_dir(e)); 18 | for (let i = 0; i < allevents.length; i++) { 19 | try { 20 | table.addRow(allevents[i], "Ready"); 21 | } catch (e) { 22 | console.log(String(e.stack).red); 23 | } 24 | } 25 | console.log(table.toString().cyan); 26 | try{ 27 | const stringlength = 69; 28 | console.log("\n") 29 | console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.brightGreen) 30 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 31 | console.log(` ┃ `.bold.brightGreen + `Welcome to SERVICE HANDLER!`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-`Welcome to SERVICE HANDLER!`.length)+ "┃".bold.brightGreen) 32 | console.log(` ┃ `.bold.brightGreen + ` /-/ By https://milrato.eu /-/`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-` /-/ By https://milrato.eu /-/`.length)+ "┃".bold.brightGreen) 33 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 34 | console.log(` ┃ `.bold.brightGreen + ` /-/ Discord: Tomato#6966 /-/`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-` /-/ By Discord: Tomato#6966 /-/`.length)+ " ┃".bold.brightGreen) 35 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 36 | console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.brightGreen) 37 | }catch{ /* */ } 38 | try{ 39 | const stringlength2 = 69; 40 | console.log("\n") 41 | console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.yellow) 42 | console.log(` ┃ `.bold.yellow + " ".repeat(-1+stringlength2-` ┃ `.length)+ "┃".bold.yellow) 43 | console.log(` ┃ `.bold.yellow + `Logging into the BOT...`.bold.yellow + " ".repeat(-1+stringlength2-` ┃ `.length-`Logging into the BOT...`.length)+ "┃".bold.yellow) 44 | console.log(` ┃ `.bold.yellow + " ".repeat(-1+stringlength2-` ┃ `.length)+ "┃".bold.yellow) 45 | console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.yellow) 46 | }catch{ /* */ } 47 | }catch (e){ 48 | console.log(String(e.stack).bgRed) 49 | } 50 | }; 51 | /** 52 | * @INFO 53 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 54 | * @INFO 55 | * Work for Milrato Development | https://milrato.eu 56 | * @INFO 57 | * Please mention Him / Milrato Development, when using this Code! 58 | * @INFO 59 | */ 60 | -------------------------------------------------------------------------------- /bots/musicbot/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @INFO 3 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 4 | * @INFO 5 | * Work for Milrato Development | https://milrato.eu 6 | * @INFO 7 | * Please mention Him / Milrato Development, when using this Code! 8 | * @INFO 9 | */ 10 | //Importing all needed Commands 11 | const Discord = require("discord.js"); //this is the official discord.js wrapper for the Discord Api, which we use! 12 | const colors = require("colors"); //this Package is used, to change the colors of our Console! (optional and doesnt effect performance) 13 | const fs = require("fs"); //this package is for reading files and getting their inputs 14 | //Creating the Discord.js Client for This Bot with some default settings ;) and with partials, so you can fetch OLD messages 15 | const client = new Discord.Client({ 16 | messageCacheLifetime: 60, 17 | fetchAllMembers: false, 18 | messageCacheMaxSize: 10, 19 | restTimeOffset: 0, 20 | restWsBridgetimeout: 100, 21 | disableEveryone: true, 22 | partials: ['MESSAGE', 'CHANNEL', 'REACTION'] 23 | }); 24 | //Client variables to use everywhere 25 | client.commands = new Discord.Collection(); //an collection (like a digital map(database)) for all your commands 26 | client.aliases = new Discord.Collection(); //an collection for all your command-aliases 27 | client.categories = fs.readdirSync("./commands/"); //categories 28 | client.cooldowns = new Discord.Collection(); //an collection for cooldown commands of each user 29 | 30 | //Loading files, with the client variable like Command Handler, Event Handler, Distube Event Handler ... 31 | ["command", "events", "distube-handler"].forEach(handler => { 32 | require(`./handlers/${handler}`)(client); 33 | }); 34 | //login into the bot 35 | client.login(require("./botconfig/config.json").token); 36 | /** 37 | * @INFO 38 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 39 | * @INFO 40 | * Work for Milrato Development | https://milrato.eu 41 | * @INFO 42 | * Please mention Him / Milrato Development, when using this Code! 43 | * @INFO 44 | */ 45 | -------------------------------------------------------------------------------- /bots/musicbot/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "discord-js-handler-template", 3 | "version": "1.0.0", 4 | "description": "Discord.js Command and Event Handler Template with example Command usages! For Questions: https://discord.gg/fS6qBSm", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node index.js" 9 | }, 10 | "author": "Tomato#6966", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@discordjs/opus": "^0.4.0", 14 | "ascii-table": "0.0.9", 15 | "discord.js": "^12.5.1", 16 | "distube": "^2.8.9", 17 | "ffmpeg-static": "^4.2.7", 18 | "spotify-url-info": "^2.2.0" 19 | }, 20 | "devDependencies": { 21 | "ascii-table": "0.0.9", 22 | "colors": "^1.4.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /bots/waitingroombot/README.md: -------------------------------------------------------------------------------- 1 | # Discord-Js-Handler-Template 2 | 3 | For Questions: https://discord.gg/fS6qBSm 4 | 5 | ## BEST HOSTING | Bittmax.de 6 | BITTMAX Quality is their solution. 7 | Bittmax is our first and probably most important sponsor! 8 | 9 | **What they are offering:** 10 | > Quality LXC & KVM (Root) Server 11 | > Minecraft Hosting, as well as BungeeCord Network Hosting support 12 | > Cheap and fast Domains 13 | > WEBHOSTING 14 | > DISCORD, TEAMSPEAK, Setups / Music Bots 15 | > GAME SERVER, Rust, Gary's Mod, .. 16 | 17 | **Discord Server:** 18 | [https://discord.gg/GgjJZCyYKD](https://discord.gg/GgjJZCyYKD) 19 | 20 | **Website:** 21 | [https://bittmax.de/](https://bittmax.de/]) 22 | 23 | GET **5%** OFF EVERYTHING FOR EVER! 24 | Code: **`x10`** 25 | 26 | ## MC-Host24.de 27 | MC-Host24.de is selling the Best Digital Hosting Services ever! 28 | Like For games.. 29 | 30 | **What they are offering:** 31 | > Quality LXC & KVM (Root) Server 32 | > WORLDS BEST Minecraft Hosting, 33 | > Cheap and fast Domains 34 | > WEBHOSTING 35 | > DISCORD, TEAMSPEAK, Setups / Music Bots 36 | > GAME SERVER, Rust, Gary's Mod, .. 37 | 38 | **Discord Server:** 39 | [https://discord.com/invite/4dGuGXK4A4](https://discord.com/invite/4dGuGXK4A4) 40 | 41 | **Website:** 42 | [mc-host24.de](https://mc-host24.de/user/affiliate/3121]) 43 | 44 | 45 | ## SUPPORT ME 46 | 47 | You can always Support me by inviting one of my **own Discord Bots** 48 | 49 | [![Musicium Music Bot](https://cdn.discordapp.com/attachments/742446682381221938/770055673965707264/test1.png)](https://musicium.eu) 50 | [![Milrato Multi Bot](https://cdn.discordapp.com/attachments/742446682381221938/770056826724679680/test1.png)](https://milrato.eu) 51 | 52 | [OTHER BOTS](https://bots.musicium.eu) 53 | 54 | [| fork my repository |](https://github.com/user/repository/fork) 55 | [watch this repo |](https://github.com/user/repository/subscription) 56 | [create issue |](https://github.com/user/repository/issues/new) 57 | 58 | *Both bots are still in Development, and will always be in development, this means always uptodate and always online and always improving!* 59 | -------------------------------------------------------------------------------- /bots/waitingroombot/botconfig/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "token": "", 3 | "prefix": "", 4 | "owner": "", 5 | "channel": "", 6 | "guild": "", 7 | "radiostation": "" 8 | } -------------------------------------------------------------------------------- /bots/waitingroombot/botconfig/embed.json: -------------------------------------------------------------------------------- 1 | { 2 | "color": "#3498db", 3 | "wrongcolor": "#e01e01" 4 | } 5 | -------------------------------------------------------------------------------- /bots/waitingroombot/commands/Information/help.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "help", 6 | category: "Information", 7 | aliases: ["h", "commandinfo", "cmds", "cmd"], 8 | cooldown: 4, 9 | usage: "help [Command]", 10 | description: "Returns all Commmands, or one specific command", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | if (args[0]) { 14 | const embed = new MessageEmbed(); 15 | const cmd = client.commands.get(args[0].toLowerCase()) || client.commands.get(client.aliases.get(args[0].toLowerCase())); 16 | if (!cmd) { 17 | return message.channel.send(embed.setColor(ee.wrongcolor).setDescription(`No Information found for command **${args[0].toLowerCase()}**`)); 18 | } 19 | if (cmd.name) embed.addField("**Command name**", `\`${cmd.name}\``); 20 | if (cmd.name) embed.setTitle(`Detailed Information about:\`${cmd.name}\``); 21 | if (cmd.description) embed.addField("**Description**", `\`${cmd.description}\``); 22 | if (cmd.aliases) embed.addField("**Aliases**", `\`${cmd.aliases.map((a) => `${a}`).join("`, `")}\``); 23 | if (cmd.cooldown) embed.addField("**Cooldown**", `\`${cmd.cooldown} Seconds\``); 24 | else embed.addField("**Cooldown**", `\`1 Second\``); 25 | if (cmd.usage) { 26 | embed.addField("**Usage**", `\`${config.prefix}${cmd.usage}\``); 27 | embed.setFooter("Syntax: <> = required, [] = optional"); 28 | } 29 | if (cmd.useage) { 30 | embed.addField("**Useage**", `\`${config.prefix}${cmd.useage}\``); 31 | embed.setFooter("Syntax: <> = required, [] = optional"); 32 | } 33 | return message.channel.send(embed.setColor(ee.color)); 34 | } else { 35 | const embed = new MessageEmbed() 36 | .setColor(ee.color) 37 | .setThumbnail(client.user.displayAvatarURL()) 38 | .setTitle("HELP MENU 🔰 Commands") 39 | .setFooter(`To see command descriptions and inforamtion, type: ${config.prefix}help [CMD NAME]`, client.user.displayAvatarURL()); 40 | const commands = (category) => { 41 | return client.commands.filter((cmd) => cmd.category === category).map((cmd) => `\`${cmd.name}\``); 42 | }; 43 | try { 44 | for (let i = 0; i < client.categories.length; i += 1) { 45 | const current = client.categories[i]; 46 | const items = commands(current); 47 | const n = 3; 48 | const result = [[], [], []]; 49 | const wordsPerLine = Math.ceil(items.length / 3); 50 | for (let line = 0; line < n; line++) { 51 | for (let i = 0; i < wordsPerLine; i++) { 52 | const value = items[i + line * wordsPerLine]; 53 | if (!value) continue; 54 | result[line].push(value); 55 | } 56 | } 57 | embed.addField(`**${current.toUpperCase()} [${items.length}]**`, `> ${result[0].join("\n> ")}`, true); 58 | embed.addField(`\u200b`, `${result[1].join("\n") ? result[1].join("\n") : "\u200b"}`, true); 59 | embed.addField(`\u200b`, `${result[2].join("\n") ? result[2].join("\n") : "\u200b"}`, true); 60 | } 61 | } catch (e) { 62 | console.log(String(e.stack).red); 63 | } 64 | message.channel.send(embed); 65 | } 66 | } catch (e) { 67 | console.log(String(e.stack).bgRed) 68 | return message.channel.send(new MessageEmbed() 69 | .setColor(ee.wrongcolor) 70 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 71 | .setTitle(`❌ ERROR | An error occurred`) 72 | .setDescription(`\`\`\`${e.stack}\`\`\``) 73 | ); 74 | } 75 | } 76 | } 77 | /** 78 | * @INFO 79 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 80 | * @INFO 81 | * Work for Milrato Development | https://milrato.eu 82 | * @INFO 83 | * Please mention Him / Milrato Development, when using this Code! 84 | * @INFO 85 | */ 86 | -------------------------------------------------------------------------------- /bots/waitingroombot/commands/Information/ping.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "ping", 6 | category: "Information", 7 | aliases: ["latency"], 8 | cooldown: 2, 9 | usage: "ping", 10 | description: "Gives you information on how fast the Bot can respond to you", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | message.channel.send(new MessageEmbed() 14 | .setColor(ee.color) 15 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 16 | .setTitle(`🏓 Pinging....`) 17 | ).then(msg=>{ 18 | msg.edit(new MessageEmbed() 19 | .setColor(ee.color) 20 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 21 | .setTitle(`🏓 Ping is \`${Math.round(client.ws.ping)}ms\``) 22 | ); 23 | }) 24 | } catch (e) { 25 | console.log(String(e.stack).bgRed) 26 | return message.channel.send(new MessageEmbed() 27 | .setColor(ee.wrongcolor) 28 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 29 | .setTitle(`❌ ERROR | An error occurred`) 30 | .setDescription(`\`\`\`${e.stack}\`\`\``) 31 | ); 32 | } 33 | } 34 | } 35 | /** 36 | * @INFO 37 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 38 | * @INFO 39 | * Work for Milrato Development | https://milrato.eu 40 | * @INFO 41 | * Please mention Him / Milrato Development, when using this Code! 42 | * @INFO 43 | */ 44 | -------------------------------------------------------------------------------- /bots/waitingroombot/commands/Information/uptime.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const { duration } = require("../../handlers/functions") 5 | module.exports = { 6 | name: "uptime", 7 | category: "Information", 8 | aliases: [""], 9 | cooldown: 10, 10 | usage: "uptime", 11 | description: "Returns the duration on how long the Bot is online", 12 | run: async (client, message, args, user, text, prefix) => { 13 | try{ 14 | message.channel.send(new MessageEmbed() 15 | .setColor(ee.color) 16 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 17 | .setTitle(`:white_check_mark: **${client.user.username}** is since:\n ${duration(client.uptime)} online`) 18 | ); 19 | } catch (e) { 20 | console.log(String(e.stack).bgRed) 21 | return message.channel.send(new MessageEmbed() 22 | .setColor(ee.wrongcolor) 23 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 24 | .setTitle(`❌ ERROR | An error occurred`) 25 | .setDescription(`\`\`\`${e.stack}\`\`\``) 26 | ); 27 | } 28 | } 29 | } 30 | /** 31 | * @INFO 32 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 33 | * @INFO 34 | * Work for Milrato Development | https://milrato.eu 35 | * @INFO 36 | * Please mention Him / Milrato Development, when using this Code! 37 | * @INFO 38 | */ 39 | -------------------------------------------------------------------------------- /bots/waitingroombot/commands/Voice/changeradio.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const radiomodule = require("../../modules/radiomodule"); 5 | const fs = require("fs") 6 | module.exports = { 7 | name: "changeradio", 8 | category: "Voice", 9 | aliases: ["setradio"], 10 | cooldown: 2, 11 | usage: "changeradio <RadioStation>", 12 | description: "Changes the RadioStation Link, must be mp3 / stream / m3u / aac", 13 | run: async (client, message, args, user, text, prefix) => { 14 | try{ 15 | if(message.author.id !== config.owner && !message.member.hasPermission("ADMINISTRATOR")) 16 | return message.channel.send(new MessageEmbed() 17 | .setColor(ee.wrongcolor) 18 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 19 | .setTitle(`❌ ERROR | You are not my OWNER! you are not allowed to run this Command`) 20 | ); 21 | let botchannel = message.guild.me.voice.channel; 22 | if(!args[0]) 23 | return message.channel.send(new MessageEmbed() 24 | .setColor(ee.wrongcolor) 25 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 26 | .setTitle(`❌ ERROR | Please include the RadioStation URL you wanna play!`) 27 | ); 28 | if(!args[0].includes("http") && !args[0].includes("mp3") && !args[0].includes("stream") && !args[0].includes("aac") && !args[0].includes("m3u")) 29 | return message.channel.send(new MessageEmbed() 30 | .setColor(ee.wrongcolor) 31 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 32 | .setTitle(`❌ ERROR | The RadioStation URL must be an **mp3 / stream / aac / m3u** Radio stream!!`) 33 | ); 34 | 35 | let oldconfig = config; 36 | oldconfig.radiostation = args[0]; 37 | 38 | fs.writeFile("./botconfig/config.json", JSON.stringify(oldconfig, null, 3), async (e) => { 39 | if (e) { 40 | console.log(String(e.stack).red); 41 | return message.channel.send(new MessageEmbed() 42 | .setFooter(ee.footertext,ee.footericon) 43 | .setColor(ee.wrongcolor) 44 | .setTitle("❌ ERROR Writing the File") 45 | .setDescription(`\`\`\`${e.stack}\`\`\``) 46 | ) 47 | } 48 | if(botchannel) { 49 | await botchannel.leave() 50 | } 51 | setTimeout(()=>{ 52 | radiomodule(client) 53 | }, 500) 54 | return message.channel.send(new MessageEmbed() 55 | .setColor(ee.color) 56 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 57 | .setTitle(`✅ Success | Set the new Waitingroom channel to: \`${args[0]}\``) 58 | ) 59 | }); 60 | 61 | } catch (e) { 62 | console.log(String(e.stack).bgRed) 63 | return message.channel.send(new MessageEmbed() 64 | .setColor(ee.wrongcolor) 65 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 66 | .setTitle(`❌ ERROR | An error occurred`) 67 | .setDescription(`\`\`\`${e.stack}\`\`\``) 68 | ); 69 | } 70 | } 71 | } 72 | /** 73 | * @INFO 74 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 75 | * @INFO 76 | * Work for Milrato Development | https://milrato.eu 77 | * @INFO 78 | * Please mention Him / Milrato Development, when using this Code! 79 | * @INFO 80 | */ 81 | -------------------------------------------------------------------------------- /bots/waitingroombot/commands/Voice/join.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const radiomodule = require("../../modules/radiomodule"); 5 | const fs = require("fs") 6 | module.exports = { 7 | name: "join", 8 | category: "Voice", 9 | aliases: ["connect"], 10 | cooldown: 2, 11 | usage: "join", 12 | description: "Joins your Channel and set the Radio to that!", 13 | run: async (client, message, args, user, text, prefix) => { 14 | try{ 15 | if(message.author.id !== config.owner && !message.member.hasPermission("ADMINISTRATOR")) 16 | return message.channel.send(new MessageEmbed() 17 | .setColor(ee.wrongcolor) 18 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 19 | .setTitle(`❌ ERROR | You are not my OWNER! you are not allowed to run this Command`) 20 | ); 21 | let {channel} = message.member.voice; 22 | let botchnannel = message.guild.me.voice.channel; 23 | if(!channel) 24 | return message.channel.send(new MessageEmbed() 25 | .setColor(ee.wrongcolor) 26 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 27 | .setTitle(`❌ ERROR | Please join a Voice Channel, which you wanna set to your Waitingroom Channel`) 28 | ); 29 | 30 | let oldconfig = config; 31 | oldconfig.channel = channel.id; 32 | oldconfig.guild = message.guild.id; 33 | 34 | fs.writeFile("./botconfig/config.json", JSON.stringify(oldconfig, null, 3), async (e) => { 35 | if (e) { 36 | console.log(String(e.stack).red); 37 | return message.channel.send(new MessageEmbed() 38 | .setFooter(ee.footertext,ee.footericon) 39 | .setColor(ee.wrongcolor) 40 | .setTitle("❌ ERROR Writing the File") 41 | .setDescription(`\`\`\`${e.stack}\`\`\``) 42 | ) 43 | } 44 | if(botchnannel) { 45 | await botchnannel.leave() 46 | } 47 | setTimeout(()=>{ 48 | radiomodule(client) 49 | }, 500) 50 | return message.channel.send(new MessageEmbed() 51 | .setColor(ee.color) 52 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 53 | .setTitle(`✅ Success | Set the new Radio to: \`${channel.name}\``) 54 | ) 55 | }); 56 | 57 | } catch (e) { 58 | console.log(String(e.stack).bgRed) 59 | return message.channel.send(new MessageEmbed() 60 | .setColor(ee.wrongcolor) 61 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 62 | .setTitle(`❌ ERROR | An error occurred`) 63 | .setDescription(`\`\`\`${e.stack}\`\`\``) 64 | ); 65 | } 66 | } 67 | } 68 | /** 69 | * @INFO 70 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 71 | * @INFO 72 | * Work for Milrato Development | https://milrato.eu 73 | * @INFO 74 | * Please mention Him / Milrato Development, when using this Code! 75 | * @INFO 76 | */ 77 | -------------------------------------------------------------------------------- /bots/waitingroombot/commands/Voice/leave.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const radiomodule = require("../../modules/radiomodule"); 5 | const fs = require("fs") 6 | module.exports = { 7 | name: "leave", 8 | category: "Voice", 9 | aliases: [""], 10 | cooldown: 2, 11 | usage: "leave", 12 | description: "Leaves the Setupped Channel", 13 | run: async (client, message, args, user, text, prefix) => { 14 | try{ 15 | let botchannel = message.guild.me.voice.channel; 16 | 17 | if(!botchannel) { 18 | return message.channel.send(new MessageEmbed() 19 | .setColor(ee.wrongcolor) 20 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 21 | .setTitle(`:x: Not Connected to: \`${config.channel}\``) 22 | ) 23 | } 24 | message.channel.send(new MessageEmbed() 25 | .setColor(ee.color) 26 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 27 | .setTitle(`Leaving...: \`${botchannel.name}\``) 28 | ) 29 | botchannel.leave(); 30 | } catch (e) { 31 | console.log(String(e.stack).bgRed) 32 | return message.channel.send(new MessageEmbed() 33 | .setColor(ee.wrongcolor) 34 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 35 | .setTitle(`❌ ERROR | An error occurred`) 36 | .setDescription(`\`\`\`${e.stack}\`\`\``) 37 | ); 38 | } 39 | } 40 | } 41 | /** 42 | * @INFO 43 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 44 | * @INFO 45 | * Work for Milrato Development | https://milrato.eu 46 | * @INFO 47 | * Please mention Him / Milrato Development, when using this Code! 48 | * @INFO 49 | */ 50 | -------------------------------------------------------------------------------- /bots/waitingroombot/commands/Voice/play.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const radiomodule = require("../../modules/radiomodule"); 5 | const fs = require("fs") 6 | module.exports = { 7 | name: "play", 8 | category: "Voice", 9 | aliases: [""], 10 | cooldown: 2, 11 | usage: "play", 12 | description: "Plays in the Setupped Channel", 13 | run: async (client, message, args, user, text, prefix) => { 14 | try{ 15 | let botchannel = message.guild.me.voice.channel; 16 | 17 | if(!botchannel) { 18 | message.channel.send(new MessageEmbed() 19 | .setColor(ee.color) 20 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 21 | .setTitle(`Playing...: \`${config.channel}\``) 22 | ) 23 | return radiomodule(client); 24 | } 25 | message.channel.send(new MessageEmbed() 26 | .setColor(ee.color) 27 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 28 | .setTitle(`Playing...: \`${botchannel.name}\``) 29 | ) 30 | await botchannel.leave() 31 | setTimeout(()=>{ 32 | radiomodule(client) 33 | }, 500) 34 | } catch (e) { 35 | console.log(String(e.stack).bgRed) 36 | return message.channel.send(new MessageEmbed() 37 | .setColor(ee.wrongcolor) 38 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 39 | .setTitle(`❌ ERROR | An error occurred`) 40 | .setDescription(`\`\`\`${e.stack}\`\`\``) 41 | ); 42 | } 43 | } 44 | } 45 | /** 46 | * @INFO 47 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 48 | * @INFO 49 | * Work for Milrato Development | https://milrato.eu 50 | * @INFO 51 | * Please mention Him / Milrato Development, when using this Code! 52 | * @INFO 53 | */ 54 | -------------------------------------------------------------------------------- /bots/waitingroombot/commands/Voice/rejoin.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const radiomodule = require("../../modules/radiomodule"); 5 | const fs = require("fs") 6 | module.exports = { 7 | name: "rejoin", 8 | category: "Voice", 9 | aliases: ["reconnect"], 10 | cooldown: 2, 11 | usage: "rejoin", 12 | description: "Rejoins the Setupped Channel", 13 | run: async (client, message, args, user, text, prefix) => { 14 | try{ 15 | let botchannel = message.guild.me.voice.channel; 16 | 17 | if(!botchannel) { 18 | message.channel.send(new MessageEmbed() 19 | .setColor(ee.color) 20 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 21 | .setTitle(`Rejoining...: \`${config.channel}\``) 22 | ) 23 | return radiomodule(client); 24 | } 25 | message.channel.send(new MessageEmbed() 26 | .setColor(ee.color) 27 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 28 | .setTitle(`Rejoining...: \`${botchannel.name}\``) 29 | ) 30 | await botchannel.leave() 31 | setTimeout(()=>{ 32 | radiomodule(client) 33 | }, 500) 34 | } catch (e) { 35 | console.log(String(e.stack).bgRed) 36 | return message.channel.send(new MessageEmbed() 37 | .setColor(ee.wrongcolor) 38 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 39 | .setTitle(`❌ ERROR | An error occurred`) 40 | .setDescription(`\`\`\`${e.stack}\`\`\``) 41 | ); 42 | } 43 | } 44 | } 45 | /** 46 | * @INFO 47 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 48 | * @INFO 49 | * Work for Milrato Development | https://milrato.eu 50 | * @INFO 51 | * Please mention Him / Milrato Development, when using this Code! 52 | * @INFO 53 | */ 54 | -------------------------------------------------------------------------------- /bots/waitingroombot/commands/Voice/setup.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const radiomodule = require("../../modules/radiomodule"); 5 | const fs = require("fs") 6 | module.exports = { 7 | name: "setup", 8 | category: "Voice", 9 | aliases: ["resetup"], 10 | cooldown: 2, 11 | usage: "setup", 12 | description: "Joins your Channel and set the Radio to that!", 13 | run: async (client, message, args, user, text, prefix) => { 14 | try{ 15 | if(message.author.id !== config.owner && !message.member.hasPermission("ADMINISTRATOR")) 16 | return message.channel.send(new MessageEmbed() 17 | .setColor(ee.wrongcolor) 18 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 19 | .setTitle(`❌ ERROR | You are not my OWNER! you are not allowed to run this Command`) 20 | ); 21 | let {channel} = message.member.voice; 22 | let botchannel = message.guild.me.voice.channel; 23 | if(!channel) 24 | return message.channel.send(new MessageEmbed() 25 | .setColor(ee.wrongcolor) 26 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 27 | .setTitle(`❌ ERROR | Please join a Voice Channel, which you wanna set to your Waitingroom Channel`) 28 | ); 29 | 30 | let oldconfig = config; 31 | oldconfig.channel = channel.id; 32 | oldconfig.guild = message.guild.id; 33 | 34 | fs.writeFile("./botconfig/config.json", JSON.stringify(oldconfig, null, 3), async (e) => { 35 | if (e) { 36 | console.log(String(e.stack).red); 37 | return message.channel.send(new MessageEmbed() 38 | .setFooter(ee.footertext,ee.footericon) 39 | .setColor(ee.wrongcolor) 40 | .setTitle("❌ ERROR Writing the File") 41 | .setDescription(`\`\`\`${e.stack}\`\`\``) 42 | ) 43 | } 44 | if(botchannel) { 45 | await botchannel.leave() 46 | } 47 | setTimeout(()=>{ 48 | radiomodule(client) 49 | }, 500) 50 | return message.channel.send(new MessageEmbed() 51 | .setColor(ee.color) 52 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 53 | .setTitle(`✅ Success | Set the new Waitingroom channel to: \`${channel.name}\``) 54 | ) 55 | }); 56 | 57 | } catch (e) { 58 | console.log(String(e.stack).bgRed) 59 | return message.channel.send(new MessageEmbed() 60 | .setColor(ee.wrongcolor) 61 | .setFooter(client.user.username + " | powered by: milrato.eu", client.user.displayAvatarURL()) 62 | .setTitle(`❌ ERROR | An error occurred`) 63 | .setDescription(`\`\`\`${e.stack}\`\`\``) 64 | ); 65 | } 66 | } 67 | } 68 | /** 69 | * @INFO 70 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 71 | * @INFO 72 | * Work for Milrato Development | https://milrato.eu 73 | * @INFO 74 | * Please mention Him / Milrato Development, when using this Code! 75 | * @INFO 76 | */ 77 | -------------------------------------------------------------------------------- /bots/waitingroombot/events/client/disconnect.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.log(`You have been disconnected at ${new Date()}.`.red) 4 | } 5 | /** 6 | * @INFO 7 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 8 | * @INFO 9 | * Work for Milrato Development | https://milrato.eu 10 | * @INFO 11 | * Please mention Him / Milrato Development, when using this Code! 12 | * @INFO 13 | */ 14 | -------------------------------------------------------------------------------- /bots/waitingroombot/events/client/error.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.error(); 4 | } 5 | /** 6 | * @INFO 7 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 8 | * @INFO 9 | * Work for Milrato Development | https://milrato.eu 10 | * @INFO 11 | * Please mention Him / Milrato Development, when using this Code! 12 | * @INFO 13 | */ 14 | -------------------------------------------------------------------------------- /bots/waitingroombot/events/client/ready.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | const config = require("../../botconfig/config.json") 3 | module.exports = client => { 4 | try{ 5 | const stringlength = 69; 6 | console.log("\n") 7 | console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.brightGreen) 8 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 9 | console.log(` ┃ `.bold.brightGreen + `Discord Bot is online!`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-`Discord Bot is online!`.length)+ "┃".bold.brightGreen) 10 | console.log(` ┃ `.bold.brightGreen + ` /--/ ${client.user.tag} /--/ `.bold.brightGreen+ " ".repeat(-1+stringlength-` ┃ `.length-` /--/ ${client.user.tag} /--/ `.length)+ "┃".bold.brightGreen) 11 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 12 | console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.brightGreen) 13 | }catch{ /* */ } 14 | 15 | try{ 16 | client.user.setActivity(client.user.username, { type: "PLAYING" }); 17 | }catch (e) { 18 | console.log(String(e.stack).red); 19 | } 20 | //Change status each 10 minutes 21 | setTimeout(()=>{ 22 | try{ 23 | client.user.setActivity(client.user.username, { type: "PLAYING" }); 24 | }catch (e) { 25 | console.log(String(e.stack).red); 26 | } 27 | }, 10*60*1000) 28 | } 29 | /** 30 | * @INFO 31 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 32 | * @INFO 33 | * Work for Milrato Development | https://milrato.eu 34 | * @INFO 35 | * Please mention Him / Milrato Development, when using this Code! 36 | * @INFO 37 | */ 38 | -------------------------------------------------------------------------------- /bots/waitingroombot/events/client/reconnecting.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.log(`Reconnceting at ${new Date()}.`.bgYellow.black) 4 | } 5 | 6 | /** 7 | * @INFO 8 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 9 | * @INFO 10 | * Work for Milrato Development | https://milrato.eu 11 | * @INFO 12 | * Please mention Him / Milrato Development, when using this Code! 13 | * @INFO 14 | */ 15 | -------------------------------------------------------------------------------- /bots/waitingroombot/events/client/warn.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.warn(); 4 | } 5 | /** 6 | * @INFO 7 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 8 | * @INFO 9 | * Work for Milrato Development | https://milrato.eu 10 | * @INFO 11 | * Please mention Him / Milrato Development, when using this Code! 12 | * @INFO 13 | */ 14 | -------------------------------------------------------------------------------- /bots/waitingroombot/handlers/command.js: -------------------------------------------------------------------------------- 1 | const { readdirSync } = require("fs"); 2 | const ascii = require("ascii-table"); 3 | let table = new ascii("Commands"); 4 | table.setHeading("Command", "Load status"); 5 | console.log("Welcome to SERVICE HANDLER /--/ By https://milrato.eu /--/ Discord: Tomato#6966".yellow); 6 | module.exports = (client) => { 7 | try{ 8 | readdirSync("./commands/").forEach((dir) => { 9 | const commands = readdirSync(`./commands/${dir}/`).filter((file) => file.endsWith(".js")); 10 | for (let file of commands) { 11 | let pull = require(`../commands/${dir}/${file}`); 12 | if (pull.name) { 13 | client.commands.set(pull.name, pull); 14 | table.addRow(file, "Ready"); 15 | } else { 16 | table.addRow(file, `error->missing a help.name,or help.name is not a string.`); 17 | continue; 18 | } 19 | if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach((alias) => client.aliases.set(alias, pull.name)); 20 | } 21 | }); 22 | console.log(table.toString().cyan); 23 | }catch (e){ 24 | console.log(String(e.stack).bgRed) 25 | } 26 | }; 27 | /** 28 | * @INFO 29 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 30 | * @INFO 31 | * Work for Milrato Development | https://milrato.eu 32 | * @INFO 33 | * Please mention Him / Milrato Development, when using this Code! 34 | * @INFO 35 | */ 36 | -------------------------------------------------------------------------------- /bots/waitingroombot/handlers/events.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const ascii = require("ascii-table"); 3 | let table = new ascii("Events"); 4 | table.setHeading("Events", "Load status"); 5 | const allevents = []; 6 | module.exports = async (client) => { 7 | try{ 8 | const load_dir = (dir) => { 9 | const event_files = fs.readdirSync(`./events/${dir}`).filter((file) => file.endsWith(".js")); 10 | for (const file of event_files){ 11 | const event = require(`../events/${dir}/${file}`) 12 | let eventName = file.split(".")[0]; 13 | allevents.push(eventName); 14 | client.on(eventName, event.bind(null, client)); 15 | } 16 | } 17 | await ["client", "guild"].forEach(e=>load_dir(e)); 18 | for (let i = 0; i < allevents.length; i++) { 19 | try { 20 | table.addRow(allevents[i], "Ready"); 21 | } catch (e) { 22 | console.log(String(e.stack).red); 23 | } 24 | } 25 | console.log(table.toString().cyan); 26 | try{ 27 | const stringlength = 69; 28 | console.log("\n") 29 | console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.brightGreen) 30 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 31 | console.log(` ┃ `.bold.brightGreen + `Welcome to SERVICE HANDLER!`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-`Welcome to SERVICE HANDLER!`.length)+ "┃".bold.brightGreen) 32 | console.log(` ┃ `.bold.brightGreen + ` /-/ By https://milrato.eu /-/`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-` /-/ By https://milrato.eu /-/`.length)+ "┃".bold.brightGreen) 33 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 34 | console.log(` ┃ `.bold.brightGreen + ` /-/ Discord: Tomato#6966 /-/`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-` /-/ By Discord: Tomato#6966 /-/`.length)+ " ┃".bold.brightGreen) 35 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 36 | console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.brightGreen) 37 | }catch{ /* */ } 38 | try{ 39 | const stringlength2 = 69; 40 | console.log("\n") 41 | console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.yellow) 42 | console.log(` ┃ `.bold.yellow + " ".repeat(-1+stringlength2-` ┃ `.length)+ "┃".bold.yellow) 43 | console.log(` ┃ `.bold.yellow + `Logging into the BOT...`.bold.yellow + " ".repeat(-1+stringlength2-` ┃ `.length-`Logging into the BOT...`.length)+ "┃".bold.yellow) 44 | console.log(` ┃ `.bold.yellow + " ".repeat(-1+stringlength2-` ┃ `.length)+ "┃".bold.yellow) 45 | console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.yellow) 46 | }catch{ /* */ } 47 | }catch (e){ 48 | console.log(String(e.stack).bgRed) 49 | } 50 | }; 51 | /** 52 | * @INFO 53 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 54 | * @INFO 55 | * Work for Milrato Development | https://milrato.eu 56 | * @INFO 57 | * Please mention Him / Milrato Development, when using this Code! 58 | * @INFO 59 | */ 60 | -------------------------------------------------------------------------------- /bots/waitingroombot/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @INFO 3 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 4 | * @INFO 5 | * Work for Milrato Development | https://milrato.eu 6 | * @INFO 7 | * Please mention Him / Milrato Development, when using this Code! 8 | * @INFO 9 | */ 10 | //Importing all needed Commands 11 | const Discord = require("discord.js"); //this is the official discord.js wrapper for the Discord Api, which we use! 12 | const colors = require("colors"); //this Package is used, to change the colors of our Console! (optional and doesnt effect performance) 13 | const fs = require("fs"); //this package is for reading files and getting their inputs 14 | //Creating the Discord.js Client for This Bot with some default settings ;) and with partials, so you can fetch OLD messages 15 | const client = new Discord.Client({ 16 | messageCacheLifetime: 60, 17 | fetchAllMembers: false, 18 | messageCacheMaxSize: 10, 19 | restTimeOffset: 0, 20 | restWsBridgetimeout: 100, 21 | disableEveryone: true, 22 | partials: ['MESSAGE', 'CHANNEL', 'REACTION'] 23 | }); 24 | //Client variables to use everywhere 25 | client.commands = new Discord.Collection(); //an collection (like a digital map(database)) for all your commands 26 | client.aliases = new Discord.Collection(); //an collection for all your command-aliases 27 | client.categories = fs.readdirSync("./commands/"); //categories 28 | client.cooldowns = new Discord.Collection(); //an collection for cooldown commands of each user 29 | 30 | //Loading files, with the client variable like Command Handler, Event Handler, ... 31 | ["command", "events"].forEach(handler => { 32 | require(`./handlers/${handler}`)(client); 33 | }); 34 | //Loading files, with the client variable like Command Handler, Event Handler, ... 35 | ["radiomodule"].forEach(handler => { 36 | require(`./modules/${handler}`)(client); 37 | }); 38 | //login into the bot 39 | client.login(require("./botconfig/config.json").token); 40 | /** 41 | * @INFO 42 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 43 | * @INFO 44 | * Work for Milrato Development | https://milrato.eu 45 | * @INFO 46 | * Please mention Him / Milrato Development, when using this Code! 47 | * @INFO 48 | */ 49 | -------------------------------------------------------------------------------- /bots/waitingroombot/modules/radiomodule.js: -------------------------------------------------------------------------------- 1 | const config = require("../botconfig/config.json"); 2 | module.exports = function (client) { 3 | try{ 4 | setTimeout(() => { 5 | radioexecuteadmin(); 6 | }, 1000); //delay 7 | 8 | setInterval(() => { 9 | check(); 10 | }, 15000); //delay 11 | 12 | //log if someone joins a channel 13 | client.on('voiceStateUpdate',async (oldState, newState) => { 14 | try { 15 | if(newState.channel.id === config.channel && newState.guild.id === config.guild) { 16 | if(newState.member.id === client.user.id) return; //if its the bot return 17 | if (newState.guild.me.speaking) return; //if the bot is already speaking return 18 | if(newState.member.user.bot) return; //if its a bot return 19 | radioexecuteadmin(); 20 | } 21 | }catch (e){ 22 | } 23 | }); 24 | 25 | //checke alle 30 sekunden ob connected für radio 26 | async function check(){ 27 | try{ 28 | let guild = client.guilds.cache.get(config.guild); //get the guild 29 | if(!guild.me.voice.channel) { 30 | radioexecuteadmin(); 31 | } 32 | }catch (e){ 33 | } 34 | } 35 | 36 | //PLAY THE RADIO 37 | async function radioexecuteadmin() { 38 | try{ 39 | //get the voice channel 40 | const channel = await client.channels.fetch(config.channel); 41 | if(channel) console.log(`Connecting to: ${channel.name}`) 42 | //join the channel 43 | await channel.leave(); 44 | await new Promise(resolve=>{ 45 | setTimeout(()=>{ 46 | resolve(2); 47 | },500) 48 | }) 49 | await channel.join() 50 | .then(cnc => { 51 | cnc.voice.setSelfDeaf(true); //set self deaf 52 | cnc.voice.setDeaf(true); //set server self deaf 53 | cnc.play(config.radiostation ? config.radiostation : "https://stream-mz.planetradio.co.uk/net2national.mp3") //play the stream 54 | .setVolumeLogarithmic(45 / 100) //change volume to 30% 55 | }); 56 | }catch (e){ 57 | } 58 | } 59 | }catch (e){ 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /bots/waitingroombot/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "discord-js-handler-template", 3 | "version": "1.0.0", 4 | "description": "Discord.js Command and Event Handler Template with example Command usages! For Questions: https://discord.gg/fS6qBSm", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node index.js" 9 | }, 10 | "author": "Tomato#6966", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@discordjs/opus": "^0.4.0", 14 | "ascii-table": "0.0.9", 15 | "discord.js": "^12.5.1" 16 | }, 17 | "devDependencies": { 18 | "ascii-table": "0.0.9", 19 | "colors": "^1.4.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /commands/⛔️ Admin/embed.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "embed", 6 | category: "⛔️ Admin", 7 | aliases: ["say-embed"], 8 | cooldown: 2, 9 | usage: "embed <TITLE> ++ <DESCRIPTION>", 10 | description: "Resends a message from u as an Embed", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | if(!args[0]) 14 | return message.channel.send(new MessageEmbed() 15 | .setColor(ee.wrongcolor) 16 | .setFooter(ee.footertext, ee.footericon) 17 | .setTitle(`❌ ERROR | You didn't provided a Title, nor a Description`) 18 | .setDescription(`Usage: \`${prefix}embed <TITLE> ++ <DESCRIPTION>\``) 19 | ); 20 | let userargs = args.join(" ").split("++"); 21 | let title = userargs[0]; 22 | let desc = userargs.slice(1).join(" ") 23 | message.channel.send(new MessageEmbed() 24 | .setColor(ee.color) 25 | .setFooter(message.guild.name, message.guild.iconURL({dynamic: true})) 26 | .setTitle(title ? title : "") 27 | .setDescription(desc ? desc : "") 28 | ) 29 | } catch (e) { 30 | console.log(String(e.stack).bgRed) 31 | return message.channel.send(new MessageEmbed() 32 | .setColor(ee.wrongcolor) 33 | .setFooter(ee.footertext, ee.footericon) 34 | .setTitle(`❌ ERROR | An error occurred`) 35 | .setDescription(`\`\`\`${e.message}\`\`\``) 36 | ); 37 | } 38 | } 39 | } 40 | /** 41 | * @INFO 42 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 43 | * @INFO 44 | * Work for Milrato Development | https://milrato.eu 45 | * @INFO 46 | * Please mention Him / Milrato Development, when using this Code! 47 | * @INFO 48 | */ 49 | -------------------------------------------------------------------------------- /commands/⛔️ Admin/prefix.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "prefix", 6 | aliases: ["prefix"], 7 | category: "⛔️ Admin", 8 | description: "Let's you change the Prefix of the BOT", 9 | usage: "prefix <NEW PREFIX>", 10 | memberpermissions: ["ADMINISTRATOR"], 11 | run: async (client, message, args) => { 12 | try{ 13 | //get the current prefix from the database 14 | let prefix = client.settings.get(message.guild.id, `prefix`); 15 | //if not in the database for some reason use the default prefix 16 | if (prefix === null) prefix = config.prefix; 17 | //if no args return error 18 | if (!args[0]) 19 | return message.channel.send(new MessageEmbed() 20 | .setColor(ee.wrongcolor) 21 | .setFooter(ee.footertext, ee.footericon) 22 | .setTitle("❌ Error | Please provide a new prefix!") 23 | .setDescription(`Current prefix: \`${prefix}\``) 24 | ); 25 | //if there are multiple arguments 26 | if (args[1]) 27 | return message.channel.send(new MessageEmbed() 28 | .setColor(ee.wrongcolor) 29 | .setFooter(ee.footertext, ee.footericon) 30 | .setTitle("❌ Error | The prefix can\'t have two spaces") 31 | ); 32 | //if the prefix is too long 33 | if (args[0].length > 5) 34 | return message.channel.send(new MessageEmbed() 35 | .setColor(ee.wrongcolor) 36 | .setFooter(ee.footertext, ee.footericon) 37 | .setTitle("❌ Error | The prefix can\'t be Longer then `5`") 38 | ); 39 | //set the new prefix 40 | client.settings.set(message.guild.id, args[0], `prefix`); 41 | //return success embed 42 | return message.channel.send(new MessageEmbed() 43 | .setColor(ee.color) 44 | .setFooter(ee.footertext, ee.footericon) 45 | .setTitle(`✅ Success | Set new prefix to **\`${args[0]}\`**`) 46 | ); 47 | } catch (e) { 48 | console.log(String(e.stack).bgRed) 49 | return message.channel.send(new MessageEmbed() 50 | .setColor(ee.wrongcolor) 51 | .setFooter(ee.footertext, ee.footericon) 52 | .setTitle(`❌ ERROR | An error occurred`) 53 | .setDescription(`\`\`\`${e.message}\`\`\``) 54 | ); 55 | } 56 | } 57 | }; 58 | /** 59 | * @INFO 60 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/discord-js-lavalink-Music-Bot-erela-js 61 | * @INFO 62 | * Work for Milrato Development | https://milrato.eu 63 | * @INFO 64 | * Please mention Him / Milrato Development, when using this Code! 65 | * @INFO 66 | */ 67 | -------------------------------------------------------------------------------- /commands/⛔️ Admin/say.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "say", 6 | category: "⛔️ Admin", 7 | aliases: [""], 8 | cooldown: 2, 9 | usage: "say <TEXT>", 10 | description: "Resends your Text", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | if(!args[0]) 14 | return message.channel.send(new MessageEmbed() 15 | .setColor(ee.wrongcolor) 16 | .setFooter(ee.footertext, ee.footericon) 17 | .setTitle(`❌ ERROR | You didn't provided a Text`) 18 | .setDescription(`Usage: \`${prefix}say <Your Text>\``) 19 | ); 20 | message.channel.send(text); 21 | } catch (e) { 22 | console.log(String(e.stack).bgRed) 23 | return message.channel.send(new MessageEmbed() 24 | .setColor(ee.wrongcolor) 25 | .setFooter(ee.footertext, ee.footericon) 26 | .setTitle(`❌ ERROR | An error occurred`) 27 | .setDescription(`\`\`\`${e.message}\`\`\``) 28 | ); 29 | } 30 | } 31 | } 32 | /** 33 | * @INFO 34 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 35 | * @INFO 36 | * Work for Milrato Development | https://milrato.eu 37 | * @INFO 38 | * Please mention Him / Milrato Development, when using this Code! 39 | * @INFO 40 | */ 41 | -------------------------------------------------------------------------------- /commands/🔰 Info/botinfo.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | let os = require("os"); 3 | let cpuStat = require("cpu-stat"); 4 | const config = require("../../botconfig/config.json"); 5 | const ee = require("../../botconfig/embed.json"); 6 | const {duration } = require("../../handlers/functions") 7 | module.exports = { 8 | name: "botinfo", 9 | aliases: ["info"], 10 | category: "🔰 Info", 11 | description: "Sends detailed info about the client", 12 | usage: "botinfo", 13 | run: async (client, message, args, cmduser, text, prefix) => { 14 | try{ 15 | cpuStat.usagePercent(function (e, percent, seconds) { 16 | if (e) { 17 | return console.log(String(e.stack).red); 18 | } 19 | const Duration = duration(client.uptime) 20 | let connectedchannelsamount = 0; 21 | let guilds = client.guilds.cache.map((guild) => guild); 22 | for (let i = 0; i < guilds.length; i++) { 23 | if (guilds[i].me.voice.channel) connectedchannelsamount += 1; 24 | } 25 | const botinfo = new Discord.MessageEmbed() 26 | .setAuthor(client.user.username, client.user.displayAvatarURL()) 27 | .setTitle("__**Stats:**__") 28 | .setColor(ee.color) 29 | .addField("⏳ Memory Usage", `\`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}/ ${(os.totalmem() / 1024 / 1024).toFixed(2)}MB\``, true) 30 | .addField("⌚️ Uptime ", `\`${Duration}\``, true) 31 | .addField("\u200b", `\u200b`, true) 32 | .addField("📁 Users", `\`${client.users.cache.size}\``, true) 33 | .addField("📁 Servers", `\`${client.guilds.cache.size}\``, true) 34 | .addField("\u200b", `\u200b`, true) 35 | .addField("📁 Voice-Channels", `\`${client.channels.cache.filter((ch) => ch.type === "voice").size}\``, true) 36 | .addField("📁 Connected Channels", `\`${connectedchannelsamount}\``, true) 37 | .addField("\u200b", `\u200b`, true) 38 | .addField("👾 Discord.js", `\`v${Discord.version}\``, true) 39 | .addField("🤖 Node", `\`${process.version}\``, true) 40 | .addField("\u200b", `\u200b`, true) 41 | .addField("🤖 CPU", `\`\`\`md\n${os.cpus().map((i) => `${i.model}`)[0]}\`\`\``) 42 | .addField("🤖 CPU usage", `\`${percent.toFixed(2)}%\``, true) 43 | .addField("🤖 Arch", `\`${os.arch()}\``, true) 44 | .addField("\u200b", `\u200b`, true) 45 | .addField("💻 Platform", `\`\`${os.platform()}\`\``, true) 46 | .addField("API Latency", `\`${client.ws.ping}ms\``, true) 47 | .setFooter("Coded by: Tomato#6966"); 48 | message.channel.send(botinfo); 49 | }); 50 | } catch (e) { 51 | console.log(String(e.stack).bgRed) 52 | return message.channel.send(new MessageEmbed() 53 | .setColor(ee.wrongcolor) 54 | .setFooter(ee.footertext, ee.footericon) 55 | .setTitle(`❌ ERROR | An error occurred`) 56 | .setDescription(`\`\`\`${e.message}\`\`\``) 57 | ); 58 | } 59 | }, 60 | }; 61 | /** 62 | * @INFO 63 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/discord-js-lavalink-Music-Bot-erela-js 64 | * @INFO 65 | * Work for Milrato Development | https://milrato.eu 66 | * @INFO 67 | * Please mention Him / Milrato Development, when using this Code! 68 | * @INFO 69 | */ 70 | -------------------------------------------------------------------------------- /commands/🔰 Info/developer.js: -------------------------------------------------------------------------------- 1 | const {MessageEmbed} =require("discord.js") 2 | const config = require("../../botconfig/config.json") 3 | const ee = require("../../botconfig/embed.json") 4 | module.exports = { 5 | name: "developer", 6 | category: "🔰 Info", 7 | aliases: ["dev", "tomato"], 8 | description: "Shows Information about the Developer", 9 | useage: "developer", 10 | run: async (client, message, args) => { 11 | try{ 12 | message.channel.send(new MessageEmbed() 13 | .setColor(ee.color) 14 | .setFooter(ee.footertext + " | Sponsor: Bittmax.de | Code 'x10' == -5%", ee.footericon) 15 | .setTimestamp() 16 | .setThumbnail("https://cdn.discordapp.com/avatars/442355791412854784/17ccf170d62e5e0040660d003b075528.webp") 17 | .setTitle("Tomato#6966 | Dev of 3 Orgs | Developer of 200+ BOTS") 18 | .setURL("https://musicium.eu") 19 | .setDescription(` 20 | > Hello I am **Tomato** <@442355791412854784> *(\`Tomato#6966\`)*, and i made more then 200 different Discord Bots: [My Bot List](https://bots.musicium.eu) 21 | 22 | > I am very proud for all of my verified and not verified Discord Bots, but the Bot I am the most proud of is: [**Musicium** | \`Ultimate Music experience\`](https://musicium.eu) <@769642999227351070> 23 | 24 | > I made this Bot, and you can get a free Bot too! Just go to: [My Service](https://milrato) 25 | 26 | > I am also a **Website** Developer and **Plugin** dev. I made **Modules** like a **SPEECH Module** [SEE IT](https://cdn.discordapp.com/attachments/778714123785076768/801606374105546782/2021-01-21_01-15-50.mp4) 27 | 28 | > Yeah i hope you like my stuff :v: <3`) 29 | ).catch(error => console.log(error)); 30 | } catch (e) { 31 | console.log(String(e.stack).bgRed) 32 | return message.channel.send(new MessageEmbed() 33 | .setColor(ee.wrongcolor) 34 | .setFooter(ee.footertext, ee.footericon) 35 | .setTitle(`❌ ERROR | An error occurred`) 36 | .setDescription(`\`\`\`${e.message}\`\`\``) 37 | ); 38 | } 39 | } 40 | } 41 | /** 42 | * @INFO 43 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/discord-js-lavalink-Music-Bot-erela-js 44 | * @INFO 45 | * Work for Milrato Development | https://milrato.eu 46 | * @INFO 47 | * Please mention Him / Milrato Development, when using this Code! 48 | * @INFO 49 | */ 50 | -------------------------------------------------------------------------------- /commands/🔰 Info/github.js: -------------------------------------------------------------------------------- 1 | const {MessageEmbed} = require("discord.js") 2 | const config = require("../../botconfig/config.json") 3 | const ee = require("../../botconfig/embed.json") 4 | module.exports = { 5 | name: "github", 6 | category: "🔰 Info", 7 | aliases: ["git", "source"], 8 | cooldown: 2, 9 | usage: "github", 10 | description: "Shows you the Github and Source Code Information about this Bot", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | message.channel.send(new MessageEmbed() 14 | .setTitle(`This Bot is made by \`Tomato#6966\` and **this** is the Source Code link to this Bot`) 15 | .setURL("https://github.com/Tomato6966/discord-bot-maker/tree/main") 16 | .addField("Discord.js: ", "[\`v12.5.1\`](https://discord.js.org)", true) 17 | .addField("Node.js: ", "[\`v15.3.4\`](https://nodejs.org/en/)", true) 18 | .addField("file_system of nodejs: ", "To Create the BOTS", true) 19 | .addField("Source Code. ", "Don't just use the source for yourself,... please [invite](https://discord.com/api/oauth2/authorize?client_id=816963140054679562&permissions=51200&scope=bot) me too![\`Click here\`](https://github.com/Tomato6966/discord-bot-maker/tree/main)") 20 | .setColor(ee.color) 21 | .setFooter(ee.footertext, ee.footericon) 22 | ); 23 | } catch (e) { 24 | console.log(String(e.stack).bgRed) 25 | return message.channel.send(new MessageEmbed() 26 | .setColor(ee.wrongcolor) 27 | .setFooter(ee.footertext, ee.footericon) 28 | .setTitle(`❌ ERROR | An error occurred`) 29 | .setDescription(`\`\`\`${e.message}\`\`\``) 30 | ); 31 | } 32 | } 33 | } 34 | /** 35 | * @INFO 36 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/discord-js-lavalink-Music-Bot-erela-js 37 | * @INFO 38 | * Work for Milrato Development | https://milrato.eu 39 | * @INFO 40 | * Please mention Him / Milrato Development, when using this Code! 41 | * @INFO 42 | */ 43 | -------------------------------------------------------------------------------- /commands/🔰 Info/invite.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "invite", 6 | category: "🔰 Info", 7 | aliases: ["add"], 8 | cooldown: 5, 9 | usage: "invite", 10 | description: "Gives you an Invite link for this Bot", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | message.channel.send(new MessageEmbed() 14 | .setColor(ee.color) 15 | .setTitle(":heart: Thanks for inviting me!") 16 | .setFooter(ee.footertext, ee.footericon) 17 | .setURL("https://discord.com/api/oauth2/authorize?client_id=816963140054679562&permissions=51200&scope=bot") 18 | .setDescription("[Click here](https://discord.com/api/oauth2/authorize?client_id=816963140054679562&permissions=51200&scope=bot)") 19 | ); 20 | } catch (e) { 21 | console.log(String(e.stack).bgRed) 22 | return message.channel.send(new MessageEmbed() 23 | .setColor(ee.wrongcolor) 24 | .setFooter(ee.footertext, ee.footericon) 25 | .setTitle(`❌ ERROR | An error occurred`) 26 | .setDescription(`\`\`\`${e.message}\`\`\``) 27 | ); 28 | } 29 | } 30 | } 31 | /** 32 | * @INFO 33 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/discord-js-lavalink-Music-Bot-erela-js 34 | * @INFO 35 | * Work for Milrato Development | https://milrato.eu 36 | * @INFO 37 | * Please mention Him / Milrato Development, when using this Code! 38 | * @INFO 39 | */ 40 | -------------------------------------------------------------------------------- /commands/🔰 Info/ping.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "ping", 6 | category: "🔰 Info", 7 | aliases: ["latency"], 8 | cooldown: 2, 9 | usage: "ping", 10 | description: "Gives you information on how fast the Bot can respond to you", 11 | run: async (client, message, args, user, text, prefix) => { 12 | try{ 13 | message.channel.send(new MessageEmbed() 14 | .setColor(ee.color) 15 | .setFooter(ee.footertext, ee.footericon) 16 | .setTitle(`🏓 Pinging....`) 17 | ).then(msg=>{ 18 | msg.edit(new MessageEmbed() 19 | .setColor(ee.color) 20 | .setFooter(ee.footertext, ee.footericon) 21 | .setTitle(`🏓 Ping is \`${Math.round(client.ws.ping)}ms\``) 22 | ); 23 | }) 24 | } catch (e) { 25 | console.log(String(e.stack).bgRed) 26 | return message.channel.send(new MessageEmbed() 27 | .setColor(ee.wrongcolor) 28 | .setFooter(ee.footertext, ee.footericon) 29 | .setTitle(`❌ ERROR | An error occurred`) 30 | .setDescription(`\`\`\`${e.message}\`\`\``) 31 | ); 32 | } 33 | } 34 | } 35 | /** 36 | * @INFO 37 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 38 | * @INFO 39 | * Work for Milrato Development | https://milrato.eu 40 | * @INFO 41 | * Please mention Him / Milrato Development, when using this Code! 42 | * @INFO 43 | */ 44 | -------------------------------------------------------------------------------- /commands/🔰 Info/serverinfo.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | const config = require("../../botconfig/config.json") 3 | const ee = require("../../botconfig/embed.json") 4 | module.exports = { 5 | name: "serverinfo", 6 | aliases: ["sinfo"], 7 | category: "🔰 Info", 8 | description: "Shows info about a server", 9 | usage: "serverinfo", 10 | run: async (client, message, args, cmduser, text, prefix) => { 11 | try{ 12 | message.channel.send(new Discord.MessageEmbed() 13 | .setTitle("Server Information") 14 | .setColor(ee.color) 15 | .addField("Server Name", "\`" + message.guild.name + "\`") 16 | .addField("Owner", "\`" + `${message.guild.owner.user.username}#${message.guild.owner.user.discriminator}\`"`, true) 17 | .addField("Channels", "\`" + message.guild.channels.cache.size + "\`", true) 18 | .addField("Roles", "\`" + message.guild.roles.cache.size + "\`", true) 19 | .addField("Created On", "\`" + message.guild.createdAt + "\`") 20 | .addField("You Joined", "\`" + message.member.joinedAt + "\`") 21 | .addField("Total Members", "\`" + message.guild.memberCount + "\`") 22 | .setThumbnail(message.guild.iconURL({dynamic: true })) 23 | .setTimestamp() 24 | .setFooter(message.guild.name, message.guild.iconURL({dynamic: true}))); 25 | } catch (e) { 26 | console.log(String(e.stack).bgRed) 27 | return message.channel.send(new MessageEmbed() 28 | .setColor(ee.wrongcolor) 29 | .setFooter(ee.footertext, ee.footericon) 30 | .setTitle(`❌ ERROR | An error occurred`) 31 | .setDescription(`\`\`\`${e.message}\`\`\``) 32 | ); 33 | } 34 | } 35 | } 36 | /** 37 | * @INFO 38 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/discord-js-lavalink-Music-Bot-erela-js 39 | * @INFO 40 | * Work for Milrato Development | https://milrato.eu 41 | * @INFO 42 | * Please mention Him / Milrato Development, when using this Code! 43 | * @INFO 44 | */ 45 | -------------------------------------------------------------------------------- /commands/🔰 Info/sponsor.js: -------------------------------------------------------------------------------- 1 | const {MessageEmbed} =require("discord.js") 2 | const config = require("../../botconfig/config.json") 3 | const ee = require("../../botconfig/embed.json") 4 | module.exports = { 5 | name: "sponsor", 6 | category: "🔰 Info", 7 | aliases: [""], 8 | description: "Shows the sponsor of this BoT", 9 | useage: "sponsor", 10 | run: async (client, message, args) => { 11 | try{ 12 | message.channel.send(new MessageEmbed() 13 | .setColor(ee.color) 14 | .setTimestamp() 15 | .setFooter("Bittmax.de | Code 'x10' == -5%", "https://cdn.discordapp.com/icons/784157254847954964/482b9e96414509756fc0192829382776.webp") 16 | .setImage("https://cdn.discordapp.com/attachments/781568883051462666/800441576442691644/bittmax.png") 17 | .setTitle("Milrato | Service -- Bittmax") 18 | .setURL("https://milrato.eu") 19 | .setDescription(` 20 | > [Milrato Service](https://discord.gg/terWzJjF7p) made this Bot for us. It is free and also hosted on their sponsor: [Bittmax.de](https://bittmax.de) 21 | 22 | > If you use the code: **\`x10\`** their, then you'll get at least 5% off everything! 23 | 24 | > Check out their [Service-Website](https://milrato) and their [Discord](https://discord.gg/terWzJjF7p) to get your own Bot too! 25 | 26 | > It's hosted **24/7**, as already said, thanks to their Sponsor [**Bittmax.de**](https://bittmax.de)!`) 27 | ).catch(e => console.log(String(e.stack).yellow)); 28 | message.channel.send(new Discord.MessageEmbed() 29 | .setColor(ee.color) 30 | .setTitle("Mc-Host24.de | German Hosting") 31 | .setURL("https://mc-host24.de") 32 | .setDescription(` 33 | Second Sponsor of This Bot is: 34 | **MC-HOST24** THE BEST MC HOSTER 35 | > MC-HOST24.de is sponsoring them with some monthly Money, 36 | > Thanks to them, they able to host their Website and GAME SERVERS 37 | > Our suggestion is, if you want to host games / Websites, then go to [mc-host24.de](https://mc-host24.de/user/affiliate/3121) 38 | 39 | **What they are offering:** 40 | > **>>** Minecraft Hosting, CounterStrike: Global Offensive, Garry's Mod, ARK, ARMA 3, ... 41 | > **>>** Cheap and fast Domains 42 | > **>>** WEBHOSTING 43 | > **>>** TEAMSPEAK SERVERS 44 | > **>>** Linux & Windows Root Servers 45 | 46 | [**Discord Server:**](https://discord.com/invite/4dGuGXK4A4) 47 | [**Website:**](https://mc-host24.de/user/affiliate/3121) 48 | [**__SPONSOR LINK!__**](https://mc-host24.de/donate/tomato) 49 | `) 50 | .setImage("https://cdn.discordapp.com/attachments/758007636720353380/758055267735699618/MC-HOST24-Logo-24-fett.png") 51 | .setFooter("Mc-Host24", "https://cdn.discordapp.com/icons/619465432293965864/4c101b43466708cec4506938154a4e34.webp") 52 | ).catch(e => console.log(String(e.stack).yellow)); 53 | } catch (e) { 54 | console.log(String(e.stack).bgRed) 55 | return message.channel.send(new MessageEmbed() 56 | .setColor(ee.wrongcolor) 57 | .setFooter(ee.footertext, ee.footericon) 58 | .setTitle(`❌ ERROR | An error occurred`) 59 | .setDescription(`\`\`\`${e.message}\`\`\``) 60 | ); 61 | } 62 | } 63 | } 64 | /** 65 | * @INFO 66 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/discord-js-lavalink-Music-Bot-erela-js 67 | * @INFO 68 | * Work for Milrato Development | https://milrato.eu 69 | * @INFO 70 | * Please mention Him / Milrato Development, when using this Code! 71 | * @INFO 72 | */ 73 | -------------------------------------------------------------------------------- /commands/🔰 Info/stats.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const { duration } = require("../../handlers/functions") 5 | module.exports = { 6 | name: "stats", 7 | category: "🔰 Info", 8 | aliases: [""], 9 | cooldown: 10, 10 | usage: "stats", 11 | description: "Shows Bot Stats", 12 | run: async (client, message, args, user, text, prefix) => { 13 | try{ 14 | let botssize = 0; 15 | let waitingroombots = 0; 16 | let jointocreatebots = 0; 17 | let discordjshandlers = 0; 18 | let musicbots = 0; 19 | for(const gid of client.guilds.cache.map(g => g.id)){ 20 | try{ 21 | client.stats.ensure(gid, { 22 | commands: 0, 23 | Bots: 0, 24 | messages: 0, 25 | waitingroombot: 0, 26 | jointocreatebot: 0, 27 | discordjshandler: 0, 28 | musicbot: 0 29 | }) 30 | botssize += Math.ceil(client.stats.get(gid, "Bots")); 31 | waitingroombots += Math.ceil(client.stats.get(gid, "waitingroombot")); 32 | jointocreatebots += Math.ceil(client.stats.get(gid, "jointocreatebot")); 33 | discordjshandlers += Math.ceil(client.stats.get(gid, "discordjshandler")); 34 | musicbots += Math.ceil(client.stats.get(gid, "musicbot")); 35 | }catch{} 36 | } 37 | let global = client.stats.get("global"); 38 | let guild = client.stats.get(message.guild.id); 39 | message.channel.send(new MessageEmbed() 40 | .setColor(ee.color) 41 | .setFooter(ee.footertext, ee.footericon) 42 | .addField("⚙️ GLOBAL Commands used:", `>>> \`${global.commands} Commands\` used\nin **all** Servers`,true) 43 | .addField("📰 GLOBAL Setups created:", `>>> \`${botssize} Bots\` created in\n**all** Servers`,true) 44 | .addField("📰 Each Bot Setup Count:", `>>> \`${waitingroombots} Waitingroom Bots\`\n\`${jointocreatebots} Join to Create Bots\`\n\`${discordjshandlers} Discord js Handler Bots\`\n\`${musicbots} Music Bots\``) 45 | .addField("\u200b", "\u200b") 46 | .addField("⚙️ SERVER Commands used:", `>>> \`${guild.commands} Commands\` used in\n**this** Server`,true) 47 | .addField("📰 SERVER Setups created:", `>>> \`${client.stats.get(message.guild.id, "Bots")} Bots\` created in\n**this** Servers`,true) 48 | .addField("\u200b", "\u200b") 49 | .setTitle(`💿 The Stats of ${client.user.username}`) 50 | ); 51 | } catch (e) { 52 | console.log(String(e.stack).bgRed) 53 | return message.channel.send(new MessageEmbed() 54 | .setColor(ee.wrongcolor) 55 | .setFooter(ee.footertext, ee.footericon) 56 | .setTitle(`❌ ERROR | An error occurred`) 57 | .setDescription(`\`\`\`${e.message}\`\`\``) 58 | ); 59 | } 60 | } 61 | } 62 | /** 63 | * @INFO 64 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 65 | * @INFO 66 | * Work for Milrato Development | https://milrato.eu 67 | * @INFO 68 | * Please mention Him / Milrato Development, when using this Code! 69 | * @INFO 70 | */ 71 | -------------------------------------------------------------------------------- /commands/🔰 Info/uptime.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | const { duration } = require("../../handlers/functions") 5 | module.exports = { 6 | name: "uptime", 7 | category: "🔰 Info", 8 | aliases: [""], 9 | cooldown: 10, 10 | usage: "uptime", 11 | description: "Returns the duration on how long the Bot is online", 12 | run: async (client, message, args, user, text, prefix) => { 13 | try{ 14 | message.channel.send(new MessageEmbed() 15 | .setColor(ee.color) 16 | .setFooter(ee.footertext, ee.footericon) 17 | .setTitle(`:white_check_mark: **${client.user.username}** is since:\n ${duration(client.uptime)} online`) 18 | ); 19 | } catch (e) { 20 | console.log(String(e.stack).bgRed) 21 | return message.channel.send(new MessageEmbed() 22 | .setColor(ee.wrongcolor) 23 | .setFooter(ee.footertext, ee.footericon) 24 | .setTitle(`❌ ERROR | An error occurred`) 25 | .setDescription(`\`\`\`${e.message}\`\`\``) 26 | ); 27 | } 28 | } 29 | } 30 | /** 31 | * @INFO 32 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 33 | * @INFO 34 | * Work for Milrato Development | https://milrato.eu 35 | * @INFO 36 | * Please mention Him / Milrato Development, when using this Code! 37 | * @INFO 38 | */ 39 | -------------------------------------------------------------------------------- /commands/🔰 Info/userinfo.js: -------------------------------------------------------------------------------- 1 | const Discord = require("discord.js"); 2 | const config = require("../../botconfig/config.json"); 3 | const ee = require("../../botconfig/embed.json"); 4 | module.exports = { 5 | name: "userinfo", 6 | aliases: ["uinfo"], 7 | category: "🔰 Info", 8 | description: "Get information about a user", 9 | usage: "userinfo [@USER]", 10 | run: async (client, message, args, cmduser, text, prefix) => { 11 | try{ 12 | const user = message.mentions.users.first() || message.author; 13 | if (!user) 14 | return message.channel.send(new MessageEmbed() 15 | .setColor(ee.wrongcolor) 16 | .setFooter(ee.footertext, ee.footericon) 17 | .setTitle("❌ Error | Please Mention the User you wanna get Information about") 18 | ); 19 | message.channel.send(new Discord.MessageEmbed() 20 | .setTitle("User Info:") 21 | .addField("Full Username", `\`${user.tag}\``) 22 | .addField("ID", `\`${user.id}\``) 23 | .addField("Playing", `\`[ ${user.presence.activities} ]\``, true) 24 | .addField("Status", `\`${user.presence.status}\``, true) 25 | .addField("Joined Discord At",`\`${user.createdAt}\``) 26 | .setColor(ee.color) 27 | .setFooter(ee.footertext, ee.footericon) 28 | .setThumbnail(user.displayAvatarURL({dynamic: true, size: 1024})) 29 | ); 30 | } catch (e) { 31 | console.log(String(e.stack).bgRed) 32 | return message.channel.send(new MessageEmbed() 33 | .setColor(ee.wrongcolor) 34 | .setFooter(ee.footertext, ee.footericon) 35 | .setTitle(`❌ ERROR | An error occurred`) 36 | .setDescription(`\`\`\`${e.message}\`\`\``) 37 | ); 38 | } 39 | } 40 | } 41 | /** 42 | * @INFO 43 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/discord-js-lavalink-Music-Bot-erela-js 44 | * @INFO 45 | * Work for Milrato Development | https://milrato.eu 46 | * @INFO 47 | * Please mention Him / Milrato Development, when using this Code! 48 | * @INFO 49 | */ 50 | -------------------------------------------------------------------------------- /databases/settings/placeholder.txt: -------------------------------------------------------------------------------- 1 | enmap will create files once it's ensured! 2 | 3 | 4 | milrato.eu -------------------------------------------------------------------------------- /databases/stats/placeholder.txt: -------------------------------------------------------------------------------- 1 | enmap will create files once it's ensured! 2 | 3 | 4 | milrato.eu -------------------------------------------------------------------------------- /events/client/disconnect.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.log(`You have been disconnected at ${new Date()}.`.red) 4 | } 5 | /** 6 | * @INFO 7 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 8 | * @INFO 9 | * Work for Milrato Development | https://milrato.eu 10 | * @INFO 11 | * Please mention Him / Milrato Development, when using this Code! 12 | * @INFO 13 | */ 14 | -------------------------------------------------------------------------------- /events/client/error.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.error(); 4 | } 5 | /** 6 | * @INFO 7 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 8 | * @INFO 9 | * Work for Milrato Development | https://milrato.eu 10 | * @INFO 11 | * Please mention Him / Milrato Development, when using this Code! 12 | * @INFO 13 | */ 14 | -------------------------------------------------------------------------------- /events/client/ready.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | const config = require("../../botconfig/config.json") 3 | module.exports = client => { 4 | try{ 5 | const stringlength = 69; 6 | console.log("\n") 7 | console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.brightGreen) 8 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 9 | console.log(` ┃ `.bold.brightGreen + `Discord Bot is online!`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-`Discord Bot is online!`.length)+ "┃".bold.brightGreen) 10 | console.log(` ┃ `.bold.brightGreen + ` /--/ ${client.user.tag} /--/ `.bold.brightGreen+ " ".repeat(-1+stringlength-` ┃ `.length-` /--/ ${client.user.tag} /--/ `.length)+ "┃".bold.brightGreen) 11 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 12 | console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.brightGreen) 13 | }catch{ /* */ } 14 | 15 | try{ 16 | client.user.setActivity("b!help | milrato.eu | " + client.user.username, { type: "PLAYING" }); 17 | }catch (e) { 18 | console.log(String(e.stack).red); 19 | } 20 | //Change status each 10 minutes 21 | setInterval(()=>{ 22 | try{ 23 | client.user.setActivity("b!help | milrato.eu | " + client.user.username, { type: "PLAYING" }); 24 | }catch (e) { 25 | console.log(String(e.stack).red); 26 | } 27 | }, 15*1000) 28 | } 29 | /** 30 | * @INFO 31 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 32 | * @INFO 33 | * Work for Milrato Development | https://milrato.eu 34 | * @INFO 35 | * Please mention Him / Milrato Development, when using this Code! 36 | * @INFO 37 | */ 38 | -------------------------------------------------------------------------------- /events/client/reconnecting.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.log(`Reconnceting at ${new Date()}.`.bgYellow.black) 4 | } 5 | 6 | /** 7 | * @INFO 8 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 9 | * @INFO 10 | * Work for Milrato Development | https://milrato.eu 11 | * @INFO 12 | * Please mention Him / Milrato Development, when using this Code! 13 | * @INFO 14 | */ 15 | -------------------------------------------------------------------------------- /events/client/warn.js: -------------------------------------------------------------------------------- 1 | //here the event starts 2 | module.exports = client => { 3 | console.warn(); 4 | } 5 | /** 6 | * @INFO 7 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 8 | * @INFO 9 | * Work for Milrato Development | https://milrato.eu 10 | * @INFO 11 | * Please mention Him / Milrato Development, when using this Code! 12 | * @INFO 13 | */ 14 | -------------------------------------------------------------------------------- /handlers/command.js: -------------------------------------------------------------------------------- 1 | const { readdirSync } = require("fs"); 2 | const ascii = require("ascii-table"); 3 | let table = new ascii("Commands"); 4 | table.setHeading("Command", "Load status"); 5 | console.log("Welcome to SERVICE HANDLER /--/ By https://milrato.eu /--/ Discord: Tomato#6966".yellow); 6 | module.exports = (client) => { 7 | try{ 8 | readdirSync("./commands/").forEach((dir) => { 9 | const commands = readdirSync(`./commands/${dir}/`).filter((file) => file.endsWith(".js")); 10 | for (let file of commands) { 11 | let pull = require(`../commands/${dir}/${file}`); 12 | if (pull.name) { 13 | client.commands.set(pull.name, pull); 14 | table.addRow(file, "Ready"); 15 | } else { 16 | table.addRow(file, `error->missing a help.name,or help.name is not a string.`); 17 | continue; 18 | } 19 | if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach((alias) => client.aliases.set(alias, pull.name)); 20 | } 21 | }); 22 | console.log(table.toString().cyan); 23 | }catch (e){ 24 | console.log(String(e.stack).bgRed) 25 | } 26 | }; 27 | /** 28 | * @INFO 29 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 30 | * @INFO 31 | * Work for Milrato Development | https://milrato.eu 32 | * @INFO 33 | * Please mention Him / Milrato Development, when using this Code! 34 | * @INFO 35 | */ 36 | -------------------------------------------------------------------------------- /handlers/events.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const ascii = require("ascii-table"); 3 | let table = new ascii("Events"); 4 | table.setHeading("Events", "Load status"); 5 | const allevents = []; 6 | module.exports = async (client) => { 7 | try{ 8 | const load_dir = (dir) => { 9 | const event_files = fs.readdirSync(`./events/${dir}`).filter((file) => file.endsWith(".js")); 10 | for (const file of event_files){ 11 | const event = require(`../events/${dir}/${file}`) 12 | let eventName = file.split(".")[0]; 13 | allevents.push(eventName); 14 | client.on(eventName, event.bind(null, client)); 15 | } 16 | } 17 | await ["client", "guild"].forEach(e=>load_dir(e)); 18 | for (let i = 0; i < allevents.length; i++) { 19 | try { 20 | table.addRow(allevents[i], "Ready"); 21 | } catch (e) { 22 | console.log(String(e.stack).red); 23 | } 24 | } 25 | console.log(table.toString().cyan); 26 | try{ 27 | const stringlength = 69; 28 | console.log("\n") 29 | console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.brightGreen) 30 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 31 | console.log(` ┃ `.bold.brightGreen + `Welcome to SERVICE HANDLER!`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-`Welcome to SERVICE HANDLER!`.length)+ "┃".bold.brightGreen) 32 | console.log(` ┃ `.bold.brightGreen + ` /-/ By https://milrato.eu /-/`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-` /-/ By https://milrato.eu /-/`.length)+ "┃".bold.brightGreen) 33 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 34 | console.log(` ┃ `.bold.brightGreen + ` /-/ Discord: Tomato#6966 /-/`.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length-` /-/ By Discord: Tomato#6966 /-/`.length)+ " ┃".bold.brightGreen) 35 | console.log(` ┃ `.bold.brightGreen + " ".repeat(-1+stringlength-` ┃ `.length)+ "┃".bold.brightGreen) 36 | console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.brightGreen) 37 | }catch{ /* */ } 38 | try{ 39 | const stringlength2 = 69; 40 | console.log("\n") 41 | console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.yellow) 42 | console.log(` ┃ `.bold.yellow + " ".repeat(-1+stringlength2-` ┃ `.length)+ "┃".bold.yellow) 43 | console.log(` ┃ `.bold.yellow + `Logging into the BOT...`.bold.yellow + " ".repeat(-1+stringlength2-` ┃ `.length-`Logging into the BOT...`.length)+ "┃".bold.yellow) 44 | console.log(` ┃ `.bold.yellow + " ".repeat(-1+stringlength2-` ┃ `.length)+ "┃".bold.yellow) 45 | console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.yellow) 46 | }catch{ /* */ } 47 | }catch (e){ 48 | console.log(String(e.stack).bgRed) 49 | } 50 | }; 51 | /** 52 | * @INFO 53 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 54 | * @INFO 55 | * Work for Milrato Development | https://milrato.eu 56 | * @INFO 57 | * Please mention Him / Milrato Development, when using this Code! 58 | * @INFO 59 | */ 60 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @INFO 3 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 4 | * @INFO 5 | * Work for Milrato Development | https://milrato.eu 6 | * @INFO 7 | * Please mention Him / Milrato Development, when using this Code! 8 | * @INFO 9 | */ 10 | //Importing all needed Commands 11 | const Discord = require("discord.js"); //this is the official discord.js wrapper for the Discord Api, which we use! 12 | const colors = require("colors"); //this Package is used, to change the colors of our Console! (optional and doesnt effect performance) 13 | const fs = require("fs"); //this package is for reading files and getting their inputs 14 | //Creating the Discord.js Client for This Bot with some default settings ;) and with partials, so you can fetch OLD messages 15 | const client = new Discord.Client({ 16 | messageCacheLifetime: 60, 17 | fetchAllMembers: false, 18 | messageCacheMaxSize: 10, 19 | restTimeOffset: 0, 20 | restWsBridgetimeout: 100, 21 | disableEveryone: true, 22 | partials: ['MESSAGE', 'CHANNEL', 'REACTION'] 23 | }); 24 | //Client variables to use everywhere 25 | client.commands = new Discord.Collection(); //an collection (like a digital map(database)) for all your commands 26 | client.aliases = new Discord.Collection(); //an collection for all your command-aliases 27 | client.categories = fs.readdirSync("./commands/"); //categories 28 | client.cooldowns = new Discord.Collection(); //an collection for cooldown commands of each user 29 | 30 | //Loading files, with the client variable like Command Handler, Event Handler, ... 31 | ["command", "events"].forEach(handler => { 32 | require(`./handlers/${handler}`)(client); 33 | }); 34 | 35 | const Enmap = require("enmap"); 36 | client.stats = new Enmap({name :"stats", dataDir: "./databases/stats"}) 37 | client.settings = new Enmap({name :"settings", dataDir: "./databases/settings"}) 38 | 39 | //login into the bot 40 | client.login(require("./botconfig/config.json").token); 41 | /** 42 | * @INFO 43 | * Bot Coded by Tomato#6966 | https://github.com/Tomato6966/Discord-Js-Handler-Template 44 | * @INFO 45 | * Work for Milrato Development | https://milrato.eu 46 | * @INFO 47 | * Please mention Him / Milrato Development, when using this Code! 48 | * @INFO 49 | */ 50 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "discord-js-handler-template", 3 | "version": "1.0.0", 4 | "description": "Discord.js Command and Event Handler Template with example Command usages! For Questions: https://discord.gg/fS6qBSm", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node index.js" 9 | }, 10 | "author": "Tomato#6966", 11 | "license": "ISC", 12 | "dependencies": { 13 | "adm-zip": "^0.5.3", 14 | "archiver": "^5.2.0", 15 | "ascii-table": "0.0.9", 16 | "cpu-stat": "^2.0.1", 17 | "discord.js": "^12.5.1", 18 | "enmap": "^5.8.4", 19 | "fs-extra": "^9.1.0" 20 | }, 21 | "devDependencies": { 22 | "ascii-table": "0.0.9", 23 | "colors": "^1.4.0" 24 | } 25 | } 26 | --------------------------------------------------------------------------------