Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Coded By : Me , 9 9 9 <Eùros/>#0204
- ID : 678517905150836757
- Error? : https://discord.gg/mmD3bxRK4Z
- */
- const Discord = require("discord.js");
- const colors = require("colors");
- let db = require("quick.db")
- module.exports = {
- name:"voiceStateUpdate",
- async execute(oldVoice , newVoice , client) {
- let loggerChannelID = "861888019324731402";
- let loogerChannel = newVoice.guild.channels.cache.get(loggerChannelID);
- let user = await client.users.cache.get(newVoice.id)
- let log = await newVoice.guild.fetchAuditLogs({
- type : "DISCONNECT_MEMBER"
- })
- let log1 = await newVoice.guild.fetchAuditLogs({
- type : "MOVE_MEMBER"
- })
- let log2 = await newVoice.guild.fetchAuditLogs({
- type : "UPDATE_MEMBER"
- })
- let admine3;
- let executor3 = log2.entries.first().executor;
- if(executor3.id === user.id){
- admine3 = "He / She self"
- } else {
- admine3 = executor
- }
- let admine2;
- let executor2 = log1.entries.first().executor;
- if(executor2.id === user.id){
- admine2 = "He / She self"
- } else {
- admine2 = executor
- }
- let admin
- let executor = log.entries.first().executor;
- if(executor.id === user.id){
- admin = "He / She self"
- } else {
- admin = executor
- }
- let check = (bool) => bool ? "`✅`" : "`❌`";
- if(!oldVoice.channel && newVoice.channel){
- let ChangeChannel = new Discord.MessageEmbed()
- .setAuthor(user.tag,user.avatarURL({dynamic:true}))
- .setDescription(`**${user} joined voice channel \`${newVoice.channel.name}\`.**`)
- .addField("**User Info**",[
- `**ID : ${user.id}**`,
- `**self Mute : **${check(newVoice.selfMute)}`,
- `**Self Deaf : **${check(newVoice.selfDeaf)}`,
- `**Server Mute : **${check(newVoice.serverMute)}`,
- `**Server Deaf : **${check(newVoice.serverDeaf)}`,
- `**Self Video : **${check(newVoice.selfVideo)}`,
- `**Streaming : **${check(newVoice.streaming)}`,
- ])
- .setFooter(newVoice.guild.name,newVoice.guild.iconURL({dynamic:true}))
- .setTimestamp()
- loogerChannel.send(ChangeChannel)
- } else if(!newVoice.channel && oldVoice.channel){
- let ChangeChannel = new Discord.MessageEmbed()
- .setAuthor(user.tag,user.avatarURL({dynamic:true}))
- .setDescription(`**${user} left voice channel \`${oldVoice.channel.name}\`\nBy : ${admin}.**`)
- .setFooter(oldVoice.guild.name,oldVoice.guild.iconURL({dynamic:true}))
- .setTimestamp()
- loogerChannel.send(ChangeChannel)
- } else if(oldVoice.channel != newVoice.channel){
- let ChangeChannel = new Discord.MessageEmbed()
- .setAuthor(user.tag,user.avatarURL({dynamic:true}))
- .setDescription(`**${user} switched voice channel from \`${oldVoice.channel.name}\` to \`${newVoice.channel.name}\`\nBy : ${admine2}.**`)
- .setFooter(newVoice.guild.name,newVoice.guild.iconURL({dynamic:true}))
- .setTimestamp()
- loogerChannel.send(ChangeChannel)
- } else if(oldVoice.serverMute != newVoice.serverMute){
- let ServerMute = new Discord.MessageEmbed()
- .setAuthor(user.tag,user.avatarURL({dynamic:true}))
- .addField(`**BEFOR**`,`${check(oldVoice.serverMute)} : Server Mute`)
- .addField(`**AFTER**`,`${check(newVoice.serverMute)} : Server Mute`)
- .addField(`**By : **`,`**${admine3}**`)
- .setFooter(newVoice.guild.name,newVoice.guild.iconURL({dynamic:true}))
- .setTimestamp()
- loogerChannel.send(ServerMute)
- } else if(oldVoice.serverDeaf != newVoice.serverDeaf){
- let ServerDeaf = new Discord.MessageEmbed()
- .setAuthor(user.tag,user.avatarURL({dynamic:true}))
- .addField(`**BEFOR**`,`${check(oldVoice.serverDeaf)} : Server Deaf`)
- .addField(`**AFTER**`,`${check(newVoice.serverDeaf)} : Server Deaf`)
- .addField(`**By : **`,`**${admine3}**`)
- .setFooter(newVoice.guild.name,newVoice.guild.iconURL({dynamic:true}))
- .setTimestamp()
- loogerChannel.send(ServerDeaf)
- } else if(oldVoice.selfMute != newVoice.selfMute){
- let selfMute = new Discord.MessageEmbed()
- .setAuthor(user.tag,user.avatarURL({dynamic:true}))
- .addField(`**BEFOR**`,`${check(oldVoice.selfMute)} : Self Mute`)
- .addField(`**AFTER**`,`${check(newVoice.selfMute)} : Self Mute`)
- .setFooter(newVoice.guild.name,newVoice.guild.iconURL({dynamic:true}))
- .setTimestamp()
- loogerChannel.send(selfMute)
- } else if(oldVoice.selfDeaf != newVoice.selfDeaf){
- let selfDeaf = new Discord.MessageEmbed()
- .setAuthor(user.tag,user.avatarURL({dynamic:true}))
- .addField(`**BEFOR**`,`${check(oldVoice.selfDeaf)} : Self Deaf`)
- .addField(`**AFTER**`,`${check(newVoice.selfDeaf)} : Self Deaf`)
- .setFooter(newVoice.guild.name,newVoice.guild.iconURL({dynamic:true}))
- .setTimestamp()
- loogerChannel.send(selfDeaf)
- } else if(oldVoice.selfVideo != newVoice.selfVideo){
- let ServerDeaf = new Discord.MessageEmbed()
- .setAuthor(user.tag,user.avatarURL({dynamic:true}))
- .addField(`**BEFOR**`,`${check(oldVoice.selfVideo)} : Self Video`)
- .addField(`**AFTER**`,`${check(newVoice.selfVideo)} : Self Video`)
- .setFooter(newVoice.guild.name,newVoice.guild.iconURL({dynamic:true}))
- .setTimestamp()
- loogerChannel.send(ServerDeaf)
- } else if(oldVoice.streaming != newVoice.streaming){
- let ServerDeaf = new Discord.MessageEmbed()
- .setAuthor(user.tag,user.avatarURL({dynamic:true}))
- .addField(`**BEFOR**`,`${check(oldVoice.streaming)} : Streaming`)
- .addField(`**AFTER**`,`${check(newVoice.streaming)} : Streaming`)
- .setFooter(newVoice.guild.name,newVoice.guild.iconURL({dynamic:true}))
- .setTimestamp()
- loogerChannel.send(ServerDeaf)
- }
- }
- }
- /*
- Coded By : Me , 9 9 9 <Eùros/>#0204
- ID : 678517905150836757
- Error? : https://discord.gg/mmD3bxRK4Z
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement