Add looking up group by displayname; document this
This commit is contained in:
parent
537783dd96
commit
71461b3163
@ -110,6 +110,8 @@ namespace PluralKit.Bot
|
||||
return byName;
|
||||
if (await ctx.Repository.GetGroupByHid(conn, input) is {} byHid)
|
||||
return byHid;
|
||||
if (await ctx.Repository.GetGroupByDisplayName(conn, ctx.System.Id, input) is {} byDisplayName)
|
||||
return byDisplayName;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -13,6 +13,9 @@ namespace PluralKit.Core
|
||||
public Task<PKGroup?> GetGroupByName(IPKConnection conn, SystemId system, string name) =>
|
||||
conn.QueryFirstOrDefaultAsync<PKGroup?>("select * from groups where system = @System and lower(Name) = lower(@Name)", new {System = system, Name = name});
|
||||
|
||||
public Task<PKGroup?> GetGroupByDisplayName(IPKConnection conn, SystemId system, string display_name) =>
|
||||
conn.QueryFirstOrDefaultAsync<PKGroup?>("select * from groups where system = @System and lower(display_name) = lower(@Name)", new {System = system, Name = display_name});
|
||||
|
||||
public Task<PKGroup?> GetGroupByHid(IPKConnection conn, string hid) =>
|
||||
conn.QueryFirstOrDefaultAsync<PKGroup?>("select * from groups where hid = @hid", new {hid = hid.ToLowerInvariant()});
|
||||
|
||||
|
@ -35,7 +35,7 @@ Words in **\<angle brackets>** or **[square brackets]** mean fill-in-the-blank.
|
||||
- `pk;unlink [account]` - Unlinks an account from this system.
|
||||
|
||||
## Member commands
|
||||
*Replace `<name>` with a member's name or 5-character ID. For most commands, adding `-clear` will clear/delete the field.*
|
||||
*Replace `<name>` with a member's name, 5-character ID or display name. For most commands, adding `-clear` will clear/delete the field.*
|
||||
- `pk;member <name>` - Shows information about a member.
|
||||
- `pk;member new <name>` - Creates a new system member.
|
||||
- `pk;member <name> rename <new name>` - Changes the name of a member.
|
||||
@ -57,7 +57,7 @@ Words in **\<angle brackets>** or **[square brackets]** mean fill-in-the-blank.
|
||||
- `pk;random` - Shows the member card of a randomly selected member in your system.
|
||||
|
||||
## Group commands
|
||||
*Replace `<name>` with a group's name or 5-character ID. For most commands, adding `-clear` will clear/delete the field.*
|
||||
*Replace `<name>` with a group's name, 5-character ID or display name. For most commands, adding `-clear` will clear/delete the field.*
|
||||
- `pk;group <name>` - Shows information about a group.
|
||||
- `pk;group new <name>` - Creates a new group.
|
||||
- `pk;group list` - Lists all groups in your system.
|
||||
|
@ -129,10 +129,11 @@ You can't do much with PluralKit without having registered members with your sys
|
||||
As the one exception to the rule above, if the name consists of multiple words you must *not* enclose it in double quotes.
|
||||
|
||||
### Looking up member info
|
||||
To view information about a member, there are a couple ways to do it. Either you can address a member by their name (if they're in your own system), or by their 5-character *member ID*, like so:
|
||||
To view information about a member, there are a couple ways to do it. Either you can address a member by their name (if they're in your own system), by their 5-character *member ID*, or by their *display name*, like so:
|
||||
|
||||
pk;member John
|
||||
pk;member qazws
|
||||
pk;member J
|
||||
|
||||
Member IDs are the only way to address a member in another system, and you can find it in various places - for example the system's member list, or on a message info card gotten by reacting to messages with a question mark.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user