mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-25 18:25:03 +00:00
eris leftovers
This commit is contained in:
parent
bb27680a96
commit
dcbe8c9eb2
4 changed files with 9 additions and 67 deletions
|
@ -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`;
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue