2022-01-18 20:34:21 +02:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using BotFramework.Attributes;
|
|
|
|
|
using BotFramework.Enums;
|
|
|
|
|
using Kruzya.TelegramBot.Core.Data;
|
|
|
|
|
using Kruzya.TelegramBot.Core.Extensions;
|
|
|
|
|
using Telegram.Bot;
|
|
|
|
|
|
|
|
|
|
namespace West.TelegramBot.ChatManagement.Handler
|
|
|
|
|
{
|
|
|
|
|
internal partial class Rules : ManagementHandler
|
|
|
|
|
{
|
|
|
|
|
[Command(InChat.Public, "setrules", CommandParseMode.Both)]
|
|
|
|
|
public async Task HandleSetRules()
|
|
|
|
|
{
|
|
|
|
|
var replyToMessage = Message?.ReplyToMessage;
|
|
|
|
|
var text = replyToMessage?.Text;
|
|
|
|
|
if (replyToMessage == null || text == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//var entities = replyToMessage.Entities;
|
|
|
|
|
//if (entities != null)
|
|
|
|
|
//{
|
|
|
|
|
// //foreach (var entity in entities)
|
|
|
|
|
// //{
|
|
|
|
|
// // var entityText = text.Substring(entity.Offset, entity.Length);
|
|
|
|
|
// // text = text
|
|
|
|
|
// // .Remove(entity.Offset, entity.Length)
|
|
|
|
|
// // .Insert(entity.Offset)
|
|
|
|
|
// //}
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
2022-01-18 20:41:02 +02:00
|
|
|
await Bot.SendTextMessageAsync(Chat, "tut bilo milo kruzi no on protiv");
|
2022-01-18 20:34:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Command(InChat.Public, "rules", CommandParseMode.Both)]
|
|
|
|
|
public async Task HandleRules()
|
|
|
|
|
{
|
|
|
|
|
var opt = Db.UserValues.FindOrCreateOption(Chat.Id, "rules");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Rules(CoreContext db) : base(db)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|