File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,13 +123,13 @@ function onReady() {
123123 * Event handler for when the bot joins a new guild.
124124 */
125125function onGuildJoin ( guild ) {
126+ let info = unindent ( `Hi there! My role needs to be ordered above any
127+ role you would like me to assign. You're getting this message
128+ because you are the server owner, but anybody with Administrator
129+ permissions or an allowed role can configure me.` ) ;
130+
126131 guild . members . fetch ( client . user . id )
127132 . then ( clientMember => {
128- let info = unindent ( `Hi there! My role needs to be ordered above any
129- role you would like me to assign. You're getting this message
130- because you are the server owner, but anybody with Administrator
131- permissions or an allowed role can configure me.` ) ;
132-
133133 const Perms = Discord . Permissions . FLAGS ;
134134 const requiredPermMap = {
135135 [ Perms . ADD_REACTIONS ] : 'Add Reactions' ,
@@ -157,9 +157,10 @@ function onGuildJoin(guild) {
157157 '\n' + missingPermNames . join ( '\n' ) ;
158158 }
159159
160- return guild . owner . createDM ( )
161- . then ( dmChannel => dmChannel . send ( info ) ) ;
160+ return guild . members . fetch ( guild . ownerID ) ;
162161 } )
162+ . then ( owner => owner . createDM ( ) )
163+ . then ( dmChannel => dmChannel . send ( info ) )
163164 . catch ( logError ) ;
164165}
165166
You can’t perform that action at this time.
0 commit comments