Skip to content

Commit

Permalink
err
Browse files Browse the repository at this point in the history
  • Loading branch information
pranshu05 authored Feb 17, 2023
1 parent 69bf887 commit 9f97e8b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const client = new Client({
'GUILD_VOICE_STATES',
]
})
const { MessageEmbed } = require('discord.js')
const Discord = require('discord.js')
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'))
const commands = []
client.commands = new Collection()
Expand All @@ -37,31 +37,31 @@ for(const file of eventFiles){
}
}
client.on('guildCreate' , guild => {
const guild_embed = new MessageEmbed()
const guild_embed = new Discord.MessageEmbed()
.setColor('00FFFF')
.setTitle('New Guild!')
.setDescription(`Elpha has joined the server ${guild.name}`)
.addFields(
{name: 'Members:', value: `${guild.memberCount}`},
{name: 'Guild ID:', value: `${guild.id}`},
{name: 'Guild owner:', value: `> <@${guild.ownerId}> \`[${guild.ownerId}]\``},
{name: 'Total servers:', value: `${await client.guilds.cache.size}`},
{name: 'Total servers:', value: `${client.guilds.cache.size}`},
)
.setThumbnail(guild.iconURL())
.setTimestamp()
client.channels.cache.get('919799899929841694').send({embeds: [guild_embed]})
})
client.on('guildDelete' , guild => {
if(guild.available){
const embed = new MessageEmbed()
const embed = new Discord.MessageEmbed()
.setColor('00FFFF')
.setTitle('Guild Left')
.setDescription(`Elpha has left the server ${guild.name}`)
.addFields(
{name: 'Members:', value: `${guild.memberCount}`},
{name: 'Guild ID:', value: `${guild.id}`},
{name: 'Guild owner:', value: `> <@${guild.ownerId}> \`[${guild.ownerId}]\``},
{name: 'Total servers:', value: `${await client.guilds.cache.size}`},
{name: 'Total servers:', value: `${client.guilds.cache.size}`},
)
.setThumbnail(guild.iconURL())
.setTimestamp()
Expand Down

0 comments on commit 9f97e8b

Please sign in to comment.