849 B, a telegram bot api library in bash

This library aims to make creating quick-and-dirty bots in Bash as easy as possible. To create a basic bot, all you need is the following:


function _on_msg() {
	echo "${event[from_username]}: ${event[text]}"

	if [[ "${event[text]}" == "o/" ]]; then
		tg_send ${event[chat_id]} "$(_escape '\o')"


Please note how you need to escape the text if there are any characters which would conflict with the MarkdownV2 standard. If you wish to use MD styling, the tg_send call could look like that:

tg_send ${event[chat_id]} "[$(_escape "^_^")]($(_escape ""))"

Alternatively, if you decide that you don't want to run _escape on every string, set ESCAPE_ALL to true after loading the library.