1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-18 00:31:00 -05:00

Hacky workaround for timestamp thing when member is banned

This commit is contained in:
toast-ts 2024-01-31 23:57:56 +11:00
parent 3150379c79
commit 3828a0e35c

View File

@ -4,7 +4,10 @@ export default class GuildMemberRemove {
static async run(client:TClient, member:Discord.GuildMember){ static async run(client:TClient, member:Discord.GuildMember){
if (!client.config.botSwitches.logs) return; if (!client.config.botSwitches.logs) return;
if (!member.joinedTimestamp || member.guild?.id != client.config.dcServer.id) return; if (!member.joinedTimestamp || member.guild?.id != client.config.dcServer.id) return;
if (client.guilds.cache.get(client.config.dcServer.id).bans.cache.has(member.id)) return await client.userLevels.deleteUser(member.id); if (client.guilds.cache.get(client.config.dcServer.id).bans.cache.has(member.id)) {
(client.channels.resolve(client.config.dcServer.channels.logs) as Discord.TextChannel).send(`**${member.user.username}**'s join date is <t:${Math.round(member.joinedTimestamp/1000)}>`)
return await client.userLevels.deleteUser(member.id);
};
let isBot = 'Bot'; let isBot = 'Bot';
if (!member.user.bot) isBot = 'Member'; if (!member.user.bot) isBot = 'Member';
const levelData = await client.userLevels.fetchUser(member.id); const levelData = await client.userLevels.fetchUser(member.id);