Skip to content

Commit

Permalink
???
Browse files Browse the repository at this point in the history
  • Loading branch information
Techbot121 authored and Meta Construct committed Jun 14, 2024
1 parent 68e1d14 commit f846077
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/services/gamebridge/payloads/AdminNotifyPayload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ export default class AdminNotifyPayload extends Payload {

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

const notificationsChannel = (
guild.channels.cache.get(bridge.config.notificationsChannelId) as Discord.TextChannel
).threads.cache.get(bridge.config.reportsChannelId);
const notificationsChannel = (await guild.channels.fetch(
bridge.config.notificationsChannelId
)) as Discord.TextChannel;
if (!notificationsChannel) return;
const thread = await notificationsChannel.threads.fetch(bridge.config.reportsChannelId);
if (!thread) return;

const steamId64 = new SteamID(player.steamId).getSteamID64();
const reportedSteamId64 = new SteamID(reported.steamId).getSteamID64();
Expand Down Expand Up @@ -139,7 +141,7 @@ export default class AdminNotifyPayload extends Payload {
);

try {
await notificationsChannel.send({
await thread.send({
content: callAdminRole && `<@&${callAdminRole.id}>`,
embeds: [embed],
components: [row],
Expand All @@ -148,7 +150,7 @@ export default class AdminNotifyPayload extends Payload {
embed.spliceFields(1, 1);
// embed.data.fields = embed.data.fields.filter(f => f.name !== "Message");

await notificationsChannel.send({
await thread.send({
content: callAdminRole && `<@&${callAdminRole.id}>`,
files: [
{
Expand Down

0 comments on commit f846077

Please sign in to comment.