Turn on strict TS compilation. Fix up and tweak types accordingly.
This commit is contained in:
parent
690955a399
commit
629002b8d9
172 changed files with 720 additions and 534 deletions
|
@ -10,23 +10,25 @@ export function getTextMatchPartialSummary(
|
|||
context: AutomodContext,
|
||||
) {
|
||||
if (type === "message") {
|
||||
const channel = pluginData.guild.channels.get(context.message.channel_id);
|
||||
const channelMention = channel ? verboseChannelMention(channel) : `\`#${context.message.channel_id}\``;
|
||||
const message = context.message!;
|
||||
const channel = pluginData.guild.channels.get(message.channel_id);
|
||||
const channelMention = channel ? verboseChannelMention(channel) : `\`#${message.channel_id}\``;
|
||||
|
||||
return `message in ${channelMention}:\n${messageSummary(context.message)}`;
|
||||
return `message in ${channelMention}:\n${messageSummary(message)}`;
|
||||
} else if (type === "embed") {
|
||||
const channel = pluginData.guild.channels.get(context.message.channel_id);
|
||||
const channelMention = channel ? verboseChannelMention(channel) : `\`#${context.message.channel_id}\``;
|
||||
const message = context.message!;
|
||||
const channel = pluginData.guild.channels.get(message.channel_id);
|
||||
const channelMention = channel ? verboseChannelMention(channel) : `\`#${message.channel_id}\``;
|
||||
|
||||
return `message embed in ${channelMention}:\n${messageSummary(context.message)}`;
|
||||
return `message embed in ${channelMention}:\n${messageSummary(message)}`;
|
||||
} else if (type === "username") {
|
||||
return `username: ${context.user.username}`;
|
||||
return `username: ${context.user!.username}`;
|
||||
} else if (type === "nickname") {
|
||||
return `nickname: ${context.member.nick}`;
|
||||
return `nickname: ${context.member!.nick}`;
|
||||
} else if (type === "visiblename") {
|
||||
const visibleName = context.member?.nick || context.user.username;
|
||||
const visibleName = context.member?.nick || context.user!.username;
|
||||
return `visible name: ${visibleName}`;
|
||||
} else if (type === "customstatus") {
|
||||
return `custom status: ${context.member.game.state}`;
|
||||
return `custom status: ${context.member!.game!.state}`;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue