Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js');
- const bot = new Discord.Client();
- const token = 'NTgxMjYzMzU4NTMxOTkzNjE3.XOc53A.AjJ6FyT6_mJwB3MAvijd-xId1Zo';
- const ytdl = require ("ytdl-core")
- exports.run = async (client, message, args, ops) => {
- if (!message.member.voiceChannel) return message.send ("This Aint no rocket science homie CONNECT TO A VOICE CHANNEL!");
- //This checks if the bot is in a voice channel already!
- if (message.guild.me.voiceChannel) return message.channel.send("Lol Homie the bot already in someone else channel!");
- if (!args[0]) return message.channel.send("OK great a bot smarter than u PUT IN A LINK!");
- let validate = await ytdl.validateURL(args[0]);
- if (!validate) return message.channel.send("yo homie you broke me try again!");
- let info = await ytdl.getInfo(args[0]);
- let connnection = await message.member.voiceChannel.join();
- let dispatcher = await connection.playStream(ytdl(args[0], { filter: 'audioonly'}));
- message.channel.send("Alr homie im playing: $(info.title");
- }
- module.exports.help = {
- name: "play"
- }
- const servers ={};
- const PREFIX = '?';
- bot.on('ready',() =>{
- console.log('This bot is online!')
- });
- bot.on('message', message=>{
- let args = message.content.substring(PREFIX.length).split(" ");
- switch(args[0]){
- case 'ping':
- message.reply('pong!');
- break;
- case 'info':
- message.reply('This bot was created by ItszKev to use it on your server click https://discordapp.com/oauth2/authorize?client_id=581263358531993617&scope=bot&permissions=0');
- break;
- case 'clear':
- if(!args[1]) return message.reply('how much should I clear?')
- message.channel.bulkDelete(args[1]);
- break;
- }
- });
- bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement