Prioritize member lookup by name over ID
This commit is contained in:
parent
b19b2fbb38
commit
c8b4d186d8
@ -135,14 +135,14 @@ namespace PluralKit.Bot.CommandSystem
|
|||||||
// - A member hid
|
// - A member hid
|
||||||
// - A textual name of a member *in your own system*
|
// - A textual name of a member *in your own system*
|
||||||
|
|
||||||
// First, try member HID parsing:
|
// First, if we have a system, try finding by member name in system
|
||||||
if (await _data.GetMemberByHid(input) is PKMember memberByHid)
|
|
||||||
return memberByHid;
|
|
||||||
|
|
||||||
// Then, if we have a system, try finding by member name in system
|
|
||||||
if (_senderSystem != null && await _data.GetMemberByName(_senderSystem, input) is PKMember memberByName)
|
if (_senderSystem != null && await _data.GetMemberByName(_senderSystem, input) is PKMember memberByName)
|
||||||
return memberByName;
|
return memberByName;
|
||||||
|
|
||||||
|
// Then, try member HID parsing:
|
||||||
|
if (await _data.GetMemberByHid(input) is PKMember memberByHid)
|
||||||
|
return memberByHid;
|
||||||
|
|
||||||
// We didn't find anything, so we return null.
|
// We didn't find anything, so we return null.
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user