bots

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 761400df1333b9f66f0005d2f4f95a3ad19452f2
Author: Nathaniel Chappelle <nathaniel@chappelle.dev>
Date:   Thu,  5 Feb 2026 14:45:57 -0800

Initial commit, listen-page-bot

Diffstat:
A.gitignore | 1+
Alisten-page-bot/bot.py | 21+++++++++++++++++++++
2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/listen-page-bot/bot.py b/listen-page-bot/bot.py @@ -0,0 +1,21 @@ +from telegram import Update +from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes +from dotenv import load_dotenv +import os + +# Load dotenv variables, such as the Telegram token +load_dotenv() + +async def hello(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: + await update.message.reply_text(f'Hello {update.effective_user.first_name}') + +telegram_token = os.getenv("TELEGRAM_TOKEN") +if telegram_token == None: + print("No Telegram token found in dotenv") + exit() + +app = ApplicationBuilder().token(telegram_token).build() + +app.add_handler(CommandHandler("hello", hello)) + +app.run_polling()