mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-11 08:10:10 +00:00
fix error message on invalid guild ID
This commit is contained in:
parent
a2d2036851
commit
85615b3f68
2 changed files with 7 additions and 2 deletions
|
|
@ -126,7 +126,12 @@ namespace PluralKit.Bot {
|
|||
if (!ulong.TryParse(guildIdStr, out var guildId))
|
||||
throw new PKSyntaxError($"Could not parse {guildIdStr.AsCode()} as an ID.");
|
||||
|
||||
guild = await _rest.GetGuild(guildId);
|
||||
try {
|
||||
guild = await _rest.GetGuild(guildId);
|
||||
} catch (Myriad.Rest.Exceptions.ForbiddenException) {
|
||||
throw Errors.GuildNotFound(guildId);
|
||||
}
|
||||
|
||||
if (guild != null)
|
||||
senderGuildUser = await _rest.GetGuildMember(guildId, ctx.Author.Id);
|
||||
if (guild == null || senderGuildUser == null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue