Browse Source

verify with rename

Markus-Rost 5 years ago
parent
commit
6cba195e02
10 changed files with 113 additions and 13 deletions
  1. 7 0
      i18n/de.json
  2. 7 0
      i18n/en.json
  3. 7 0
      i18n/fr.json
  4. 7 0
      i18n/nl.json
  5. 7 0
      i18n/pl.json
  6. 7 0
      i18n/pt.json
  7. 7 0
      i18n/ru.json
  8. 7 0
      i18n/tr.json
  9. 7 0
      i18n/zh.json
  10. 50 13
      main.js

+ 7 - 0
i18n/de.json

@@ -99,6 +99,11 @@
 		"and": "und",
 		"and": "und",
 		"accountage": "Account-Alter:",
 		"accountage": "Account-Alter:",
 		"indays": "(in Tagen)",
 		"indays": "(in Tagen)",
+		"rename": "Ändere Nickname:",
+		"enabled": "aktiviert",
+		"disabled": "deaktiviert",
+		"toggle": "(umschalten)",
+		"rename_no_permission": "**%s fehlt die `Nicknames verwalten` Berechtigung um Wiki-Benutzernamen zu erzwingen!**",
 		"role_too_high": "**Die Rolle %1$s ist zu hoch für %2$s um sie zu vergeben!**",
 		"role_too_high": "**Die Rolle %1$s ist zu hoch für %2$s um sie zu vergeben!**",
 		"channel_max": "du hast zu viele Kanäle angegeben.",
 		"channel_max": "du hast zu viele Kanäle angegeben.",
 		"channel_missing": "der angegebe Kanal existiert nicht.",
 		"channel_missing": "der angegebe Kanal existiert nicht.",
@@ -121,6 +126,7 @@
 		"footer": "Wiki-Account-Verifizierung",
 		"footer": "Wiki-Account-Verifizierung",
 		"failed_gblock": "**Test auf globale Sperre schlug fehl!**",
 		"failed_gblock": "**Test auf globale Sperre schlug fehl!**",
 		"failed_roles": "**Hinzufügen von Rollen schlug fehl!**",
 		"failed_roles": "**Hinzufügen von Rollen schlug fehl!**",
+		"failed_rename": "**Ändern des Nickname schlug fehl!**",
 		"audit_reason": "Verifziert als „%s“",
 		"audit_reason": "Verifziert als „%s“",
 		"user_missing": "Der Wiki-Benutzer „%s“ existiert nicht.",
 		"user_missing": "Der Wiki-Benutzer „%s“ existiert nicht.",
 		"user_missing_reply": "der von dir verlinkte Wiki-Benutzer „%s“ existiert nicht.",
 		"user_missing_reply": "der von dir verlinkte Wiki-Benutzer „%s“ existiert nicht.",
@@ -136,6 +142,7 @@
 		"user_matches_reply": "dein Discord-Tag stimmt mit dem Wiki-Benutzer „%s“ überein, du erfüllst aber keine Kriterien für Rollen.",
 		"user_matches_reply": "dein Discord-Tag stimmt mit dem Wiki-Benutzer „%s“ überein, du erfüllst aber keine Kriterien für Rollen.",
 		"user_verified": "Discord-Benutzer %1$s wurde erfolgreich als Wiki-Benutzer %2$s verifiziert.",
 		"user_verified": "Discord-Benutzer %1$s wurde erfolgreich als Wiki-Benutzer %2$s verifiziert.",
 		"user_verified_reply": "du wurdest erfolgreich als Wiki-Benutzer „%s“ verifiziert.",
 		"user_verified_reply": "du wurdest erfolgreich als Wiki-Benutzer „%s“ verifiziert.",
+		"user_renamed": "Sein Discord-Nickname wurde zu seinem Wiki-Benutzernamen geändert.",
 		"discord": "Discord-Benutzer:",
 		"discord": "Discord-Benutzer:",
 		"wiki": "Wiki-Benutzer:",
 		"wiki": "Wiki-Benutzer:",
 		"empty": "*leer*",
 		"empty": "*leer*",

+ 7 - 0
i18n/en.json

@@ -94,6 +94,11 @@
 		"and": "and",
 		"and": "and",
 		"accountage": "Account age:",
 		"accountage": "Account age:",
 		"indays": "(in days)",
 		"indays": "(in days)",
+		"rename": "Change nickname:",
+		"enabled": "enabled",
+		"disabled": "disabled",
+		"toggle": "(toggle)",
+		"rename_no_permission": "**%s is missing the `Manage Nicknames` permission to force wiki usernames!**",
 		"role_too_high": "**The role %1$s is too high for %2$s to assign!**",
 		"role_too_high": "**The role %1$s is too high for %2$s to assign!**",
 		"channel_max": "you provided too many channels.",
 		"channel_max": "you provided too many channels.",
 		"channel_missing": "the provided channel does not exist.",
 		"channel_missing": "the provided channel does not exist.",
@@ -116,6 +121,7 @@
 		"footer": "Wiki Account Verification",
 		"footer": "Wiki Account Verification",
 		"failed_gblock": "**Check for global block failed!**",
 		"failed_gblock": "**Check for global block failed!**",
 		"failed_roles": "**Adding roles failed!**",
 		"failed_roles": "**Adding roles failed!**",
+		"failed_rename": "**Changing the nickname failed!**",
 		"audit_reason": "Verified as \"%s\"",
 		"audit_reason": "Verified as \"%s\"",
 		"user_missing": "The wiki user \"%s\" doesn't exist.",
 		"user_missing": "The wiki user \"%s\" doesn't exist.",
 		"user_missing_reply": "your linked wiki user \"%s\" doesn't exist.",
 		"user_missing_reply": "your linked wiki user \"%s\" doesn't exist.",
@@ -131,6 +137,7 @@
 		"user_matches_reply": "your Discord tag matches the wiki user \"%s\", but you don't meet the requirements for any roles.",
 		"user_matches_reply": "your Discord tag matches the wiki user \"%s\", but you don't meet the requirements for any roles.",
 		"user_verified": "Discord user %1$s has been successfully verified as wiki user %2$s.",
 		"user_verified": "Discord user %1$s has been successfully verified as wiki user %2$s.",
 		"user_verified_reply": "you have been successfully verified as wiki user \"%s\".",
 		"user_verified_reply": "you have been successfully verified as wiki user \"%s\".",
+		"user_renamed": "Their Discord nickname has been changed to their wiki username.",
 		"discord": "Discord user:",
 		"discord": "Discord user:",
 		"wiki": "Wiki user:",
 		"wiki": "Wiki user:",
 		"empty": "*empty*",
 		"empty": "*empty*",

+ 7 - 0
i18n/fr.json

@@ -96,6 +96,11 @@
 		"and": "and",
 		"and": "and",
 		"accountage": "Account age:",
 		"accountage": "Account age:",
 		"indays": "(in days)",
 		"indays": "(in days)",
+		"rename": "Change nickname:",
+		"enabled": "enabled",
+		"disabled": "disabled",
+		"toggle": "(toggle)",
+		"rename_no_permission": "**%s is missing the `Manage Nicknames` permission to force wiki usernames!**",
 		"role_too_high": "**The role %1$s is too high for %2$s to assign!**",
 		"role_too_high": "**The role %1$s is too high for %2$s to assign!**",
 		"channel_max": "too many channels provided.",
 		"channel_max": "too many channels provided.",
 		"channel_missing": "the provided channel does not exist.",
 		"channel_missing": "the provided channel does not exist.",
@@ -118,6 +123,7 @@
 		"footer": "Wiki Account Verification",
 		"footer": "Wiki Account Verification",
 		"failed_gblock": "**Check for global block failed!**",
 		"failed_gblock": "**Check for global block failed!**",
 		"failed_roles": "**Adding roles failed!**",
 		"failed_roles": "**Adding roles failed!**",
+		"failed_rename": "**Changing the nickname failed!**",
 		"audit_reason": "Verified as \"%s\"",
 		"audit_reason": "Verified as \"%s\"",
 		"user_missing": "The wiki user \"%s\" doesn't exist.",
 		"user_missing": "The wiki user \"%s\" doesn't exist.",
 		"user_missing_reply": "your linked wiki user \"%s\" doesn't exist.",
 		"user_missing_reply": "your linked wiki user \"%s\" doesn't exist.",
@@ -133,6 +139,7 @@
 		"user_matches_reply": "your Discord tag matches the wiki user \"%s\", but you don't meet the requirements for any roles.",
 		"user_matches_reply": "your Discord tag matches the wiki user \"%s\", but you don't meet the requirements for any roles.",
 		"user_verified": "Discord user %1$s has been successfully verified as wiki user %2$s.",
 		"user_verified": "Discord user %1$s has been successfully verified as wiki user %2$s.",
 		"user_verified_reply": "you have been successfully verified as wiki user \"%s\".",
 		"user_verified_reply": "you have been successfully verified as wiki user \"%s\".",
+		"user_renamed": "Their Discord nickname has been changed to their wiki username.",
 		"discord": "Discord user:",
 		"discord": "Discord user:",
 		"wiki": "Wiki user:",
 		"wiki": "Wiki user:",
 		"empty": "*empty*",
 		"empty": "*empty*",

+ 7 - 0
i18n/nl.json

@@ -98,6 +98,11 @@
 		"and": "and",
 		"and": "and",
 		"accountage": "Account age:",
 		"accountage": "Account age:",
 		"indays": "(in days)",
 		"indays": "(in days)",
+		"rename": "Change nickname:",
+		"enabled": "enabled",
+		"disabled": "disabled",
+		"toggle": "(toggle)",
+		"rename_no_permission": "**%s is missing the `Manage Nicknames` permission to force wiki usernames!**",
 		"role_too_high": "**The role %1$s is too high for %2$s to assign!**",
 		"role_too_high": "**The role %1$s is too high for %2$s to assign!**",
 		"channel_max": "too many channels provided.",
 		"channel_max": "too many channels provided.",
 		"channel_missing": "the provided channel does not exist.",
 		"channel_missing": "the provided channel does not exist.",
