constDiscord=require('discord.js');const{ VoiceChatGame }=require('@unusualabsurd/discordjs-games')constclient=newDiscord.Client({intents: 32767})constprefix="YOUR_PREFIX_HERE"client.on('ready',()=>console.log(`Logged in as ${client.user.tag}`));constvcGame=newVoiceChatGame(client);client.on('messageCreate',asyncmessage=>{if(message.author.bot||!message.guild||!message.content.startsWith(prefix))return;const[cmd, ...args]=message.content.slice(prefix.length).trim().split(/ +/g)constcommand=cmd.toLowerCase();if(command==='youtube'){// Code Here}})
Creating the games
if(command==='youtube'){// message.member.voice.channel = the voice channel the user is invcGame.createGame(message.member.voice.channel,'youtube').then(g=>message.reply(`Invite Link: ${g.invite} | Invite Code: ${g.code}`))}
Scramble Game
const{ scrambleGame }=require('@unusualabsurd/discordjs-games')if(command==='scramble'){// Time option must be a number and it is read as millisecondsscrambleGame(message,null,{time: 30*1000})}
About
Create games easily from discord.js client using this package!