Skip to content

joseluiscd/simple-telegram-bot-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-telegram-bot-api

Very simple (unofficial) wrapper for the Telegram Bot API (https://core.telegram.org/bots/api)

Tgbot

Every method of a tgCommandBot object has the same keyword arguments, and return the same things described in the official API documentation, as a python dict, list or combination of them.

In order to send a file, you have to use the special keyword argument "files". The key is the name of the parameter that the bot API requires (in sendDocument is "document, in sendPhoto is "photo"...).

bot.sendDocument(chat_id=1234567, files={"document": open("document.txt", "r")})

Additional documentation will come soon.

import telegrambot

bot = telegrambot.tgCommandBot("YourTokenHere")

@bot.messageHandler(command="/help", chat_type="private")
def helpCommandHandler(bot, message, result):
    bot.sendMessage(text="This is the help message!!", chat_id=message["chat"]["id"])

bot.polling()

About

Very simple (unofficial) wrapper for the Telegram Bot API (https://core.telegram.org/bots/api)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages