File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -145,10 +145,12 @@ export class DiscordBot extends Service {
145
145
) : Promise < boolean > {
146
146
if ( ! this . ready || name . length > 22 ) return false ;
147
147
try {
148
- const nick = name . charAt ( 0 ) . toUpperCase ( ) + name . slice ( 1 ) ;
149
- this . data . lastDiscordNickName = this . getNickname ( ) ?? "Meta" ;
148
+ let newNick = name . charAt ( 0 ) . toUpperCase ( ) + name . slice ( 1 ) ;
149
+ const currentNick = this . getNickname ( ) ;
150
+ this . data . lastDiscordNickName = currentNick ?? "Meta" ;
151
+ if ( currentNick === newNick ) newNick = "Meta" ;
150
152
await this . data . save ( ) ;
151
- await this . getGuild ( ) ?. members . me ?. setNickname ( nick + " Construct" , reason ) ;
153
+ await this . getGuild ( ) ?. members . me ?. setNickname ( newNick + " Construct" , reason ) ;
152
154
return true ;
153
155
} catch {
154
156
return false ;
You can’t perform that action at this time.
0 commit comments