Only log username changes for users on the current server
This commit is contained in:
parent
13a38a2f64
commit
1fef4128cf
1 changed files with 2 additions and 0 deletions
|
@ -401,6 +401,8 @@ export class LogsPlugin extends ZeppelinPlugin<ILogsPluginConfig> {
|
||||||
async onUserUpdate(user: User, oldUser: User) {
|
async onUserUpdate(user: User, oldUser: User) {
|
||||||
if (!oldUser) return;
|
if (!oldUser) return;
|
||||||
|
|
||||||
|
if (!this.guild.members.has(user.id)) return;
|
||||||
|
|
||||||
if (user.username !== oldUser.username || user.discriminator !== oldUser.discriminator) {
|
if (user.username !== oldUser.username || user.discriminator !== oldUser.discriminator) {
|
||||||
this.guildLogs.log(LogType.MEMBER_USERNAME_CHANGE, {
|
this.guildLogs.log(LogType.MEMBER_USERNAME_CHANGE, {
|
||||||
user: stripObjectToScalars(user),
|
user: stripObjectToScalars(user),
|
||||||
|
|
Loading…
Add table
Reference in a new issue