Skip to content

Commit

Permalink
reset by passing nothing instead
Browse files Browse the repository at this point in the history
data is handled internally now
  • Loading branch information
Techbot121 authored and Meta Construct committed Jan 4, 2025
1 parent 2390972 commit 47e4d11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 4 additions & 1 deletion app/services/discord/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ export class DiscordBot extends Service {
}
}

async setNickname(name = "Meta", reason?: string): Promise<boolean> {
async setNickname(
name = this.data.lastDiscordNickName ?? "Meta",
reason?: string
): Promise<boolean> {
if (!this.ready || !this.discord.user || name.length > 22) return false;
try {
const nick = name.charAt(0).toUpperCase() + name.slice(1);
Expand Down
9 changes: 3 additions & 6 deletions app/services/discord/modules/discord-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ export default async (bot: DiscordBot): Promise<void> => {
},
];

const data = await bot.container.getService("Data");

const GetParticipants = async (
event: Discord.GuildScheduledEvent | Discord.PartialGuildScheduledEvent
) => {
Expand All @@ -43,10 +41,9 @@ export default async (bot: DiscordBot): Promise<void> => {
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) => {
Expand Down

0 comments on commit 47e4d11

Please sign in to comment.