Skip to content

Commit

Permalink
separate votekicks and reports into their own threads
Browse files Browse the repository at this point in the history
  • Loading branch information
Techbot121 authored and Meta Construct committed Dec 28, 2023
1 parent d56689d commit ec43032
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
2 changes: 1 addition & 1 deletion app/services/gamebridge/payloads/AdminNotifyPayload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default class AdminNotifyPayload extends Payload {

const callAdminRole = guild.roles.cache.get(bridge.config.callAdminRoleId);

const notificationsChannel = guild.channels.cache.get(bridge.config.notificationsChannelId);
const notificationsChannel = guild.channels.cache.get(bridge.config.reportsChannelId);
if (!notificationsChannel) return;

const steamId64 = new SteamID(player.steamId).getSteamID64();
Expand Down
19 changes: 1 addition & 18 deletions app/services/gamebridge/payloads/VoteKickPayload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,6 @@ export default class NotificationPayload extends Payload {
[steamId64: string]: number;
} = {};

// static async initialize(server: GameServer): Promise<void> {
// const discord = server.discord;
// const notificationsChannel = (await discord.channels.fetch(
// server.discord.config.notificationsChannelId
// )) as TextChannel;
// const steam = server.bridge.container.getService("Steam");
// const filter = (btn: MessageComponentInteraction) => btn.customId.endsWith("_VOTEKICK");
// const collector = notificationsChannel.createMessageComponentCollector({ filter });
// collector.on("collect", async (ctx: ButtonInteraction) => {
// await ctx.deferReply();
// if (!(await DiscordClient.isAllowed(server, ctx.user))) return;
// try {
// } catch (err) {}
// await ctx.update({ components: [] });
// });
// }

static async handle(payload: VoteKickRequest, server: GameServer): Promise<void> {
super.handle(payload, server);

Expand All @@ -41,7 +24,7 @@ export default class NotificationPayload extends Payload {
const guild = discordClient.guilds.cache.get(bridge.config.guildId);
if (!guild) return;

const notificationsChannel = guild.channels.cache.get(bridge.config.notificationsChannelId);
const notificationsChannel = guild.channels.cache.get(bridge.config.votekicksChannelId);
if (!notificationsChannel) return;

const relayChannel = guild.channels.cache.get(bridge.config.relayChannelId);
Expand Down

0 comments on commit ec43032

Please sign in to comment.