mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
[entertainment] Add some debug. More correct permission check.
This commit is contained in:
@@ -43,7 +43,10 @@ namespace West.Entertainment.Handler.Fun
|
||||
protected async Task HandleSetAnimation()
|
||||
{
|
||||
var animation = Message?.ReplyToMessage?.Animation;
|
||||
if (await CanPunish() || animation == null) return;
|
||||
var isAdmin = await Bot.IsUserAdminAsync(Chat, From);
|
||||
|
||||
_logger.LogDebug("IsAdmin: {IsAdmin}. FileId: {FileId}", isAdmin, animation?.FileId);
|
||||
if (!isAdmin || animation == null) return;
|
||||
|
||||
var animationFileOption = await GetAnimationFileOption();
|
||||
animationFileOption.SetValue(animation.FileId);
|
||||
@@ -61,8 +64,13 @@ namespace West.Entertainment.Handler.Fun
|
||||
|
||||
_logger.LogDebug("Animation: {Text}, ToLower: {ToLowerText}",
|
||||
Message!.Text, Message!.Text!.ToLower());
|
||||
|
||||
if (animationFileId.IsNullOrEmpty()) return false;
|
||||
_logger.LogDebug("AnimationFileId: {FileId}", animationFileId);
|
||||
|
||||
if (animationFileId.IsNullOrEmpty())
|
||||
{
|
||||
_logger.LogDebug("AnimationFileId is empty. Ignoring.");
|
||||
return false;
|
||||
}
|
||||
|
||||
var nextUseDt = nextUseOption.GetValue<DateTime>();
|
||||
if (nextUseDt > DateTime.Now)
|
||||
|
||||
Reference in New Issue
Block a user