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

use optional chaining and createdTimestamp on embed

This commit is contained in:
almeidx 2021-07-29 01:18:06 +01:00
parent 87cc461c79
commit 3a59f772ae
No known key found for this signature in database
GPG key ID: 8558FBFF849BD664
2 changed files with 3 additions and 3 deletions

View file

@ -120,8 +120,8 @@ export async function logAndDetectMessageSpam(
// Then, if enabled, remove the spam messages
if (spamConfig.clean !== false) {
msgIds.forEach(id => pluginData.state.logs.ignoreLog(LogType.MESSAGE_DELETE, id));
(pluginData.guild.channels.cache.get(savedMessage.channel_id as Snowflake)! as TextChannel)
.bulkDelete(msgIds as Snowflake[])
(pluginData.guild.channels.cache.get(savedMessage.channel_id as Snowflake)! as TextChannel | undefined)
?.bulkDelete(msgIds as Snowflake[])
.catch(noop);
}

View file

@ -21,7 +21,7 @@ export function createStarboardEmbedFromMessage(
name: `${msg.author.tag}`,
},
fields: [],
timestamp: msg.createdAt,
timestamp: msg.createdTimestamp,
};
if (color != null) {