├── .github └── FUNDING.yml ├── .replit ├── Procfile ├── README.md ├── assets └── emojigif.md ├── commands ├── Music │ ├── Loop.js │ ├── clear.js │ ├── disable-loop.js │ ├── join.js │ ├── leave.js │ ├── np.js │ ├── play.js │ ├── playlist.js │ ├── push.js │ ├── queue.js │ ├── resume.js │ ├── shuffle.js │ ├── skip.js │ ├── stop.js │ └── volume.js └── info │ └── help.js ├── config.json ├── handlers ├── command.js └── ready.js ├── json.sqlite ├── package.json └── server.js /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | patreon: automodbot 2 | custom: ["https://apptime.tech","https://automodbot.com","https://cwkhan.xyz"] 3 | -------------------------------------------------------------------------------- /.replit: -------------------------------------------------------------------------------- 1 | language = "nodejs" 2 | run = "node server.js" 3 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: echo "I don't want a web process" 2 | service: node server.js 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### 📝 Tutorial 4 | 5 |
6 | Automodbot 7 |
8 | 9 | ### 💨 Run the project's 10 | Make sure to install node16 + 11 | Glitch: [![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button.svg)](https://glitch.com/edit/#!/import/github/Khanmanan/music-bot-v1) 12 | 13 | Repl: [![Run on Repl.it](https://repl.it/badge/github/Khanmanan/music-bot-v1)](https://replit.com/@Khanmanan/Music-bot-v1) 14 | 15 | 16 |

© IF u want use the code star ✨ the repo and subscribe our YouTube cahnnel ;)

17 |

and Join our support server add your bot to use music emojis