@@ -120,6 +125,7 @@
 		"footer": "Wiki Account Verification",
 		"footer": "Wiki Account Verification",
 		"failed_gblock": "**Check for global block failed!**",
 		"failed_gblock": "**Check for global block failed!**",
 		"failed_roles": "**Adding roles failed!**",
 		"failed_roles": "**Adding roles failed!**",
+		"failed_rename": "**Changing the nickname failed!**",
 		"audit_reason": "Verified as \"%s\"",
 		"audit_reason": "Verified as \"%s\"",
 		"user_missing": "The wiki user \"%s\" doesn't exist.",
 		"user_missing": "The wiki user \"%s\" doesn't exist.",
 		"user_missing_reply": "your linked wiki user \"%s\" doesn't exist.",
 		"user_missing_reply": "your linked wiki user \"%s\" doesn't exist.",
@@ -135,6 +141,7 @@
 		"user_matches_reply": "your Discord tag matches the wiki user \"%s\", but you don't meet the requirements for any roles.",
 		"user_matches_reply": "your Discord tag matches the wiki user \"%s\", but you don't meet the requirements for any roles.",
 		"user_verified": "Discord user %1$s has been successfully verified as wiki user %2$s.",
 		"user_verified": "Discord user %1$s has been successfully verified as wiki user %2$s.",
 		"user_verified_reply": "you have been successfully verified as wiki user \"%s\".",
 		"user_verified_reply": "you have been successfully verified as wiki user \"%s\".",
+		"user_renamed": "Their Discord nickname has been changed to their wiki username.",
 		"discord": "Discord user:",
 		"discord": "Discord user:",
 		"wiki": "Wiki user:",
 		"wiki": "Wiki user:",
 		"empty": "*empty*",
 		"empty": "*empty*",

+ 7 - 0
i18n/pl.json

@@ -99,6 +99,11 @@
 		"and": "oraz",
 		"and": "oraz",
 		"accountage": "Wiek konta:",
 		"accountage": "Wiek konta:",
 		"indays": "(w dniach)",
 		"indays": "(w dniach)",
+		"rename": "Change nickname:",
+		"enabled": "enabled",
+		"disabled": "disabled",
+		"toggle": "(toggle)",
+		"rename_no_permission": "**%s is missing the `Manage Nicknames` permission to force wiki usernames!**",
 		"role_too_high": "**Rola %1$s jest wyżej niż najwyższa rola %2$s, dlatego nie będzie możliwe jej ustawienie!**",
 		"role_too_high": "**Rola %1$s jest wyżej niż najwyższa rola %2$s, dlatego nie będzie możliwe jej ustawienie!**",
 		"channel_max": "podano zbyt dużo kanałów.",
 		"channel_max": "podano zbyt dużo kanałów.",
 		"channel_missing": "podany kanał nie istnieje.",
 		"channel_missing": "podany kanał nie istnieje.",
@@ -121,6 +126,7 @@
 		"footer": "Weryfikacja konta wiki",
 		"footer": "Weryfikacja konta wiki",
 		"failed_gblock": "**Sprawdzenie globalnych blokad nie powiodło się!**",
 		"failed_gblock": "**Sprawdzenie globalnych blokad nie powiodło się!**",
 		"failed_roles": "**Dodawanie ról nie powiodło się!**",
 		"failed_roles": "**Dodawanie ról nie powiodło się!**",
+		"failed_rename": "**Changing the nickname failed!**",
 		"audit_reason": "Zweryfikowano jako \"%s\"",
 		"audit_reason": "Zweryfikowano jako \"%s\"",
 		"user_missing": "Użytkownik wiki \"%s\" nie istnieje.",
 		"user_missing": "Użytkownik wiki \"%s\" nie istnieje.",
 		"user_missing_reply": "konto zalinkowanego użytkownika wiki \"%s\" nie istnieje.",
 		"user_missing_reply": "konto zalinkowanego użytkownika wiki \"%s\" nie istnieje.",
@@ -136,6 +142,7 @@
 		"user_matches_reply": "Twoja nazwa użytkownika Discord pokrywa się z nazwą użytkownika z wiki \"%s\", lecz nie kwalifikuje na żadną rolę.",
 		"user_matches_reply": "Twoja nazwa użytkownika Discord pokrywa się z nazwą użytkownika z wiki \"%s\", lecz nie kwalifikuje na żadną rolę.",
 		"user_verified": "Pomyślnie zweryfikowano użytkownika Discord %1$s jako użytkownika wiki %2$s.",
 		"user_verified": "Pomyślnie zweryfikowano użytkownika Discord %1$s jako użytkownika wiki %2$s.",
 		"user_verified_reply": "pomyślnie zweryfikowano Ciebie jako użytkownika wiki \"%s\".",
 		"user_verified_reply": "pomyślnie zweryfikowano Ciebie jako użytkownika wiki \"%s\".",
