Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js')
- const ytdl = require('ytdl-core')
- const music = require('discord.js-music-v11')
- const bot = new Discord.Client();
- const path = require('path');
- function cmd(str, msg){
- return msg.content.startsWith("!" + str);
- }
- const imgPath = path.join(__dirname, './Images');
- var timeNow = new Date();
- var sth;
- var stm;
- var sts;
- var isPrinted = false;
- var timeh = sth - timeNow.getHours();
- var timem = stm - timeNow.getMinutes();
- bot.on('ready', (message) =>{
- console.log("AhriBot is online.");
- bot.user.setGame("!help for commands");
- });
- music(bot, {
- prefix: '!',
- golbal: false,
- maxQueueSize: '25',
- clearInvoker: false
- });
- bot.on('message', (message) =>{
- var args = message.content.split(/[ ]+/);
- if(cmd('st', message)){
- message.reply("The stream should be starting at " + sth + "h:" + stm + "m on " + sts + ".");
- }
- if(cmd('guns', message)){
- message.channel.send("̿̿ ̿̿ ̿̿ ̿'̿'\̵͇̿̿\з= ( ▀ ͜͞ʖ▀) =ε/̵͇̿̿/’̿’̿ ̿ ̿̿ ̿̿ ̿̿");
- }
- if(cmd('love', message)){
- message.channel.send('', {files: ['Images/img01.png']});
- }
- if(cmd('angry', message)){
- message.channel.send('', {files: ['Images/img02.png']});
- }
- if(cmd('mlg', message)){
- message.channel.send('', {files: ['Images/mlg.png']});
- }
- if(cmd('restart', message)){
- process.exit(0);
- }
- if(cmd('roll', message)){
- if(message.member.roles.some(r=> ["CRIB MASTER", "CRIB DONATORS", "CRIB moderators"].includes(r.name) )) {
- var dice = Math.floor(Math.random() * 11);
- message.channel.send("The number is: " + dice);
- }
- }
- if(cmd('info', message)){
- message.reply("__media sites:__ \nYoutube: https://www.youtube.com/c/CornyCornflake \nTwitter: https://twitter.com/Corny_Cornflake \nTwitch: https://www.twitch.tv/cornycornflake\n\n __Donation Site:__\n\nhttps://www.tipeeestream.com/cornycornflake/donation");
- }
- if(cmd('help', message)){
- message.reply("Sent you the commands on dms ;)");
- message.author.send("__Normal Commands:__ \n\n`!st` for stream info\n`!info` for Cornys social media info\n\n__Music__\n\n`!play` (<url>|<search string>): Play a video/music. It can take a URL from various services (YouTube, Vimeo, YouKu, etc). You can also search using a string.\n\n`!skip [number]`: Skip some number of songs. Will skip 1 song if a number is not specified.\n\n`!queue`: Display the current queue.\n\n`!pause`: Pause music playback. (requires music manager)\n\n`!resume`: Resume music playback. (requires music manager)\n\n`!volume`: Adjust the playback volume between 1 and 200 (requires music manager)\n\n`!leave`: Clears the song queue and leaves the channel.\n\n`!clearqueue`: Clears the song queue.\n\n__For Fun__\n\n`!guns` for a cool emoji \n\n`!love` ahri will give you some love\n\n`!mlg` When she does something epic!\n\n`!angry` See her reaction when she is angry\n\n__Admin Commands:__\n\n`!setst <hour> <minutes> <site>` for setting the stream time and site\n`!roll` To roll a random number from 1 to 10\n\n`!restart` To reload all the code");
- }
- if(cmd('ping', message)){
- message.reply("Pong! " + bot.ping + "ms");
- }
- if(cmd('setst', message)){
- if(message.member.roles.some(r=> ["CRIB MASTER", "CRIB DONATORS", "CRIB moderators"].includes(r.name) )) {
- if(isNaN(args[1])){
- message.reply("Not a number. Please enter a number");
- }else if(args[1] === 0 && args[1] === 1){
- message.reply("Error, Not a valid number. Please enter like the following. 13, 01, 06, 23");
- }else if(args[1] >= 24){
- message.reply("Please learn the clock")
- }
- else{
- message.reply("hour set");
- sth = args[1];
- }
- if(isNaN(args[2])){
- message.reply("Not a valid number")
- }else if(args[2] === 0 && args[2] === 1){
- message.reply("Please enter the minutes as two numbers. Please enter like the following. 13, 01, 43, 50")
- }else if(args[2] >= 60){
- message.reply("Please learn the clock");
- }
- else{
- message.reply("minutes set")
- stm = args[2];
- }
- if(args[3] === " "){
- message.reply("Enter a streaming site please `!setst <hour> <minutes> <site>`");
- }else{
- message.reply("Site set");
- sts = args[3];
- }
- }else{
- message.reply("Not enough role premissions");
- }
- }
- });
- bot.login('MzIw');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement