Example #1
0
        public void SendMessage(TelegramBotClient botClient)
        {
            InlineButton inlineButton = new InlineButton();

            System.String temp = InfoUser.Search(userTwo, user);
            if (db._featuredUserNews.Any(p => p.UserId == userTwo.ID && p.UserWhoAddedId == user.ID))
            {
                if (user.IsAdmin > 0)
                {
                    botClient.EditMessage(user.ID, user.MessageID, temp, "39 - AddPhotoInDataBase", user, inlineButton.InteractionUsers(user, true, db.GetFeaturedUsers(user, userTwo), isAdmin: true));
                }
                else
                {
                    botClient.EditMessage(user.ID, user.MessageID, temp, "39 - AddPhotoInDataBase", user, inlineButton.InteractionUsers(user, true, db.GetFeaturedUsers(user, userTwo), isAdmin: false));
                }
            }
            else
            {
                if (user.IsAdmin > 0)
                {
                    botClient.EditMessage(user.ID, user.MessageID, temp, "39 - AddPhotoInDataBase", user, inlineButton.InteractionUsers(user, false, isAdmin: true));
                }
                else
                {
                    botClient.EditMessage(user.ID, user.MessageID, temp, "39 - AddPhotoInDataBase", user, inlineButton.InteractionUsers(user, false, isAdmin: false));
                }
            }
        }
Example #2
0
        public void SendMessage(TelegramBotClient botClient)
        {
            InlineButton inlineButton = new InlineButton();

            System.String temp = InfoUser.Search(userTwo, user);

            if (user.IsAdmin > 0)
            {
                botClient.EditMessage(user.ID, user.MessageID, temp, "39 - AddPhotoInDataBase", user, inlineButton.InteractionUsers(userTwo, true, db.GetFeaturedUsers(user, userTwo), isAdmin: true));
            }
            else
            {
                botClient.EditMessage(user.ID, user.MessageID, temp, "39 - AddPhotoInDataBase", user, inlineButton.InteractionUsers(userTwo, true, db.GetFeaturedUsers(user, userTwo)));
            }
        }
Example #3
0
        private static async void SendMessage(TelegramBotClient botClient, Message _message, User user, String text)
        {
            InlineButton inlineButton = new InlineButton();

            using (FileStream stream = System.IO.File.Open(AppDomain.CurrentDomain.BaseDirectory + "\\newdoc.xls", FileMode.Open))
            {
                InputOnlineFile iof = new InputOnlineFile(stream)
                {
                    FileName = text + ".xls"
                };
                botClient.DeleteMessage(_message.From.Id, user.MessageID, "21 - PrintExel");
                await botClient.SendDocumentAsync(_message.From.Id, iof);

                System.String temp = InfoUser.Info(user);
                botClient.SendText(_message.From.Id, temp, user, replyMarkup: inlineButton.AdminAccaunt);
            }
        }
        internal void SendMessage(TelegramBotClient botClient, Message _message)
        {
            DataBase db = Singleton.GetInstance().Context;

            Settings settings = db.GetSettings();

            InlineButton inlineBatton = new InlineButton();

            System.String temp = InfoUser.Search(userTwo, user);

            botClient.DeleteMessage(_message.From.Id, _message.MessageId, "33 - MessageUserBot");
            if (user.IsAdmin > 0)
            {
                botClient.EditMessage(_message.From.Id, user.MessageID, temp, "45 - MessageUserBot", user, replyMarkup: inlineBatton.InteractionUsers(userTwo, db._featuredUserNews.Any(p => p.UserId == userTwo.ID && p.UserWhoAddedId == user.ID), db.GetFeaturedUsers(user, userTwo), isAdmin: true));
            }
            else
            {
                botClient.EditMessage(_message.From.Id, user.MessageID, temp, "45 - MessageUserBot", user, replyMarkup: inlineBatton.InteractionUsers(userTwo, db._featuredUserNews.Any(p => p.UserId == userTwo.ID && p.UserWhoAddedId == user.ID), db.GetFeaturedUsers(user, userTwo), isAdmin: false));
            }
        }