File tree Expand file tree Collapse file tree 4 files changed +15
-16
lines changed Expand file tree Collapse file tree 4 files changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,11 @@ export const messageCreate: GatewayEventHandler = async (
9
9
d : MessagePayload
10
10
) => {
11
11
let channel = await gateway . client . channels . get < TextChannel > ( d . channel_id )
12
- // Fetch the channel if not cached
13
- if ( channel === undefined )
14
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
15
- channel = ( await gateway . client . channels . fetch ( d . channel_id ) ) as TextChannel
12
+ // Fetch the channel if not cached.
13
+ // Commented out right now as it causes some undefined behavior.
14
+ // if (channel === undefined)
15
+ // // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
16
+ // channel = (await gateway.client.channels.fetch(d.channel_id)) as TextChannel
16
17
if ( channel === undefined ) return
17
18
await channel . messages . set ( d . id , d )
18
19
const user = new User ( gateway . client , d . author )
Original file line number Diff line number Diff line change @@ -7,10 +7,9 @@ export const messageDelete: GatewayEventHandler = async (
7
7
d : MessageDeletePayload
8
8
) => {
9
9
let channel = await gateway . client . channels . get < TextChannel > ( d . channel_id )
10
- // Fetch the channel if not cached
11
- if ( channel === undefined )
12
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
13
- channel = ( await gateway . client . channels . fetch ( d . channel_id ) ) as TextChannel
10
+ // if (channel === undefined)
11
+ // // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
12
+ // channel = (await gateway.client.channels.fetch(d.channel_id)) as TextChannel
14
13
if ( channel === undefined ) return
15
14
const message = await channel . messages . get ( d . id )
16
15
if ( message === undefined )
Original file line number Diff line number Diff line change @@ -12,11 +12,11 @@ export const messageDeleteBulk: GatewayEventHandler = async (
12
12
d . channel_id
13
13
)
14
14
// Fetch the channel if not cached
15
- if ( channel === undefined )
16
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
17
- channel = ( await gateway . client . channels . fetch (
18
- d . channel_id
19
- ) ) as GuildTextBasedChannel
15
+ // if (channel === undefined)
16
+ // // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
17
+ // channel = (await gateway.client.channels.fetch(
18
+ // d.channel_id
19
+ // )) as GuildTextBasedChannel
20
20
if ( channel === undefined ) return
21
21
const messages = new Collection < string , Message > ( )
22
22
const uncached = new Set < string > ( )
Original file line number Diff line number Diff line change @@ -8,9 +8,8 @@ export const messageUpdate: GatewayEventHandler = async (
8
8
d : MessagePayload
9
9
) => {
10
10
let channel = await gateway . client . channels . get < TextChannel > ( d . channel_id )
11
- // Fetch the channel if not cached
12
- if ( channel === undefined )
13
- channel = await gateway . client . channels . fetch ( d . channel_id )
11
+ // if (channel === undefined)
12
+ // channel = await gateway.client.channels.fetch(d.channel_id)
14
13
15
14
if ( channel === undefined ) return
16
15
You can’t perform that action at this time.
0 commit comments