You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromjsonbotimportJsonBotJsonBot("token", {
"messages": {
"/start", {"response": "hello *{first_name}*", "parse_mode": "MarkdownV2"},
"/help": {"response": "Hello how can i help you"}
}
}).run()
you can generate code to osonbot library itself (supports only osonbot library, and can not generate fully)
fromjsonbotimportJsonBotJsonBot("token", {
"/start", {"response": "hello *{first_name}*", "parse_mode": "MarkdownV2"},
"/help": {"response": "Hello how can i help you"}
}).generate_code(library="osonbot", file="main.py")
Handling Inline Messages
fromjsonbotimportJsonBotJsonBot("token", {
"inline_messages": {
"callback_data1", {"response": "you clicked the first inline button"},
"callback_data2": {"response": "you clicked the sedond inline button"}
}
}).run()
Send message to specific user by his/her ID
fromjsonbotimportJsonBotJsonBot("token", {
"messages": {
"/start", {"response": "hello *{first_name}*", "parse_mode": "MarkdownV2"},
"/send": {"id": 123456789, "response": "This is a message for a specific user"}
}
}).run()
Done for now
About
this is a telegram bot library for making telegram bot easier build on top of osonbot. It uses json dictionary to construct a bot.