@@ -5,24 +5,25 @@ import { autorole, rolesChannelId } from '../env';
5
5
export async function autoroleModule ( { client } : Bot ) {
6
6
const channel = await client . channels . fetch ( rolesChannelId ) ;
7
7
if ( ! channel ?. isTextBased ( ) ) {
8
- console . error ( `Roles channel (${ rolesChannelId } ) does not exist or is not text based.` )
8
+ console . error (
9
+ `Roles channel (${ rolesChannelId } ) does not exist or is not text based.` ,
10
+ ) ;
9
11
return ;
10
12
}
11
13
12
14
for ( const ar of autorole ) {
13
15
const msg = await channel . messages . fetch ( ar . msgID ) ;
14
16
if ( ! msg ) {
15
- console . error ( `Role message does not exist for ${ ar . msgID } ` )
17
+ console . error ( `Role message does not exist for ${ ar . msgID } ` ) ;
16
18
}
17
- await msg ?. react ( ar . emoji )
19
+ await msg ?. react ( ar . emoji ) ;
18
20
}
19
21
20
22
client . channels . fetch ( rolesChannelId ) . then ( channel => {
21
- ( channel as TextBasedChannel ) . messages . fetch ( )
22
- } )
23
+ ( channel as TextBasedChannel ) . messages . fetch ( ) ;
24
+ } ) ;
23
25
24
-
25
- client . on ( "messageReactionAdd" , async ( reaction , user ) => {
26
+ client . on ( 'messageReactionAdd' , async ( reaction , user ) => {
26
27
if ( user . id == client . user . id ) return ;
27
28
if ( reaction . partial ) await reaction . fetch ( ) ;
28
29
for ( const ar of autorole ) {
@@ -41,9 +42,9 @@ export async function autoroleModule({ client }: Bot) {
41
42
await msg . react ( reaction . emoji ) ;
42
43
}
43
44
}
44
- } )
45
+ } ) ;
45
46
46
- client . on ( " messageReactionRemove" , async ( reaction , user ) => {
47
+ client . on ( ' messageReactionRemove' , async ( reaction , user ) => {
47
48
if ( user . id == client . user . id ) return ;
48
49
if ( reaction . partial ) await reaction . fetch ( ) ;
49
50
for ( const ar of autorole ) {
@@ -59,5 +60,5 @@ export async function autoroleModule({ client }: Bot) {
59
60
await member . roles . remove ( ar . roleID ) ;
60
61
console . log ( 'Removed role' , ar . roleID , 'from' , member ) ;
61
62
}
62
- } )
63
- }
63
+ } ) ;
64
+ }
0 commit comments