|
@@ -1,10 +1,8 @@
|
|
|
-using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
using System.Threading.Tasks;
|
|
|
using CardCollector.Controllers;
|
|
|
using CardCollector.DataBase.Entity;
|
|
|
using Telegram.Bot.Types;
|
|
|
-using Telegram.Bot.Types.Enums;
|
|
|
-using Telegram.Bot.Types.InlineQueryResults;
|
|
|
|
|
|
namespace CardCollector.Commands.InlineQuery
|
|
|
{
|
|
@@ -14,34 +12,19 @@ namespace CardCollector.Commands.InlineQuery
|
|
|
|
|
|
public override async Task<Telegram.Bot.Types.Message> Execute()
|
|
|
{
|
|
|
- var filter = Update.InlineQuery!.Id;
|
|
|
- var stickersList = GetStickersList(filter);
|
|
|
-
|
|
|
+ var filter = Update.InlineQuery!.Query;
|
|
|
+ var stickersList = await User.GetStickersList("send_sticker",filter);
|
|
|
await MessageController.AnswerInlineQuery(InlineQueryId, stickersList, "название");
|
|
|
- return new();
|
|
|
- }
|
|
|
-
|
|
|
- private IEnumerable<InlineQueryResult> GetStickersList(string filter)
|
|
|
- {
|
|
|
- var results = new List<InlineQueryResult>
|
|
|
- {
|
|
|
- new InlineQueryResultCachedSticker("send_sticker=", "CAACAgIAAxkBAAIWs2DuY4vB50ARmyRwsgABs_7o5weDaAAC-g4AAmq4cUtH6M1FoN4bxSAE")
|
|
|
- };
|
|
|
- return results;
|
|
|
+ return new Telegram.Bot.Types.Message();
|
|
|
}
|
|
|
|
|
|
protected override bool IsMatches(string command)
|
|
|
{
|
|
|
- return command.Contains(ChatType.Group.ToString()) ||
|
|
|
- command.Contains(ChatType.Supergroup.ToString()) ||
|
|
|
- command.Contains(ChatType.Private.ToString());
|
|
|
+ return command.Contains("Group") || command.Contains("Supergroup") || command.Contains("Private");
|
|
|
}
|
|
|
|
|
|
public ShowStickersInGroup(UserEntity user, Update update, string inlineQueryId)
|
|
|
- : base(user, update, inlineQueryId)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
+ : base(user, update, inlineQueryId) { }
|
|
|
public ShowStickersInGroup() { }
|
|
|
}
|
|
|
}
|