+		"user_renamed": "Their Discord nickname has been changed to their wiki username.",
 		"discord": "Użytkownik Discord:",
 		"discord": "Użytkownik Discord:",
 		"wiki": "Użytkownik Wiki:",
 		"wiki": "Użytkownik Wiki:",
 		"empty": "*puste*",
 		"empty": "*puste*",

+ 7 - 0
i18n/pt.json

@@ -99,6 +99,11 @@
 		"and": "e",
 		"and": "e",
 		"accountage": "Idade da conta:",
 		"accountage": "Idade da conta:",
 		"indays": "(em dias)",
 		"indays": "(em dias)",
+		"rename": "Change nickname:",
+		"enabled": "enabled",
+		"disabled": "disabled",
+		"toggle": "(toggle)",
+		"rename_no_permission": "**%s is missing the `Manage Nicknames` permission to force wiki usernames!**",
 		"role_too_high": "**A função %1$s é muito alto para %2$s para atribuir!**",
 		"role_too_high": "**A função %1$s é muito alto para %2$s para atribuir!**",
 		"channel_max": "muitos canais fornecidos.",
 		"channel_max": "muitos canais fornecidos.",
 		"channel_missing": "o canal fornecido não existe.",
 		"channel_missing": "o canal fornecido não existe.",
@@ -121,6 +126,7 @@
 		"footer": "Verificação de conta da wiki",
 		"footer": "Verificação de conta da wiki",
 		"failed_gblock": "**Falha na verificação de bloqueio global!**",
 		"failed_gblock": "**Falha na verificação de bloqueio global!**",
 		"failed_roles": "**A adição de funções falhou!**",
 		"failed_roles": "**A adição de funções falhou!**",
+		"failed_rename": "**Changing the nickname failed!**",
 		"audit_reason": "Verificado como \"%s\"",
 		"audit_reason": "Verificado como \"%s\"",
 		"user_missing": "O usuário da wiki \"%s\" não existe.",
 		"user_missing": "O usuário da wiki \"%s\" não existe.",
 		"user_missing_reply": "seu usuário da wiki vinculado \"%s\" não existe.",
 		"user_missing_reply": "seu usuário da wiki vinculado \"%s\" não existe.",
@@ -136,6 +142,7 @@
 		"user_matches_reply": "seu nome de usuário do Discord corresponde ao usuário da wiki \"%s\", mas você não atende aos requisitos para nenhuma função.",
 		"user_matches_reply": "seu nome de usuário do Discord corresponde ao usuário da wiki \"%s\", mas você não atende aos requisitos para nenhuma função.",
 		"user_verified": "Usuário do Discord %1$s foi verificado com sucesso como usuário da wiki %2$s.",
 		"user_verified": "Usuário do Discord %1$s foi verificado com sucesso como usuário da wiki %2$s.",
 		"user_verified_reply": "você foi verificado com sucesso como usuário da wiki \"%s\".",
 		"user_verified_reply": "você foi verificado com sucesso como usuário da wiki \"%s\".",
+		"user_renamed": "Their Discord nickname has been changed to their wiki username.",
 		"discord": "Usuário do Discord:",
 		"discord": "Usuário do Discord:",
 		"wiki": "Usuário da wiki:",
 		"wiki": "Usuário da wiki:",
 		"empty": "*vazio*",
 		"empty": "*vazio*",

+ 7 - 0
i18n/ru.json

@@ -96,6 +96,11 @@
 		"and": "and",
 		"and": "and",
 		"accountage": "Account age:",
 		"accountage": "Account age:",
 		"indays": "(in days)",
 		"indays": "(in days)",
+		"rename": "Change nickname:",
+		"enabled": "enabled",
+		"disabled": "disabled",
+		"toggle": "(toggle)",
+		"rename_no_permission": "**%s is missing the `Manage Nicknames` permission to force wiki usernames!**",
 		"role_too_high": "**The role %1$s is too high for %2$s to assign!**",
 		"role_too_high": "**The role %1$s is too high for %2$s to assign!**",
 		"channel_max": "too many channels provided.",
 		"channel_max": "too many channels provided.",
 		"channel_missing": "the provided channel does not exist.",
 		"channel_missing": "the provided channel does not exist.",
@@ -118,6 +123,7 @@
 		"footer": "Wiki Account Verification",
 		"footer": "Wiki Account Verification",
 		"failed_gblock": "**Check for global block failed!**",
 		"failed_gblock": "**Check for global block failed!**",
 		"failed_roles": "**Adding roles failed!**",
 		"failed_roles": "**Adding roles failed!**",
+		"failed_rename": "**Changing the nickname failed!**",
 		"audit_reason": "Verified as \"%s\"",
 		"audit_reason": "Verified as \"%s\"",
 		"user_missing": "The wiki user \"%s\" doesn't exist.",
 		"user_missing": "The wiki user \"%s\" doesn't exist.",
 		"user_missing_reply": "your linked wiki user \"%s\" doesn't exist.",
 		"user_missing_reply": "your linked wiki user \"%s\" doesn't exist.",
