From 47e4d1150178d02fc7a3464f749e83221310a288 Mon Sep 17 00:00:00 2001 From: Techbot121 Date: Sat, 4 Jan 2025 18:07:56 +0100 Subject: [PATCH] reset by passing nothing instead data is handled internally now --- app/services/discord/index.ts | 5 ++++- app/services/discord/modules/discord-events.ts | 9 +++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/services/discord/index.ts b/app/services/discord/index.ts index 3eee6e9..9debc43 100644 --- a/app/services/discord/index.ts +++ b/app/services/discord/index.ts @@ -132,7 +132,10 @@ export class DiscordBot extends Service { } } - async setNickname(name = "Meta", reason?: string): Promise { + async setNickname( + name = this.data.lastDiscordNickName ?? "Meta", + reason?: string + ): Promise { if (!this.ready || !this.discord.user || name.length > 22) return false; try { const nick = name.charAt(0).toUpperCase() + name.slice(1); diff --git a/app/services/discord/modules/discord-events.ts b/app/services/discord/modules/discord-events.ts index 299cc80..5dc86c4 100644 --- a/app/services/discord/modules/discord-events.ts +++ b/app/services/discord/modules/discord-events.ts @@ -23,8 +23,6 @@ export default async (bot: DiscordBot): Promise => { }, ]; - const data = await bot.container.getService("Data"); - const GetParticipants = async ( event: Discord.GuildScheduledEvent | Discord.PartialGuildScheduledEvent ) => { @@ -43,10 +41,9 @@ export default async (bot: DiscordBot): Promise => { usr.roles.remove(DiscordConfig.roles.event); }); } - await event.guild?.setIcon(data.lastDiscordGuildIcon); - await event.guild?.setBanner(data.lastDiscordBanner); - await bot.discord.user?.setAvatar(data.lastDiscordGuildIcon); - await bot.setNickname(data.lastDiscordNickName, event.name + " ended"); + await bot.setIcon(); + await bot.setServerBanner(); + await bot.setNickname(undefined, event.name + " ended"); }; bot.discord.on("guildScheduledEventUpdate", async (old, now) => {