Пример #1
0
        private static void Main(string[] args)
        {
            Bot                = new TeleSharp.TeleSharp("152529427:AAFOizfzWyWHnJoQghmRAbN5IlBInd-wSe8");
            Bot.OnMessage     += OnMessage;
            Bot.OnInlineQuery += OnInlineQuery;

            Console.WriteLine(@"TeleSharp initialized");

            Console.WriteLine($"Hi, My Name is : {Bot.Me.Username}");

            Console.ReadLine();
        }
Пример #2
0
        private static void Main(string[] args)
        {
            //Bot = new TeleSharp.TeleSharp("152529427:AAFOizfzWyWHnJoQghmRAbN5IlBInd-wSe8");
            Bot = new TeleSharp.TeleSharp("284484049:AAFK6HuhutBDA7h6l5VBR7KRFqnIE-bz_js");
            Bot.OnMessage += OnMessage;
            Bot.OnInlineQuery += OnInlineQuery;

            Console.WriteLine(@"TeleSharp initialized");

            Console.WriteLine($"Hi, My Name is : {Bot.Me.Username}");

            Console.ReadLine();
        }
Пример #3
0
        private static void Main(string[] args)
        {
            Bot = new TeleSharp.TeleSharp("152529427:AAFOizfzWycWHnJoQghmRAbN5IlBInd-wSe8");
            Bot.SendMessage(new SendMessageParams
            {
                ChatId         = "39699831",
                Text           = "Test msg !",
                InlineKeyboard = new InlineKeyboardMarkup
                {
                    InlineKeyboard = new List <List <InlineKeyboardButton> >
                    {
                        new List <InlineKeyboardButton>
                        {
                            new InlineKeyboardButton {
                                Text = "CallbackData", CallbackData = "Ok", SwitchInlineQuery = string.Empty, SwitchInlineQueryCurrentChat = string.Empty, Url = string.Empty
                            },
                        },
                        new List <InlineKeyboardButton>
                        {
                            new InlineKeyboardButton {
                                Text = "SwitchInlineQueryCurrentChat", CallbackData = string.Empty, SwitchInlineQuery = string.Empty, SwitchInlineQueryCurrentChat = "OK", Url = string.Empty
                            },
                        },
                        new List <InlineKeyboardButton>
                        {
                            new InlineKeyboardButton {
                                Text = "Url", CallbackData = string.Empty, SwitchInlineQuery = string.Empty, SwitchInlineQueryCurrentChat = string.Empty, Url = "http://dualp.ir"
                            },
                        },
                        new List <InlineKeyboardButton>
                        {
                            new InlineKeyboardButton {
                                Text = "SwitchInlineQuery", SwitchInlineQuery = "سلام", Url = string.Empty, CallbackData = string.Empty, SwitchInlineQueryCurrentChat = string.Empty
                            }
                        }
                    }
                }
            });
            Bot.OnMessage       += OnMessage;
            Bot.OnInlineQuery   += OnInlineQuery;
            Bot.OnCallbackQuery += Bot_OnCallbackQuery;



            Console.WriteLine(@"TeleSharp initialized");

            Console.WriteLine($"Hi, My Name is : {Bot.Me.Username}");

            Console.ReadLine();
        }