@@ -133,6 +139,7 @@
 		"user_matches_reply": "your Discord tag matches the wiki user \"%s\", but you don't meet the requirements for any roles.",
 		"user_matches_reply": "your Discord tag matches the wiki user \"%s\", but you don't meet the requirements for any roles.",
 		"user_verified": "Discord user %1$s has been successfully verified as wiki user %2$s.",
 		"user_verified": "Discord user %1$s has been successfully verified as wiki user %2$s.",
 		"user_verified_reply": "you have been successfully verified as wiki user \"%s\".",
 		"user_verified_reply": "you have been successfully verified as wiki user \"%s\".",
+		"user_renamed": "Their Discord nickname has been changed to their wiki username.",
 		"discord": "Discord user:",
 		"discord": "Discord user:",
 		"wiki": "Wiki user:",
 		"wiki": "Wiki user:",
 		"empty": "*empty*",
 		"empty": "*empty*",

+ 7 - 0
i18n/tr.json

@@ -98,6 +98,11 @@
 		"and": "and",
 		"and": "and",
 		"accountage": "Account age:",
 		"accountage": "Account age:",
 		"indays": "(in days)",
 		"indays": "(in days)",
+		"rename": "Change nickname:",
+		"enabled": "enabled",
+		"disabled": "disabled",
+		"toggle": "(toggle)",
+		"rename_no_permission": "**%s is missing the `Manage Nicknames` permission to force wiki usernames!**",
 		"role_too_high": "**The role %1$s is too high for %2$s to assign!**",
 		"role_too_high": "**The role %1$s is too high for %2$s to assign!**",
 		"channel_max": "too many channels provided.",
 		"channel_max": "too many channels provided.",
 		"channel_missing": "the provided channel does not exist.",
 		"channel_missing": "the provided channel does not exist.",
@@ -120,6 +125,7 @@
 		"footer": "Wiki Account Verification",
 		"footer": "Wiki Account Verification",
 		"failed_gblock": "**Check for global block failed!**",
 		"failed_gblock": "**Check for global block failed!**",
 		"failed_roles": "**Adding roles failed!**",
 		"failed_roles": "**Adding roles failed!**",
+		"failed_rename": "**Changing the nickname failed!**",
 		"audit_reason": "Verified as \"%s\"",
 		"audit_reason": "Verified as \"%s\"",
 		"user_missing": "The wiki user \"%s\" doesn't exist.",
 		"user_missing": "The wiki user \"%s\" doesn't exist.",
 		"user_missing_reply": "your linked wiki user \"%s\" doesn't exist.",
 		"user_missing_reply": "your linked wiki user \"%s\" doesn't exist.",
@@ -135,6 +141,7 @@
 		"user_matches_reply": "your Discord tag matches the wiki user \"%s\", but you don't meet the requirements for any roles.",
 		"user_matches_reply": "your Discord tag matches the wiki user \"%s\", but you don't meet the requirements for any roles.",
 		"user_verified": "Discord user %1$s has been successfully verified as wiki user %2$s.",
 		"user_verified": "Discord user %1$s has been successfully verified as wiki user %2$s.",
 		"user_verified_reply": "you have been successfully verified as wiki user \"%s\".",
 		"user_verified_reply": "you have been successfully verified as wiki user \"%s\".",
+		"user_renamed": "Their Discord nickname has been changed to their wiki username.",
 		"discord": "Discord user:",
 		"discord": "Discord user:",
 		"wiki": "Wiki user:",
 		"wiki": "Wiki user:",
 		"empty": "*empty*",
 		"empty": "*empty*",

+ 7 - 0
i18n/zh.json

@@ -96,6 +96,11 @@
 		"and": "and",
 		"and": "and",
 		"accountage": "Account age:",
 		"accountage": "Account age:",
 		"indays": "(in days)",
 		"indays": "(in days)",
+		"rename": "Change nickname:",
+		"enabled": "enabled",
+		"disabled": "disabled",
+		"toggle": "(toggle)",
+		"rename_no_permission": "**%s is missing the `Manage Nicknames` permission to force wiki usernames!**",
 		"role_too_high": "**The role %1$s is too high for %2$s to assign!**",
 		"role_too_high": "**The role %1$s is too high for %2$s to assign!**",
 		"channel_max": "too many channels provided.",
 		"channel_max": "too many channels provided.",
 		"channel_missing": "the provided channel does not exist.",
 		"channel_missing": "the provided channel does not exist.",
@@ -118,6 +123,7 @@
 		"footer": "Wiki Account Verification",
 		"footer": "Wiki Account Verification",
 		"failed_gblock": "**Check for global block failed!**",
 		"failed_gblock": "**Check for global block failed!**",
 		"failed_roles": "**Adding roles failed!**",
 		"failed_roles": "**Adding roles failed!**",
+		"failed_rename": "**Changing the nickname failed!**",
 		"audit_reason": "Verified as \"%s\"",
 		"audit_reason": "Verified as \"%s\"",
 		"user_missing": "The wiki user \"%s\" doesn't exist.",
 		"user_missing": "The wiki user \"%s\" doesn't exist.",
 		"user_missing_reply": "your linked wiki user \"%s\" doesn't exist.",
 		"user_missing_reply": "your linked wiki user \"%s\" doesn't exist.",
@@ -133,6 +139,7 @@
 		"user_matches_reply": "your Discord tag matches the wiki user \"%s\", but you don't meet the requirements for any roles.",
 		"user_matches_reply": "your Discord tag matches the wiki user \"%s\", but you don't meet the requirements for any roles.",
 		"user_verified": "Discord user %1$s has been successfully verified as wiki user %2$s.",
 		"user_verified": "Discord user %1$s has been successfully verified as wiki user %2$s.",
 		"user_verified_reply": "you have been successfully verified as wiki user \"%s\".",
 		"user_verified_reply": "you have been successfully verified as wiki user \"%s\".",
+		"user_renamed": "Their Discord nickname has been changed to their wiki username.",
 		"discord": "Discord user:",
 		"discord": "Discord user:",
 		"wiki": "Wiki user:",
 		"wiki": "Wiki user:",
 		"empty": "*empty*",
 		"empty": "*empty*",

+ 50 - 13
main.js

@@ -63,7 +63,7 @@ const minecraft = require('./minecraft.json');
 
 
 var pause = {};
 var pause = {};
 var stop = false;
 var stop = false;
-const defaultPermissions = new Discord.Permissions(268815424).toArray();
+const defaultPermissions = new Discord.Permissions(403033152).toArray();
 const timeoptions = {
 const timeoptions = {
 	year: 'numeric',
 	year: 'numeric',
 	month: 'short',
 	month: 'short',
@@ -148,7 +148,7 @@ function getSettings(trysettings = 1) {
 						getSettings(trysettings);
 						getSettings(trysettings);
 					}
 					}
 				} );
 				} );
-				db.run( 'CREATE TABLE IF NOT EXISTS verification(guild TEXT NOT NULL, configid INTEGER NOT NULL, channel TEXT NOT NULL, role TEXT NOT NULL, editcount INTEGER NOT NULL DEFAULT [0], usergroup TEXT NOT NULL DEFAULT [user], accountage INTEGER NOT NULL DEFAULT [0], UNIQUE(guild, configid))', [], function (error) {
+				db.run( 'CREATE TABLE IF NOT EXISTS verification(guild TEXT NOT NULL, configid INTEGER NOT NULL, channel TEXT NOT NULL, role TEXT NOT NULL, editcount INTEGER NOT NULL DEFAULT [0], usergroup TEXT NOT NULL DEFAULT [user], accountage INTEGER NOT NULL DEFAULT [0], rename INTEGER NOT NULL DEFAULT [0], UNIQUE(guild, configid))', [], function (error) {
 					if ( error ) {
 					if ( error ) {
 						console.log( '- Error while creating the verification table: ' + error );
 						console.log( '- Error while creating the verification table: ' + error );
 						return error;
 						return error;
@@ -1932,7 +1932,7 @@ function cmd_verification(lang, msg, args, line, wiki) {
 		return msg.replyMsg( lang.missingperm + ' `MANAGE_ROLES`' );
 		return msg.replyMsg( lang.missingperm + ' `MANAGE_ROLES`' );
 	}
 	}
 	
 	
-	db.all( 'SELECT configid, channel, role, editcount, usergroup, accountage FROM verification WHERE guild = ? ORDER BY configid ASC', [msg.guild.id], (error, rows) => {
+	db.all( 'SELECT configid, channel, role, editcount, usergroup, accountage, rename FROM verification WHERE guild = ? ORDER BY configid ASC', [msg.guild.id], (error, rows) => {
 		if ( error || !rows ) {
 		if ( error || !rows ) {
 			console.log( '- Error while getting the verifications: ' + error );
 			console.log( '- Error while getting the verifications: ' + error );
 			msg.reactEmoji('error', true);
 			msg.reactEmoji('error', true);
@@ -1993,6 +1993,22 @@ function cmd_verification(lang, msg, args, line, wiki) {
 				msg.replyMsg( lang.verification.deleted, {}, true );
 				msg.replyMsg( lang.verification.deleted, {}, true );
 			} );
 			} );
 		}
 		}
+		if ( args[1] === 'rename' && !args.slice(2).join('') ) {
+			if ( !row.rename && !msg.guild.me.permissions.has('MANAGE_NICKNAMES') ) {
+				console.log( msg.guild.id + ': Missing permissions - MANAGE_NICKNAMES' );
+				return msg.replyMsg( lang.missingperm + ' `MANAGE_NICKNAMES`' );
+			}
+			return db.run( 'UPDATE verification SET rename = ? WHERE guild = ? AND configid = ?', [( row.rename ? 0 : 1 ), msg.guild.id, row.configid], function (dberror) {
+				if ( dberror ) {
+					console.log( '- Error while updating the verification: ' + dberror );
+					msg.replyMsg( lang.verification.save_failed, {}, true );
+					return dberror;
+				}
+				console.log( '- Verification successfully updated.' );
+				row.rename = ( row.rename ? 0 : 1 );
+				msg.replyMsg( lang.verification.updated + formatVerification(), {split:true}, true );
+			} );
+		}
 		if ( args[2] ) {
 		if ( args[2] ) {
 			args[2] = args.slice(2).join(' ').replace( /^\s*<?\s*(.*?)\s*>?\s*$/, '$1' );
 			args[2] = args.slice(2).join(' ').replace( /^\s*<?\s*(.*?)\s*>?\s*$/, '$1' );
 			if ( args[1] === 'channel' ) {
 			if ( args[1] === 'channel' ) {
@@ -2078,7 +2094,15 @@ function cmd_verification(lang, msg, args, line, wiki) {
 		}
 		}
 		return msg.replyMsg( lang.verification.current_selected.replace( '%1', row.configid ) + formatVerification(true) +'\n\n' + lang.verification.delete_current + '\n`' + prefix + ' verification ' + row.configid + ' delete`', {split:true}, true );
 		return msg.replyMsg( lang.verification.current_selected.replace( '%1', row.configid ) + formatVerification(true) +'\n\n' + lang.verification.delete_current + '\n`' + prefix + ' verification ' + row.configid + ' delete`', {split:true}, true );
 		
 		
-		function formatVerification(showCommands, hideRoles, {configid, channel = '|' + msg.channel.id + '|', role, editcount = 0, usergroup = 'user', accountage = 0} = row) {
+		function formatVerification(showCommands, hideNotice, {
+			configid,
+			channel = '|' + msg.channel.id + '|',
+			role,
+			editcount = 0,
+			usergroup = 'user',
+			accountage = 0,
+			rename = 0
+		} = row) {
 			var verification_text = '\n\n`' + prefix + ' verification ' + configid + '`';
 			var verification_text = '\n\n`' + prefix + ' verification ' + configid + '`';
 			verification_text += '\n' + lang.verification.channel + ' <#' + channel.split('|').filter( channel => channel.length ).join('>, <#') + '>';
 			verification_text += '\n' + lang.verification.channel + ' <#' + channel.split('|').filter( channel => channel.length ).join('>, <#') + '>';
 			if ( showCommands ) verification_text += '\n`' + prefix + ' verification ' + row.configid + ' channel ' + lang.verification.new_channel + '`\n';
 			if ( showCommands ) verification_text += '\n`' + prefix + ' verification ' + row.configid + ' channel ' + lang.verification.new_channel + '`\n';
@@ -2090,7 +2114,12 @@ function cmd_verification(lang, msg, args, line, wiki) {
 			if ( showCommands ) verification_text += '\n`' + prefix + ' verification ' + row.configid + ' usergroup ' + lang.verification.new_usergroup + '`\n';
 			if ( showCommands ) verification_text += '\n`' + prefix + ' verification ' + row.configid + ' usergroup ' + lang.verification.new_usergroup + '`\n';
 			verification_text += '\n' + lang.verification.accountage + ' `' + accountage + '` ' + lang.verification.indays;
 			verification_text += '\n' + lang.verification.accountage + ' `' + accountage + '` ' + lang.verification.indays;
 			if ( showCommands ) verification_text += '\n`' + prefix + ' verification ' + row.configid + ' accountage ' + lang.verification.new_accountage + '`\n';
 			if ( showCommands ) verification_text += '\n`' + prefix + ' verification ' + row.configid + ' accountage ' + lang.verification.new_accountage + '`\n';
-			if ( !hideRoles && role.split('|').some( role => msg.guild.me.roles.highest.comparePositionTo(role) <= 0 ) ) {
+			verification_text += '\n' + lang.verification.rename + ' *`' + ( rename ? lang.verification.enabled : lang.verification.disabled ) + '`* ' + lang.verification.toggle;
+			if ( showCommands ) verification_text += '\n`' + prefix + ' verification ' + row.configid + ' rename`\n';
+			if ( !hideNotice && rename && !msg.guild.me.permissions.has('MANAGE_NICKNAMES') ) {
+				verification_text += '\n\n' + lang.verification.rename_no_permission.replaceSave( '%s', msg.guild.me.toString() );
+			}
+			if ( !hideNotice && role.split('|').some( role => msg.guild.me.roles.highest.comparePositionTo(role) <= 0 ) ) {
 				verification_text += '\n';
 				verification_text += '\n';
 				role.split('|').forEach( role => {
 				role.split('|').forEach( role => {
 					if ( msg.guild.me.roles.highest.comparePositionTo(role) <= 0 ) {
 					if ( msg.guild.me.roles.highest.comparePositionTo(role) <= 0 ) {
@@ -2113,14 +2142,13 @@ function cmd_verify(lang, msg, args, line, wiki) {
 		return
 		return
 	}
 	}
 	
 	
-	var username = args.join(' ').replace( /_/g, ' ' ).trim().replace( /^<\s*(.*)\s*>$/, '$1' ).replace( /^@/, '' ).split('#')[0];
-	if ( username.length > 250 ) username = username.substring(0, 250).trim();
+	var username = args.join(' ').replace( /_/g, ' ' ).trim().replace( /^<\s*(.*)\s*>$/, '$1' ).replace( /^@/, '' ).split('#')[0].substring(0, 250).trim();
 	if ( /^(?:https?:)?\/\/([a-z\d-]{1,50})\.(?:gamepedia\.com\/|(?:fandom\.com|wikia\.org)\/(?:[a-z-]{1,8}\/)?wiki\/)/.test(username) ) {
 	if ( /^(?:https?:)?\/\/([a-z\d-]{1,50})\.(?:gamepedia\.com\/|(?:fandom\.com|wikia\.org)\/(?:[a-z-]{1,8}\/)?wiki\/)/.test(username) ) {
 		username = decodeURIComponent( username.replace( /^(?:https?:)?\/\/([a-z\d-]{1,50})\.(?:gamepedia\.com\/|(?:fandom\.com|wikia\.org)\/(?:[a-z-]{1,8}\/)?wiki\/)/, '' ) );
 		username = decodeURIComponent( username.replace( /^(?:https?:)?\/\/([a-z\d-]{1,50})\.(?:gamepedia\.com\/|(?:fandom\.com|wikia\.org)\/(?:[a-z-]{1,8}\/)?wiki\/)/, '' ) );
 	}
 	}
 	if ( wiki.endsWith( '.gamepedia.com/' ) ) username = username.replace( /^userprofile\s*:/i, '' );
 	if ( wiki.endsWith( '.gamepedia.com/' ) ) username = username.replace( /^userprofile\s*:/i, '' );
 	
 	
-	db.all( 'SELECT role, editcount, usergroup, accountage FROM verification WHERE guild = ? AND channel LIKE ? ORDER BY configid ASC', [msg.guild.id, '%|' + msg.channel.id + '|%'], (dberror, rows) => {
+	db.all( 'SELECT role, editcount, usergroup, accountage, rename FROM verification WHERE guild = ? AND channel LIKE ? ORDER BY configid ASC', [msg.guild.id, '%|' + msg.channel.id + '|%'], (dberror, rows) => {
 		if ( dberror || !rows ) {
 		if ( dberror || !rows ) {
 			console.log( '- Error while getting the verifications: ' + dberror );
 			console.log( '- Error while getting the verifications: ' + dberror );
 			embed.setTitle( username.escapeFormatting() ).setColor('#000000').setDescription( lang.verify.error );
 			embed.setTitle( username.escapeFormatting() ).setColor('#000000').setDescription( lang.verify.error );
@@ -2271,12 +2299,21 @@ function cmd_verify(lang, msg, args, line, wiki) {
 						}
 						}
 					} );
 					} );
 					if ( verified ) {
 					if ( verified ) {
-						embed.setColor('#00FF00').setDescription( lang.verify.user_verified.replaceSave( '%1$s', msg.member.toString() ).replaceSave( '%2$s', '[' + username.escapeFormatting() + '](' + pagelink + ')' ) );
+						embed.setColor('#00FF00').setDescription( lang.verify.user_verified.replaceSave( '%1$s', msg.member.toString() ).replaceSave( '%2$s', '[' + username.escapeFormatting() + '](' + pagelink + ')' ) + ( rows.some( row => row.rename ) ? '\n' + lang.verify.user_renamed : '' ) );
 						var text = lang.verify.user_verified_reply.replaceSave( '%s', username.escapeFormatting() );
 						var text = lang.verify.user_verified_reply.replaceSave( '%s', username.escapeFormatting() );
-						msg.member.roles.add( roles, lang.verify.audit_reason.replaceSave( '%s', username ) ).catch( error => {
-							embed.setColor('#008800');
-							comment.push(lang.verify.failed_roles);
-						} ).finally( () => {
+						var verify_promise = [
+							msg.member.roles.add( roles, lang.verify.audit_reason.replaceSave( '%s', username ) ).catch( error => {
+								embed.setColor('#008800');
+								comment.push(lang.verify.failed_roles);
+							} )
+						];
+						if ( rows.some( row => row.rename ) ) {
+							verify_promise.push(msg.member.setNickname( username.substring(0, 32), lang.verify.audit_reason.replaceSave( '%s', username ) ).catch( error => {
+								embed.setColor('#008800');
+								comment.push(lang.verify.failed_rename);
+							} ));
+						}
+						Promise.all(verify_promise).finally( () => {
 							if ( msg.showEmbed() ) {
 							if ( msg.showEmbed() ) {
 								if ( roles.length ) embed.addField( lang.verify.qualified, roles.map( role => '<@&' + role + '>' ).join('\n') );
 								if ( roles.length ) embed.addField( lang.verify.qualified, roles.map( role => '<@&' + role + '>' ).join('\n') );
 								if ( missing.length ) embed.setColor('#008800').addField( lang.verify.qualified_error, missing.map( role => '<@&' + role + '>' ).join('\n') );
 								if ( missing.length ) embed.setColor('#008800').addField( lang.verify.qualified_error, missing.map( role => '<@&' + role + '>' ).join('\n') );