mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
32 lines
871 B
C#
32 lines
871 B
C#
#nullable enable
|
|
|
|
using System.Threading.Tasks;
|
|
using BotFramework.Attributes;
|
|
using BotFramework.Enums;
|
|
using Kruzya.TelegramBot.Core.Data;
|
|
using Kruzya.TelegramBot.Core.Extensions;
|
|
|
|
namespace West.TelegramBot.ChatManagement.Handler
|
|
{
|
|
public class Reputation : ManagementHandler
|
|
{
|
|
public Reputation(CoreContext db) : base(db) {}
|
|
|
|
[Command("whois", CommandParseMode.Both)]
|
|
public async Task HandleWhois()
|
|
{
|
|
var user = RepliedUser ?? From;
|
|
var message = $"{user.ToHtml(false)}\n";
|
|
if (user.IsBot)
|
|
{
|
|
message += "<code>Бот</code>";
|
|
}
|
|
else
|
|
{
|
|
message += $"<code>Предупреждения: {(await GetWarnOption(user)).GetValue<int>()}</code>";
|
|
}
|
|
|
|
await Reply(message);
|
|
}
|
|
}
|
|
} |