mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
Logs: fix crash in userMention/channelMention if the user/channel doesn't exist
This commit is contained in:
parent
8f898ed972
commit
db5d93b5c2
1 changed files with 2 additions and 0 deletions
|
@ -174,6 +174,7 @@ export class LogsPlugin extends ZeppelinPlugin<ILogsPluginConfig, ILogsPluginPer
|
|||
formatted = await renderTemplate(format, {
|
||||
...data,
|
||||
userMention: user => {
|
||||
if (!user) return "";
|
||||
if (user.user) user = user.user;
|
||||
|
||||
const member = this.guild.members.get(user.id);
|
||||
|
@ -186,6 +187,7 @@ export class LogsPlugin extends ZeppelinPlugin<ILogsPluginConfig, ILogsPluginPer
|
|||
}
|
||||
},
|
||||
channelMention: channel => {
|
||||
if (!channel) return "";
|
||||
return `<#${channel.id}> (**#${channel.name}**, \`${channel.id}\`)`;
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue