mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 08:20:58 -05:00
improve few events
This commit is contained in:
parent
2f72fb3716
commit
6c4b477851
@ -29,7 +29,7 @@ export default {
|
|||||||
|
|
||||||
const embed1 = new client.embed().setColor(client.config.embedColorGreen).setTimestamp().setThumbnail(member.user.displayAvatarURL({size: 2048})).setTitle(`Member Joined: ${member.user.tag}`).setDescription(`<@${member.user.id}>\n\`${member.user.id}\``).setFooter({text: `Total members: ${index}${suffix}`}).addFields(
|
const embed1 = new client.embed().setColor(client.config.embedColorGreen).setTimestamp().setThumbnail(member.user.displayAvatarURL({size: 2048})).setTitle(`Member Joined: ${member.user.tag}`).setDescription(`<@${member.user.id}>\n\`${member.user.id}\``).setFooter({text: `Total members: ${index}${suffix}`}).addFields(
|
||||||
{name: '🔹 Account Creation Date', value: `<t:${Math.round(member.user.createdTimestamp/1000)}>\n<t:${Math.round(member.user.createdTimestamp/1000)}:R>`},
|
{name: '🔹 Account Creation Date', value: `<t:${Math.round(member.user.createdTimestamp/1000)}>\n<t:${Math.round(member.user.createdTimestamp/1000)}:R>`},
|
||||||
{name: '🔹 Invite Data:', value: usedInvite ? `Invite: \`${usedInvite.code}\`\nCreated by: **${usedInvite.inviter?.tag}**` : 'I couldn\'t find out how they joined!'}
|
{name: '🔹 Invite Data:', value: usedInvite ? `Invite: \`${usedInvite.code}\`\nCreated by: **${usedInvite.inviter?.tag}**` : 'No invite data could be found.'}
|
||||||
);
|
);
|
||||||
(client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel).send({embeds: [embed1]})
|
(client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel).send({embeds: [embed1]})
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ export default {
|
|||||||
if (member.guild?.id != client.config.mainServer.id) return;
|
if (member.guild?.id != client.config.mainServer.id) return;
|
||||||
const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setThumbnail(member.user.displayAvatarURL({size: 2048}) as string).setTitle(`Member Left: ${member.user.tag}`).setDescription(`<@${member.user.id}>\n\`${member.user.id}\``).addFields(
|
const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setThumbnail(member.user.displayAvatarURL({size: 2048}) as string).setTitle(`Member Left: ${member.user.tag}`).setDescription(`<@${member.user.id}>\n\`${member.user.id}\``).addFields(
|
||||||
{name: '🔹 Account Creation Date', value: `<t:${Math.round(member.user.createdTimestamp/1000)}>\n<t:${Math.round(member.user.createdTimestamp/1000)}:R>`},
|
{name: '🔹 Account Creation Date', value: `<t:${Math.round(member.user.createdTimestamp/1000)}>\n<t:${Math.round(member.user.createdTimestamp/1000)}:R>`},
|
||||||
{name: '🔹 Join Date', value: `<t:${Math.round(member.joinedTimestamp/1000)}>\n<t:${Math.round(member.joinedTimestamp/1000)}:R>`},
|
{name: '🔹 Server Join Date', value: `<t:${Math.round(member.joinedTimestamp/1000)}>\n<t:${Math.round(member.joinedTimestamp/1000)}:R>`},
|
||||||
{name: `🔹 Roles: ${member.roles.cache.size - 1}`, value: `${member.roles.cache.size > 1 ? member.roles.cache.filter((x)=>x.id !== member.guild.roles.everyone.id).sort((a,b)=>b.position - a.position).map(x=>x).join(member.roles.cache.size > 4 ? ' ' : '\n').slice(0,1024) : 'No roles'}`, inline: true},
|
{name: `🔹 Roles: ${member.roles.cache.size - 1}`, value: `${member.roles.cache.size > 1 ? member.roles.cache.filter((x)=>x.id !== member.guild.roles.everyone.id).sort((a,b)=>b.position - a.position).map(x=>x).join(member.roles.cache.size > 4 ? ' ' : '\n').slice(0,1024) : 'No roles'}`, inline: true},
|
||||||
{name: '🔹 Level messages', value: `${client.userLevels._content[member.user.id]?.messages.toLocaleString('en-US') || 0}`, inline: true}
|
{name: '🔹 Level messages', value: `${client.userLevels._content[member.user.id]?.messages.toLocaleString('en-US') || 0}`, inline: true}
|
||||||
);
|
);
|
||||||
|
@ -5,9 +5,11 @@ export default {
|
|||||||
execute: async(client:TClient, msg:Discord.Message)=>{
|
execute: async(client:TClient, msg:Discord.Message)=>{
|
||||||
if (!client.config.botSwitches.logs) return;
|
if (!client.config.botSwitches.logs) return;
|
||||||
const channel = client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel;
|
const channel = client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel;
|
||||||
|
const disabledChannels = ['548032776830582794']
|
||||||
if (msg.guild?.id != client.config.mainServer.id) return;
|
if (msg.guild?.id != client.config.mainServer.id) return;
|
||||||
if (msg.partial) return;
|
if (msg.partial) return;
|
||||||
if (msg.author.bot) return;
|
if (msg.author.bot) return;
|
||||||
|
if (disabledChannels) return;
|
||||||
const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setAuthor({name: `Author: ${msg.author.tag} (${msg.author.id})`, iconURL: `${msg.author.displayAvatarURL()}`}).setTitle('Message deleted').setDescription(`<@${msg.author.id}>\n\`${msg.author.id}\``);
|
const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setAuthor({name: `Author: ${msg.author.tag} (${msg.author.id})`, iconURL: `${msg.author.displayAvatarURL()}`}).setTitle('Message deleted').setDescription(`<@${msg.author.id}>\n\`${msg.author.id}\``);
|
||||||
if (msg.content.length != 0) embed.addFields({name: 'Content', value: `\`\`\`\n${msg.content.slice(0,1000)}\n\`\`\``});
|
if (msg.content.length != 0) embed.addFields({name: 'Content', value: `\`\`\`\n${msg.content.slice(0,1000)}\n\`\`\``});
|
||||||
embed.addFields(
|
embed.addFields(
|
||||||
|
@ -4,12 +4,14 @@ export default {
|
|||||||
name: 'messageUpdate',
|
name: 'messageUpdate',
|
||||||
execute: async(client:TClient, oldMsg:Discord.Message, newMsg:Discord.Message)=>{
|
execute: async(client:TClient, oldMsg:Discord.Message, newMsg:Discord.Message)=>{
|
||||||
if (!client.config.botSwitches.logs) return;
|
if (!client.config.botSwitches.logs) return;
|
||||||
|
const disabledChannels = ['548032776830582794']
|
||||||
if (oldMsg.guild?.id != client.config.mainServer.id) return;
|
if (oldMsg.guild?.id != client.config.mainServer.id) return;
|
||||||
if (oldMsg.author == null) return;
|
if (oldMsg.author == null) return;
|
||||||
if (oldMsg?.author.bot) return;
|
if (oldMsg?.author.bot) return;
|
||||||
if (oldMsg.partial) return;
|
if (oldMsg.partial) return;
|
||||||
if (newMsg.partial) return;
|
if (newMsg.partial) return;
|
||||||
if (!newMsg.member) return;
|
if (!newMsg.member) return;
|
||||||
|
if (disabledChannels) return;
|
||||||
const msgarr = newMsg.content.toLowerCase().split(' ');
|
const msgarr = newMsg.content.toLowerCase().split(' ');
|
||||||
if (client.bannedWords._content.some((word:string)=>msgarr.includes(word)) && (!client.isStaff(newMsg.member))) newMsg.delete();
|
if (client.bannedWords._content.some((word:string)=>msgarr.includes(word)) && (!client.isStaff(newMsg.member))) newMsg.delete();
|
||||||
if (newMsg.content === oldMsg.content) return;
|
if (newMsg.content === oldMsg.content) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user