mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 08:40:11 +00:00
bot: add member description command
This commit is contained in:
parent
6fe3154a10
commit
e55b7f6b71
1 changed files with 13 additions and 0 deletions
|
|
@ -71,6 +71,19 @@ namespace PluralKit.Bot.Commands
|
||||||
if (newName.Contains(" ")) await Context.Channel.SendMessageAsync($"{Emojis.Note} Note that this member's name now contains spaces. You will need to surround it with \"double quotes\" when using commands referring to it.");
|
if (newName.Contains(" ")) await Context.Channel.SendMessageAsync($"{Emojis.Note} Note that this member's name now contains spaces. You will need to surround it with \"double quotes\" when using commands referring to it.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Command("description")]
|
||||||
|
[Alias("info", "bio", "text")]
|
||||||
|
[Remarks("member <member> description <description")]
|
||||||
|
[MustPassOwnMember]
|
||||||
|
public async Task MemberDescription([Remainder] string description = null) {
|
||||||
|
if (description.Length > Limits.MaxDescriptionLength) throw Errors.DescriptionTooLongError(description.Length);
|
||||||
|
|
||||||
|
ContextEntity.Description = description;
|
||||||
|
await Members.Save(ContextEntity);
|
||||||
|
|
||||||
|
await Context.Channel.SendMessageAsync($"{Emojis.Success} Member description {(description == null ? "cleared" : "changed")}.");
|
||||||
|
}
|
||||||
|
|
||||||
public override async Task<PKMember> ReadContextParameterAsync(string value)
|
public override async Task<PKMember> ReadContextParameterAsync(string value)
|
||||||
{
|
{
|
||||||
var res = await new PKMemberTypeReader().ReadAsync(Context, value, _services);
|
var res = await new PKMemberTypeReader().ReadAsync(Context, value, _services);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue