© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
71 replies
quit

✅ Need help fixing CallbackData

     [TelegramCommand("ping", false, false)]
        public static async Task Ping(Update update, List<string> args)
        {
            // Create a new inline keyboard button with the text "Ping" and the callback data "ping"
            var button = new InlineKeyboardButton
            {
                Text = "Ping",
                CallbackData = "ping"
            };

            // Create a new inline keyboard markup with the button we just created
            var keyboard = new InlineKeyboardMarkup(new[] { new[] { button } });

            // Send a message with the text ":robot: Bot is online" and the inline keyboard markup we just created
            await Telegram.client.SendMessageAsync(update.Message.Chat.Id, ":robot: Bot is online", replyMarkup: keyboard);
        }
     [TelegramCommand("ping", false, false)]
        public static async Task Ping(Update update, List<string> args)
        {
            // Create a new inline keyboard button with the text "Ping" and the callback data "ping"
            var button = new InlineKeyboardButton
            {
                Text = "Ping",
                CallbackData = "ping"
            };

            // Create a new inline keyboard markup with the button we just created
            var keyboard = new InlineKeyboardMarkup(new[] { new[] { button } });

            // Send a message with the text ":robot: Bot is online" and the inline keyboard markup we just created
            await Telegram.client.SendMessageAsync(update.Message.Chat.Id, ":robot: Bot is online", replyMarkup: keyboard);
        }
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

❔ Nedd help with callbackdata telegram
C#CC# / help
3y ago
❔ need help fixing Bug in WPF app
C#CC# / help
3y ago
❔ Learning C# Need help fixing a problem.
C#CC# / help
4y ago
❔ need some code fixing
C#CC# / help
3y ago