Rev | Line | |
---|
[ca5a97e] | 1 | # This file is part of python-cinema-club-bot
|
---|
| 2 | # contributed in 2024 by Mikhail Kirillov (~w96k) <w96k@runbox.com>
|
---|
| 3 |
|
---|
| 4 | # To the extent possible under law, the author(s) have dedicated all copyright
|
---|
| 5 | # and related and neighboring rights to this software to the public domain
|
---|
| 6 | # worldwide. This software is distributed without any warranty.
|
---|
| 7 |
|
---|
| 8 | # You should have received a copy of the CC0 Public Domain Dedication along
|
---|
| 9 | # with this software. If not, see:
|
---|
| 10 | # <http://creativecommons.org/publicdomain/zero/1.0/>.
|
---|
| 11 |
|
---|
| 12 | from telegram import Update
|
---|
| 13 | from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes
|
---|
| 14 | from dotenv import load_dotenv
|
---|
| 15 | import os
|
---|
| 16 |
|
---|
| 17 | load_dotenv()
|
---|
| 18 |
|
---|
| 19 |
|
---|
| 20 | async def hello(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
---|
| 21 | await update.message.reply_text(f'Hello {update.effective_user.first_name}')
|
---|
| 22 |
|
---|
| 23 | app = ApplicationBuilder().token(
|
---|
| 24 | os.environ.get('TELEGRAM_TOKEN')
|
---|
| 25 | ).build()
|
---|
| 26 |
|
---|
| 27 | app.add_handler(CommandHandler("hello", hello))
|
---|
| 28 |
|
---|
| 29 | app.run_polling()
|
---|
Note:
See
TracBrowser
for help on using the repository browser.