18 | 19 | ### INVITE Bot and test [click here](https://discord.com/api/oauth2/authorize?client_id=724686774273835118&permissions=4025867761&scope=bot) 20 | 21 | 22 | 23 | ### Support server 24 | 25 | 26 | 27 |
28 | 29 | -------------------------------------------------------------------------------- /assets/emojigif.md: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /commands/Music/Loop.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | 3 | module.exports = { 4 | name: 'loop', // Optional 5 | aliases: [], // Optional 6 | category: 'Music', 7 | description: 'Loop the queue', 8 | run: async (client, message, args) => { 9 | const voice_channel = message.member.voice.channel; 10 | const embed = new MessageEmbed() 11 | .setColor('#FF5757') 12 | .setDescription(`You need to be in a vc to execute this command!`) 13 | if (!voice_channel) return message.channel.send(embed); 14 | // Enable repeat mode 15 | let status = client.player.setQueueRepeatMode(message, true); 16 | const loop = new MessageEmbed() 17 | .setColor('#85b0d2') 18 | .setDescription(`Queue will be repeated indefinitely!`) 19 | if(status === null) 20 | return; 21 | message.channel.send(loop); 22 | } 23 | } -------------------------------------------------------------------------------- /commands/Music/clear.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | 3 | module.exports = { 4 | name: 'clear', // Optional 5 | aliases: ['clearqueue', 'clear-queue'], // Optional 6 | category: 'Music', 7 | description: 'Clears the queue', 8 | run: async (client, message, args) => { 9 | const voice_channel = message.member.voice.channel; 10 | const embed = new MessageEmbed() 11 | .setColor('#FF5757') 12 | .setDescription(`You need to be in a vc to execute this command!`) 13 | const embed1 = new MessageEmbed() 14 | .setColor('#85b0d2') 15 | .setDescription('Queue was cleared!') 16 | if (!voice_channel) return message.channel.send(embed); 17 | let isDone = client.player.clearQueue(message); 18 | if(isDone) 19 | message.channel.send(embed1); 20 | } 21 | } -------------------------------------------------------------------------------- /commands/Music/disable-loop.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | 3 | module.exports = { 4 | name: 'disable-loop', // Optional 5 | aliases: [], // Optional 6 | category: 'Music', 7 | description: 'Stop looping the queue', 8 | run: async (client, message, args) => { 9 | const voice_channel = message.member.voice.channel; 10 | const embed = new MessageEmbed() 11 | .setColor('#FF5757') 12 | .setDescription(`You need to be in a vc to execute this command!`) 13 | if (!voice_channel) return message.channel.send(embed); 14 | // Disable repeat mode 15 | let status = client.player.setQueueRepeatMode(message, false); 16 | 17 | const disloop = new MessageEmbed() 18 | .setColor('#85b0d2') 19 | .setDescription(`Queue will not be longer repeated indefinitely!`) 20 | if(status === null) 21 | return; 22 | message.channel.send(disloop); 23 | } 24 | } -------------------------------------------------------------------------------- /commands/Music/join.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | 3 | module.exports = { 4 | name: 'join', // Optional 5 | aliases: [], // Optional 6 | category: 'Music', 7 | description: 'Join the voice channel!', 8 | run: async (client, message, args) => { 9 | const voiceChannel = message.member.voice.channel; 10 | const embed = new MessageEmbed() 11 | .setColor('#FF5757') 12 | .setDescription(`You need to be in a vc to execute this command!`) 13 | if(!voiceChannel) return message.channel.send(embed) 14 | voiceChannel.join() 15 | message.react('🪐') 16 | 17 | } 18 | } -------------------------------------------------------------------------------- /commands/Music/leave.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | 3 | module.exports = { 4 | name: 'leave', // Optional 5 | aliases: [], // Optional 6 | category: 'Music', 7 | description: 'Leaves the voice channel!', 8 | 9 | run: async (client, message, args) => { 10 | const voiceChannel = message.member.voice.channel; 11 | const embed = new MessageEmbed() 12 | .setColor('#FF5757') 13 | .setDescription(`You need to be in a vc to execute this command!`) 14 | if(!voiceChannel) return message.channel.send(embed) 15 | voiceChannel.leave() 16 | message.react('🪐') 17 | 18 | } 19 | } -------------------------------------------------------------------------------- /commands/Music/np.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require('discord.js') 2 | 3 | module.exports = { 4 | name: 'nowplaying', // Optional 5 | aliases: ['np'], // Optional 6 | category: 'Music', 7 | description: 'Gives info about the song that its being played and the progress of it', 8 | run: async (client, message, args) => { 9 | const voice_channel = message.member.voice.channel; 10 | const embed = new MessageEmbed() 11 | .setColor('#FF5757') 12 | .setDescription(`You need to be in a vc to execute this command!`) 13 | if (!voice_channel) return message.channel.send(embed); 14 | let progressBar = client.player.createProgressBar(message, { 15 | size: 20, 16 | block: '▬', 17 | arrow: '🔘' 18 | 19 | 20 | 21 | }); 22 | let song = await client.player.nowPlaying(message) 23 | const bar = new MessageEmbed() 24 | .setColor('#85b0d2') 25 | .setTitle(`${song.name}`) 26 | .setURL('https://www.youtube.com/watch?v=dQw4w9WgXcQ') 27 | .setDescription(`⋆ Requested by ${message.author} 28 | \`${progressBar}\``) 29 | 30 | if(progressBar) 31 | 32 | 33 | 34 | 35 | message.channel.send(bar); 36 | } 37 | } -------------------------------------------------------------------------------- /commands/Music/play.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | const ytsr = require('ytsr'); 3 | module.exports = { 4 | name: 'play', 5 | aliases: ['p'], // Optional 6 | category: 'Music', 7 | description: 'Play a song in the vc', 8 | run: async (client, message, args) => { 9 | const voice_channel = message.member.voice.channel; 10 | const embed = new MessageEmbed() 11 | .setColor('#FF5757') 12 | .setDescription(`You need to be in a vc to execute this command!`) 13 | if (!voice_channel) return message.channel.send(embed); 14 | 15 | if(client.player.isPlaying(message)) { 16 | let song = await client.player.addToQueue(message, args.join(' ')); 17 | 18 | const added = new MessageEmbed() 19 | .setColor('#85b0d2') 20 | .setDescription(`Added **${song.name}** to the queue`) 21 | 22 | 23 | // If there were no errors the Player#songAdd event will fire and the song will not be null. 24 | if(song) 25 | message.channel.send(added); 26 | return; 27 | } else { 28 | let song = await client.player.play(message, args.join(' ')); 29 | 30 | const started = new MessageEmbed() 31 | .setColor('#85b0d2') 32 | .setDescription(`Started playing **${song.name}**`) 33 | 34 | // If there were no errors the Player#songAdd event will fire and the song will not be null. 35 | if(song) 36 | message.channel.send(started); 37 | return; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /commands/Music/playlist.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | 3 | module.exports = { 4 | name: 'playlist', 5 | aliases: ['plist'], // Optional 6 | category: 'Music', 7 | description: 'Play a playlist in the vc', 8 | run: async (client, message, args) => { 9 | const voice_channel = message.member.voice.channel; 10 | const embed = new MessageEmbed() 11 | .setColor('#FF5757') 12 | .setDescription(`You need to be in a vc to execute this command!`) 13 | if (!voice_channel) return message.channel.send(embed); 14 | // If maxSongs is -1, will be infinite. 15 | await client.player.playlist(message, { 16 | search: args.join(' '), 17 | maxSongs: -1 18 | }); 19 | } 20 | } -------------------------------------------------------------------------------- /commands/Music/push.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | 3 | module.exports = { 4 | name: 'pause', // Optional 5 | aliases: ['paus'], // Optional 6 | category: 'Music', 7 | description: 'Pause the queue', 8 | run: async (client, message, args) => { 9 | const voice_channel = message.member.voice.channel; 10 | const embed = new MessageEmbed() 11 | .setColor('#FF5757') 12 | .setDescription(`You need to be in a vc to execute this command!`) 13 | if (!voice_channel) return message.channel.send(embed); 14 | let song = client.player.pause(message); 15 | const pause = new MessageEmbed() 16 | .setColor('#85b0d2') 17 | .setDescription(`**${song.name}** was paused!`) 18 | if(song) 19 | 20 | message.channel.send(pause); 21 | } 22 | } -------------------------------------------------------------------------------- /commands/Music/queue.js: -------------------------------------------------------------------------------- 1 | 2 | const { MessageEmbed } = require("discord.js"); 3 | 4 | module.exports = { 5 | name: 'queue', // Optional 6 | aliases: ['q'], // Optional 7 | category: 'Music', 8 | description: 'Gives you info about the server queue', 9 | run: async (client, message, args) => { 10 | const voice_channel = message.member.voice.channel; 11 | const embed = new MessageEmbed() 12 | .setColor('#FF5757') 13 | .setDescription(`You need to be in a vc to execute this command!`) 14 | if (!voice_channel) return message.channel.send(embed); 15 | let queue = client.player.getQueue(message); 16 | if(queue) 17 | message.channel.send('Queue:\n'+(queue.songs.map((song, i) => { 18 | return `${i === 0 ? 'Now Playing' : `#${i+1}`} - ${song.name} | ${song.author}` 19 | }).join('\n'))); 20 | } 21 | } -------------------------------------------------------------------------------- /commands/Music/resume.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | 3 | module.exports = { 4 | name: 'resume', // Optional 5 | aliases: ['resume'], // Optional 6 | category: 'Music', 7 | description: 'Resume the song that was paused', 8 | run: async (client, message, args) => { 9 | const voice_channel = message.member.voice.channel; 10 | const embed = new MessageEmbed() 11 | .setColor('#FF5757') 12 | .setDescription(`You need to be in a vc to execute this command!`) 13 | if (!voice_channel) return message.channel.send(embed); 14 | let song = client.player.resume(message); 15 | const resume = new MessageEmbed() 16 | .setColor('#85b0d2') 17 | .setDescription(`**${song.name}** was resumed!`) 18 | if(song) 19 | message.channel.send(resume); 20 | } 21 | } -------------------------------------------------------------------------------- /commands/Music/shuffle.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | 3 | module.exports = { 4 | name: 'shuffle', // Optional 5 | aliases: ['sh'], // Optional 6 | category: 'Music', 7 | description: 'Shuffle the queue', 8 | run: async (client, message, args) => { 9 | const voice_channel = message.member.voice.channel; 10 | const embed = new MessageEmbed() 11 | .setColor('#FF5757') 12 | .setDescription(`You need to be in a vc to execute this command!`) 13 | if (!voice_channel) return message.channel.send(embed); 14 | let songs = client.player.shuffle(message); 15 | const shuffle = new MessageEmbed() 16 | .setColor('#85b0d2') 17 | .setDescription('Server Queue was shuffled.') 18 | if(songs) 19 | message.channel.send(shuffle); 20 | } 21 | } -------------------------------------------------------------------------------- /commands/Music/skip.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | 3 | module.exports = { 4 | name: 'skip', // Optional 5 | aliases: ['sk'], // Optional 6 | category: 'Music', 7 | description: 'Skip the song that its playing.', 8 | run: async (client, message, args) => { 9 | const voice_channel = message.member.voice.channel; 10 | const embed = new MessageEmbed() 11 | .setColor('#FF5757') 12 | .setDescription(`You need to be in a vc to execute this command!`) 13 | if(!client.player.isPlaying(message)) { 14 | message.channel.send('Unknow Radio must be playing in order to skip the track'); 15 | 16 | return; 17 | } 18 | 19 | await client.player.skip(message); 20 | 21 | message.channel.send('Skipped'); 22 | }, 23 | }; -------------------------------------------------------------------------------- /commands/Music/stop.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | 3 | module.exports = { 4 | name: 'stop', // Optional 5 | category: 'Music', 6 | description: 'Clears the queue and leave the vc', 7 | aliases: ['st'], // Optional 8 | run: async (client, message, args) => { 9 | const voice_channel = message.member.voice.channel; 10 | const embed = new MessageEmbed() 11 | .setColor('#FF5757') 12 | .setDescription(`You need to be in a vc to execute this command!`) 13 | if (!voice_channel) return message.channel.send(embed); 14 | let isDone = client.player.stop(message); 15 | const stop = new MessageEmbed() 16 | .setColor('#85b0d2') 17 | .setDescription('Music stopped & the queue was cleared!') 18 | if(isDone) 19 | message.channel.send(stop); 20 | } 21 | } -------------------------------------------------------------------------------- /commands/Music/volume.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | 3 | module.exports = { 4 | name: 'volume', // Optional 5 | category: 'Music', 6 | description: 'Set the volume of the bot in the vc', 7 | aliases: ['setvolume'], // Optional 8 | run: async (client, message, args) => { 9 | const voice_channel = message.member.voice.channel; 10 | const embed = new MessageEmbed() 11 | .setColor('#FF5757') 12 | .setDescription(`You need to be in a vc to execute this command!`) 13 | if (!voice_channel) return message.channel.send(embed); 14 | let isDone = client.player.setVolume(message, parseInt(args[0])); 15 | const volume = new MessageEmbed() 16 | .setColor('#85b0d2') 17 | .setDescription(`Volume set to ${args[0]}%!`) 18 | if(isDone) 19 | message.channel.send(volume); 20 | } 21 | } -------------------------------------------------------------------------------- /commands/info/help.js: -------------------------------------------------------------------------------- 1 | const { MessageEmbed } = require("discord.js"); 2 | 3 | module.exports = { 4 | 5 | name: "help", 6 | 7 | description: 8 | 9 | "Get list of all command and even get to know every command detials", 10 | 11 | usage: "help ", 12 | 13 | category: "info", 14 | 15 | run: async (client, message, args) => { 16 | 17 | if (args[0]) { 18 | 19 | const command = await client.commands.get(args[0]); 20 | 21 | if (!command) { 22 | 23 | return message.channel.send("Unknown Command: " + args[0]); 24 | 25 | } 26 | 27 | let embed = new MessageEmbed() 28 | 29 | .setAuthor(command.name, client.user.displayAvatarURL()) 30 | 31 | .addField("❯ Description", command.description || "Not Provided :(") 32 | 33 | .addField("❯ Usage", "`" + command.usage + "`" || "Not Provied") 34 | 35 | .setThumbnail(client.user.displayAvatarURL()) 36 | 37 | .setColor("BLUE") 38 | 39 | .setFooter(client.user.username, client.user.displayAvatarURL()); 40 | 41 | return message.channel.send(embed); 42 | 43 | } else { 44 | 45 | const embed1 = new MessageEmbed() 46 | .setColor('#85b0d2') 47 | .setTitle('Music Commands') 48 | .addField('join', ` Join the voice channel!`, true) 49 | .addField('leave', `Leaves the voice channel!`, true) 50 | .addField('play', `Play the requested song in the vc`, true) 51 | .addField('stop', `Clears the queue and leave the vc'`, true) 52 | .addField('pause', ` Pause the queue`, true) 53 | .addField('resume', ` Resume the queue`, true) 54 | .addField('shuffle', ` Shuffle the queue`, true) 55 | .addField('queue', ` Gives you info about the server queue`, true) 56 | .addField('remove', ` Remove a song from the queue`, true) 57 | .addField('loop', `Loop the queue`, true) 58 | .addField('disable-loop', ` Stop looping the queue`, true) 59 | .addField('skip', ` Skip the song that its playing.`, true) 60 | .addField('clear', ` Clear the queue`, true) 61 | .addField('playlist', `Play a playlist in the vc`, true) 62 | .addField('volume', `Set the volume of the bot in the vc`, true) 63 | .addField('nowplaying', `Gives info about the song that its being played and the progress of it`, true) 64 | .setTimestamp() 65 | .setFooter(`madr by cwkhan 😎 `) 66 | message.channel.send(embed1) 67 | } 68 | } 69 | }}} 70 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "default_prefix": "c!", 4 | "owners": "682981714523586606" 5 | } 6 | -------------------------------------------------------------------------------- /handlers/command.js: -------------------------------------------------------------------------------- 1 | const { readdirSync } = require("fs"); 2 | 3 | const ascii = require("ascii-table"); 4 | 5 | // Create a new Ascii table 6 | let table = new ascii("Commands"); 7 | table.setHeading("Command", "Load status"); 8 | 9 | module.exports = (client) => { 10 | // Read every commands subfolder 11 | readdirSync("./commands/").forEach(dir => { 12 | // Filter so we only have .js command files 13 | const commands = readdirSync(`./commands/${dir}/`).filter(file => file.endsWith(".js")); 14 | 15 | // Loop over the commands, and add all of them to a collection 16 | // If there's no name found, prevent it from returning an error, 17 | // By using a cross in the table we made. 18 | for (let file of commands) { 19 | let pull = require(`../commands/${dir}/${file}`); 20 | 21 | if (pull.name) { 22 | client.commands.set(pull.name, pull); 23 | table.addRow(file, '✅'); 24 | } else { 25 | table.addRow(file, `❌ -> missing a help.name, or help.name is not a string.`); 26 | continue; 27 | } 28 | 29 | // If there's an aliases key, read the aliases. 30 | if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach(alias => client.aliases.set(alias, pull.name)); 31 | } 32 | }); 33 | 34 | // Log the table 35 | console.log(table.toString()); 36 | } -------------------------------------------------------------------------------- /handlers/ready.js: -------------------------------------------------------------------------------- 1 | const { default_prefix } = require('../config'); 2 | module.exports = async bot => { 3 | console.log(`${bot.user.username} is available now!`) 4 | let totalUsers = bot.guilds.cache.reduce((acc, value) => acc + value.memberCount, 0) 5 | var activities = [ `${bot.guilds.cache.size} servers`, `${totalUsers} users!` ], i = 0; 6 | setInterval(() => bot.user.setActivity(`${default_prefix}help | ${activities[i++ % activities.length]}`, { type: "WATCHING" }),50000) 7 | 8 | }; -------------------------------------------------------------------------------- /json.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Khanmanan/music-bot-v1/e2aee90503de03e32c2dcd057acb46a348567dbb/json.sqlite -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "//1": "describes your app and its dependencies", 3 | "//2": "https://docs.npmjs.com/files/package.json", 4 | "//3": "updating this file will download and update your packages", 5 | "name": "hello-express", 6 | "version": "1.0.2", 7 | "description": "A simple Node app built on Express, instantly up and running.", 8 | "main": "server.js", 9 | "scripts": { 10 | "start": "node server.js" 11 | }, 12 | "dependencies": { 13 | "@discordjs/opus": "^0.5.0", 14 | "@distube/ytpl": "^1.0.11", 15 | "akaneko": "^3.0.2", 16 | "ascii-table": "^0.0.9", 17 | "avconv": "^3.1.0", 18 | "await": "^0.2.6", 19 | "axios": "^0.21.1", 20 | "canvacord": "^5.0.8", 21 | "canvas-constructor": "^4.1.0", 22 | "canvas-senpai": "^0.1.6", 23 | "cpu-stat": "^2.0.1", 24 | "di": "0.0.1", 25 | "discord-akairo": "^8.1.0", 26 | "discord-giveaways": "^4.4.3", 27 | "discord.js": "^12.3.1", 28 | "discord.js-commando": "^0.10.0", 29 | "distube": "^2.8.12", 30 | "dote": "^1.1.0", 31 | "dotenv": "^8.2.0", 32 | "env": "0.0.2", 33 | "erela.js": "^2.3.1", 34 | "express": "^4.17.1", 35 | "ffmpeg-static": "^4.3.0", 36 | "figlet": "^1.5.0", 37 | "fs": "^0.0.2", 38 | "hastebin-gen": "^2.0.5", 39 | "i": "^0.3.6", 40 | "imdb-api": "^4.2.0", 41 | "instagram-api.js": "0.0.8", 42 | "mathjs": "^7.1.0", 43 | "moment": "^2.27.0", 44 | "moment-duration-format": "^2.3.2", 45 | "mongoose": "^5.9.29", 46 | "ms": "^2.1.2", 47 | "neko-love": "^2.0.2", 48 | "nekos.life": "^2.0.7", 49 | "node-fetch": "^2.6.1", 50 | "node-superfetch": "^0.1.11", 51 | "novelcovid": "^3.0.0", 52 | "npm": "^7.6.1", 53 | "opusscript": "^0.0.7", 54 | "or": "^0.2.0", 55 | "os": "^0.1.1", 56 | "parse-ms": "^2.1.0", 57 | "path": "^0.12.7", 58 | "pretty-ms": "^7.0.1", 59 | "quick.db": "^7.1.3", 60 | "random-code-gen": "^1.1.2", 61 | "request": "^2.88.2", 62 | "request-promise-native": "^1.0.9", 63 | "simple-youtube-api": "^5.2.1", 64 | "snekfetch": "^4.0.4", 65 | "something-random-on-discord": "^0.0.1", 66 | "soundcloud-downloader": "^0.2.4", 67 | "sourcebin_js": "0.0.3-ignore", 68 | "spotify-url-info": "^2.2.0", 69 | "srod-v2": "^1.0.1", 70 | "twemoji-parser": "^13.0.0", 71 | "weather-js": "^2.0.0", 72 | "yt-search": "^2.5.1", 73 | "ytdl-core": "^3.4.2", 74 | "ytdl-core-discord": "^1.2.5", 75 | "ytpl": "^2.0.4", 76 | "ytsr": "^3.2.2" 77 | }, 78 | "engines": { 79 | "node": "14.x" 80 | }, 81 | "repository": { 82 | "url": "https://glitch.com/edit/#!/hello-express" 83 | }, 84 | "license": "MIT", 85 | "keywords": [ 86 | "node", 87 | "glitch", 88 | "express" 89 | ] 90 | } 91 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | 2 | "$TOEKN" 3 | // if you need help ask in the help channel dont dm me 4 | const { default_prefix } = require("./config.json") 5 | const DisTube = require("distube") 6 | 7 | 8 | const { config } = require("dotenv"); 9 | 10 | const discord = require("discord.js"); 11 | const client = new discord.Client({ 12 | disableEveryone: false 13 | }); 14 | const yts = require('yt-search') 15 | 16 | 17 | const { ready } = require("./handlers/ready.js") 18 | 19 | client.commands = new discord.Collection(); 20 | client.aliases = new discord.Collection(); 21 | 22 | ["command"].forEach(handler => { 23 | require(`./handlers/${handler}`)(client); 24 | }); 25 | 26 | process.on('unhandledRejection', console.error); 27 | 28 | 29 | client.on("message", async message => { 30 | 31 | 32 | if (message.author.bot) return; 33 | if (!message.guild) return; 34 | if (!message.content.startsWith(default_prefix)) return; 35 | 36 | if (!message.member) 37 | message.member = message.guild.fetchMember(message); 38 | 39 | const args = message.content 40 | .slice(default_prefix.length) 41 | .trim() 42 | .split(/ +/g); 43 | const cmd = args.shift().toLowerCase(); 44 | 45 | if (cmd.length === 0) return; 46 | 47 | let command = client.commands.get(cmd); 48 | 49 | if (!command) command = client.commands.get(client.aliases.get(cmd)); 50 | 51 | if (command) command.run(client, message, args); 52 | }); 53 | 54 | client.on("message", async message => { 55 | if(!message.guild) return; 56 | let prefix = db.get(`default_prefix${message.guild.id}`) 57 | if(prefix === null) prefix =default_prefix; 58 | 59 | if(!message.content.startsWith(default_prefix)) return; 60 | 61 | }) 62 | 63 | 64 | // Set the bot's online/idle/dnd/invisible status 65 | client.on("ready", () => { 66 | client.user.setStatus("online"); 67 | console.log("automodv12 beta is ready join support server https://dsc.gg/kmdevs") 68 | }); 69 | require('http').createServer((req, res) => res.end('cwk music is alive!')).listen(3000) 70 | 71 | 72 | 73 | const { Player } = require("discord-music-player"); 74 | //const prefixes = require("wokcommands/dist/models/prefixes"); 75 | const player = new Player(client, { 76 | leaveOnEmpty: false, 77 | }); 78 | 79 | client.player = player; 80 | 81 | new Player(client, { 82 | leaveOnEnd: true, 83 | leaveOnStop: true, 84 | leaveOnEmpty: true, 85 | timeout: 10, 86 | volume: 150, 87 | quality: 'high', 88 | }); 89 | 90 | 91 | client.login(process.env.TOKEN); --------------------------------------------------------------------------------