mirror of
https://github.com/RPCS3/discord-bot.git
synced 2025-01-07 19:00:58 +00:00
27 lines
577 B
C#
27 lines
577 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using DSharpPlus.Entities;
|
|
|
|
namespace CompatBot.Utils.Extensions
|
|
{
|
|
public static class DiscordUserExtensions
|
|
{
|
|
public static bool IsBotSafeCheck(this DiscordUser user)
|
|
{
|
|
try
|
|
{
|
|
return user?.IsBot ?? false;
|
|
}
|
|
catch (KeyNotFoundException)
|
|
{
|
|
return false;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Config.Log.Warn(e);
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|