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

chore: clean up unnecessary cache.get ?? fetch

This commit is contained in:
Dragory 2021-10-17 19:56:04 +03:00
parent dcc8dbb615
commit 66b93dd31c
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -13,12 +13,8 @@ export async function runAutomodOnMessage(
message: SavedMessage,
isEdit: boolean,
) {
const member =
pluginData.guild.members.cache.get(message.user_id) ??
(await pluginData.guild.members.fetch(message.user_id).catch(() => undefined));
const user =
pluginData.client.users.cache.get(message.user_id) ??
(await pluginData.client.users.fetch(message.user_id).catch(() => undefined));
const member = await pluginData.guild.members.fetch(message.user_id).catch(() => undefined);
const user = await pluginData.client.users.fetch(message.user_id).catch(() => undefined);
const context: AutomodContext = {
timestamp: moment.utc(message.posted_at).valueOf(),