예제 #1
0
        public override void Execute(TelegramBotClient botClient, System.Object message)
        {
            DataBase db       = Singleton.GetInstance().Context;
            Message  _Message = message as Message;

            System.Int32 FromId = _Message.ReplyToMessage.From.Id;

            botClient.DeleteMessage(_Message.Chat.Id, _Message.MessageId, "205");

            User Admin = db.GetUser(_Message.From.Id);

            try
            {
                if (Admin.IsAdmin > 1)
                {
                    Message _message = _Message.ReplyToMessage;

                    User user = db.GetUser(_message.From.Id);

                    Post post = db.GetPostInChannel(_message.Chat.Id, _message.MessageId);

                    PostTemplate template = db.GetPostTemplate(post.PostTemplateId);

                    AdController.DeleteAllPosts(botClient, template);

                    db.RemoveTemplate(template.Id);
                }
            }
            catch (System.Exception Ex)
            {
                Log.Logging(Ex);
            }

            return;
        }