mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
Fix error when calling resolveUserId with null/missing user id
This commit is contained in:
parent
328ec379c5
commit
a48a58bd3c
1 changed files with 4 additions and 0 deletions
|
@ -622,6 +622,10 @@ const unknownUsers = new Set();
|
||||||
const unknownMembers = new Set();
|
const unknownMembers = new Set();
|
||||||
|
|
||||||
export function resolveUserId(bot: Client, value: string) {
|
export function resolveUserId(bot: Client, value: string) {
|
||||||
|
if (value == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// A user mention?
|
// A user mention?
|
||||||
const mentionMatch = value.match(/^<@!?(\d+)>$/);
|
const mentionMatch = value.match(/^<@!?(\d+)>$/);
|
||||||
if (mentionMatch) {
|
if (mentionMatch) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue