mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: revert username pattern infrence
This commit is contained in:
1 parent
7e0a2e88ee
commit
e92da1b700
2 files changed
+2
-3
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "blitzkrieg",
|
"name": "blitzkrieg",
|
||||||
"version": "1.12.0",
|
"version": "1.12.1",
|
||||||
"description": "🎉 All-in-one Discord bot for everything World of Tanks Blitz",
|
"description": "🎉 All-in-one Discord bot for everything World of Tanks Blitz",
|
||||||
"main": "src/server.ts",
|
"main": "src/server.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
||||||
import { Region } from '../../constants/regions';
|
import { Region } from '../../constants/regions';
|
||||||
import listPlayers, {
|
import listPlayers, {
|
||||||
usernamePattern,
|
|
||||||
usernamePatternWithoutPosition,
|
usernamePatternWithoutPosition,
|
||||||
} from '../blitz/listPlayers';
|
} from '../blitz/listPlayers';
|
||||||
import throwError from '../node/throwError';
|
import throwError from '../node/throwError';
|
||||||
@@ -20,7 +19,7 @@ export default async function resolvePlayerFromCommand(
|
|||||||
const displayName = interaction.guild?.members.cache
|
const displayName = interaction.guild?.members.cache
|
||||||
.get(interaction.user.id)
|
.get(interaction.user.id)
|
||||||
?.displayName.match(usernamePatternWithoutPosition)?.[0];
|
?.displayName.match(usernamePatternWithoutPosition)?.[0];
|
||||||
const username = commandUsername?.match(usernamePattern)?.[0] ?? displayName;
|
const username = commandUsername ?? displayName;
|
||||||
|
|
||||||
if (username === undefined) {
|
if (username === undefined) {
|
||||||
throw throwError(
|
throw throwError(
|
||||||
|
|||||||
Reference in new issue
Block a user