1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 08:20:58 -05:00

it do be super hot fr

This commit is contained in:
AnxietyisReal 2022-11-22 17:38:40 +11:00
parent 96e4836401
commit 86dc81d497
3 changed files with 25 additions and 2 deletions

View File

@ -12,7 +12,7 @@ export default {
const {executor, target, reason } = banLog;
if (target.id == member.user.id) {
const embed = new client.embed().setColor(client.config.embedColorRed).setTimestamp().setThumbnail(member.user.displayAvatarURL({size: 2048})).setTitle(`Member Banned: ${target.tag}`).setDescription(`🔹 **User**\n<@${target.id}>\n\`${target.id}\``).addFields(
{name: '🔹 Moderator', value: `<@${executor.id}> (\`${executor.id}\`)`},
{name: '🔹 Moderator', value: `<@${executor.id}>\n\`${executor.id}\``},
{name: '🔹 Reason', value: `${reason == null ? 'Reason unspecified': reason}`}
);
(client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel).send({embeds: [embed]})

View File

@ -12,7 +12,7 @@ export default {
const { executor, target, reason } = unbanLog;
if (target.id == member.user.id) {
const embed = new client.embed().setColor(client.config.embedColorGreen).setTimestamp().setThumbnail(member.user.displayAvatarURL({size: 2048})).setTitle(`Member Unbanned: ${target.tag}`).setDescription(`🔹 **User**\n<@${target.id}>\n\`${target.id}\``).addFields(
{name: '🔹 Moderator', value: `<@${executor.id}> (\`${executor.id}\`)`},
{name: '🔹 Moderator', value: `<@${executor.id}>\n\`${executor.id}\``},
{name: '🔹 Reason', value: `${reason == null ? 'Reason unspecified.': reason}`}
);
(client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel).send({embeds: [embed]})

23
src/events/roleUpdate.ts Normal file
View File

@ -0,0 +1,23 @@
import Discord, { AuditLogEvent } from 'discord.js';
import { TClient } from '../client';
export default {
name: 'roleUpdate',
execute: async(client:TClient, oldRole:Discord.Role, newRole:Discord.Role)=>{
const fetchRoleUpdoot = await client.guilds.cache.get(oldRole.guild.id).fetchAuditLogs({
limit: 1,
type: AuditLogEvent.RoleUpdate
})
const roleLog = fetchRoleUpdoot.entries.first();
if (!roleLog) return
const {executor, target} = roleLog;
if (target) {
const embed = new client.embed().setColor(newRole.hexColor).setTimestamp().setTitle(`Role modified: ${oldRole.name}`).setDescription(`🔹 **Role**\n${target}\n\`${target.id}\``).addFields(
{name: `${executor.bot ? '🔹 Bot' : '🔹 Admin'}`, value: `<@${executor.id}>\n\`${executor.id}\``},
{name: '🔹 Role changes', value: `**Old color:** ${oldRole.hexColor}\n**New color:** ${newRole.hexColor}`}
);
(client.channels.resolve(client.config.mainServer.channels.logs) as Discord.TextChannel).send({embeds: [embed]})
} else {
console.log(`${target.id} was modified from ${client.guilds.cache.get(oldRole.guild.name)} but no audit log could be fetched.`)
}
}
}