3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-25 18:25:03 +00:00

eris leftovers

This commit is contained in:
almeidx 2021-08-14 16:23:05 +01:00
parent bb27680a96
commit dcbe8c9eb2
No known key found for this signature in database
GPG key ID: C5FF0C40763546C5
4 changed files with 9 additions and 67 deletions

View file

@ -1,6 +1,6 @@
import * as t from "io-ts";
import { ChannelTypeStrings } from "../../../types";
import { automodTrigger } from "../helpers";
import { Constants } from "eris";
interface JoinVoiceChannelResult {
matchedChannelId: string;
@ -36,11 +36,11 @@ export const JoinVoiceChannelTrigger = automodTrigger<JoinVoiceChannelResult>()(
},
renderMatchInformation({ matchResult, pluginData, contexts }) {
const channel = pluginData.guild.channels.get(matchResult.extra.matchedChannelId);
const channelName = channel?.name || "Unknown";
const channel = pluginData.guild.channels.resolve(matchResult.extra.matchedChannelId);
const channelName = channel?.name ?? "Unknown";
const member = contexts[0].member!;
const memberName = `**${member.user.username}#${member.user.discriminator}** (\`${member.id}\`)`;
const voiceOrStage = channel?.type === Constants.ChannelTypes.GUILD_STAGE ? "stage" : "voice";
const voiceOrStage = channel?.type === ChannelTypeStrings.STAGE ? "stage" : "voice";
return `${memberName} has joined the ${channelName} (\`${matchResult.extra.matchedChannelId}\`) ${voiceOrStage} channel`;
},
});