mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-15 02:00:09 +00:00
Fix error when trying to DM a user with DMs disabled
This commit is contained in:
parent
1386e6743b
commit
1d3acb2392
1 changed files with 9 additions and 1 deletions
|
|
@ -297,7 +297,15 @@ namespace PluralKit.Bot
|
||||||
if (msg == null) return;
|
if (msg == null) return;
|
||||||
|
|
||||||
// DM them the message card
|
// DM them the message card
|
||||||
await user.SendMessageAsync(embed: await _embeds.CreateMessageInfoEmbed(msg));
|
try
|
||||||
|
{
|
||||||
|
await user.SendMessageAsync(embed: await _embeds.CreateMessageInfoEmbed(msg));
|
||||||
|
}
|
||||||
|
catch (HttpException e) when (e.DiscordCode == 50007)
|
||||||
|
{
|
||||||
|
// Ignore exception if it means we don't have DM permission to this user
|
||||||
|
// not much else we can do here :/
|
||||||
|
}
|
||||||
|
|
||||||
// And finally remove the original reaction (if we can)
|
// And finally remove the original reaction (if we can)
|
||||||
var msgObj = await message.GetOrDownloadAsync();
|
var msgObj = await message.GetOrDownloadAsync();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue