mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: username inferring from discord nickname
This commit is contained in:
1 parent
f4bc66658b
commit
db881f44d4
17 files changed
+55
-41
No files matched your search
@@ -14,17 +14,16 @@ import { PlayerClanData } from '../types/playerClanData.js';
|
||||
|
||||
export default {
|
||||
inProduction: true,
|
||||
inDevelopment: false,
|
||||
inDevelopment: true,
|
||||
inPublic: true,
|
||||
|
||||
command: new SlashCommandBuilder()
|
||||
.setName(cmdName('verify'))
|
||||
.setDescription("Set's the user's username to their in-game name")
|
||||
.addStringOption(addUsernameOption),
|
||||
.addStringOption((option) => addUsernameOption(option).setRequired(true)),
|
||||
|
||||
async execute(interaction) {
|
||||
const name = interaction.options.getString('username')!;
|
||||
const blitzAccount = await getBlitzAccount(interaction, name);
|
||||
const blitzAccount = await getBlitzAccount(interaction);
|
||||
const { id, server } = blitzAccount;
|
||||
const accountInfo = await getWargamingResponse<AccountInfo>(
|
||||
`https://api.wotblitz.${server}/wotb/account/info/?application_id=${args['wargaming-application-id']}&account_id=${id}`,
|
||||
@@ -118,7 +117,7 @@ export default {
|
||||
.setColor(NEGATIVE_COLOR)
|
||||
.setTitle(`${interaction.user.username} failed to verify`)
|
||||
.setDescription(
|
||||
"I can't change your nickname because you have higher permissions than me.",
|
||||
"I can't change your nickname because you have higher permissions than me. Try setting your nickname to your Blitz username manually.",
|
||||
),
|
||||
],
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user