chore: clean up unnecessary cache.get ?? fetch
This commit is contained in:
parent
dcc8dbb615
commit
66b93dd31c
1 changed files with 2 additions and 6 deletions
|
@ -13,12 +13,8 @@ export async function runAutomodOnMessage(
|
||||||
message: SavedMessage,
|
message: SavedMessage,
|
||||||
isEdit: boolean,
|
isEdit: boolean,
|
||||||
) {
|
) {
|
||||||
const member =
|
const member = await pluginData.guild.members.fetch(message.user_id).catch(() => undefined);
|
||||||
pluginData.guild.members.cache.get(message.user_id) ??
|
const user = await pluginData.client.users.fetch(message.user_id).catch(() => undefined);
|
||||||
(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 context: AutomodContext = {
|
const context: AutomodContext = {
|
||||||
timestamp: moment.utc(message.posted_at).valueOf(),
|
timestamp: moment.utc(message.posted_at).valueOf(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue