mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
[whois] Remove unused import. Fix .gitignore. Do no fetch chatmember info, if custom status is set.
This commit is contained in:
+1
-1
@@ -7,5 +7,5 @@ obj/
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
appsettings.json
|
appsettings.json
|
||||||
Core/Core.csproj.user
|
*.csproj.user
|
||||||
Core/appsettings.Development.json
|
Core/appsettings.Development.json
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using SQLitePCL;
|
|
||||||
using Telegram.Bot.Types;
|
using Telegram.Bot.Types;
|
||||||
|
|
||||||
namespace Kruzya.TelegramBot.Core.Service
|
namespace Kruzya.TelegramBot.Core.Service
|
||||||
|
|||||||
@@ -161,14 +161,13 @@ namespace West.TelegramBot.ChatManagement.Handler
|
|||||||
|
|
||||||
private async Task<string> GetChatMemberStatusString(User user)
|
private async Task<string> GetChatMemberStatusString(User user)
|
||||||
{
|
{
|
||||||
var chatMember = await Bot.GetChatMemberAsync(Chat.Id, user.Id);
|
|
||||||
var customStatus = _userService.GetUserCustomStatus(user.Id);
|
var customStatus = _userService.GetUserCustomStatus(user.Id);
|
||||||
if (customStatus != null)
|
if (customStatus != null)
|
||||||
{
|
{
|
||||||
return customStatus;
|
return customStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var chatMember = await Bot.GetChatMemberAsync(Chat.Id, user.Id);
|
||||||
return chatMember.Status switch
|
return chatMember.Status switch
|
||||||
{
|
{
|
||||||
ChatMemberStatus.Creator => "Владелец",
|
ChatMemberStatus.Creator => "Владелец",
|
||||||
|
|||||||
Reference in New Issue
Block a user