Skip to main content

Python package to utilizes the telegram API to easily add commands and person other actions

Project description

TelegramBot

Project Description

This project uses the telegram bot API to create a bot service

Installation

To install with pip

$ pip install Telegram-Bot8

Usage

from TelegramBot8 import Message, TeleBot, Update, ParseMode

API_KEY = os.getenv('telegramApiKey')
bot = TeleBot(API_KEY)

@bot.add_command_helper(command="/hi")
def hi(message: Message):
    bot.send_message(message.chat.getID(), "Hello")


@bot.add_command_menu_helper(command="/bye", description="Just testing added command")
def bye(message: Message):
    bot.send_message(message.chat.getID(), "Bye")


@bot.add_regex_helper(regex="^hi$")
def regex(message: Message):
    bot.send_message(message.chat.getID(), "Hello")

bot.poll()

Credits


Jeyavishnu

License

Distributed under the MIT License. See LICENSE for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Telegram-Bot8-0.2.6.tar.gz (21.8 kB view hashes)

Uploaded Source

Built Distribution

Telegram_Bot8-0.2.6-py3-none-any.whl (29.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page