Skip to content

Commit 4c3df8f

Browse files
committed
Only call roleAssigner in role assigner channel
1 parent a415529 commit 4c3df8f

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/context.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export interface BotContext {
115115
votes: TextChannel;
116116
botSpam: TextChannel;
117117
hauptwoisText: TextChannel;
118+
roleAssigner: TextChannel;
118119
};
119120

120121
voiceChannels: {
@@ -338,6 +339,7 @@ export async function createBotContext(client: Client<true>): Promise<BotContext
338339
votes: ensureTextChannel(guild, textChannel.votesChannelId),
339340
botSpam: ensureTextChannel(guild, textChannel.botSpamChannelId),
340341
hauptwoisText: ensureTextChannel(guild, textChannel.hauptwoisTextChannelId),
342+
roleAssigner: ensureTextChannel(guild, textChannel.roleAssignerChannelId),
341343
},
342344

343345
voiceChannels: {

src/handler/reaction/roleAssignerHandler.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export default {
1818
throw new Error("Channel is not text based");
1919
}
2020

21+
if (channel.id !== context.textChannels.roleAssigner.id) {
22+
return;
23+
}
24+
2125
const message = await reactionEvent.message.fetch();
2226
const { guild } = message;
2327
if (guild === null) {

src/service/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ export interface Config {
156156
votesChannelId: Snowflake;
157157
botSpamChannelId: Snowflake;
158158
hauptwoisTextChannelId: Snowflake;
159+
roleAssignerChannelId: Snowflake;
159160
};
160161

161162
voiceChannel: {

0 commit comments

Comments
 (0)