From 0260cae40b34a6fef29e5b124037dcfcc229cee6 Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Sat, 4 Apr 2026 15:24:47 +0000 Subject: [PATCH] feat: auto-promote group creator to admin When /start is called in a group, check if user is the group creator and automatically add them as admin. DMs don't need admin concept. --- apps/telegram-bot/commands.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/apps/telegram-bot/commands.py b/apps/telegram-bot/commands.py index 47e1690..6e2eb52 100644 --- a/apps/telegram-bot/commands.py +++ b/apps/telegram-bot/commands.py @@ -436,7 +436,29 @@ async def cmd_untrack(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None: async def cmd_start(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None: + user_id = get_user_id(update) + room_id = get_room_id(update) + if is_group(update): + try: + chat_member = await ctx.bot.get_chat_member(room_id, user_id) + if chat_member.status == "creator" and not BOUNTY_SERVICE.is_admin( + room_id, user_id + ): + BOUNTY_SERVICE.add_admin(room_id, user_id, user_id) + await update.message.reply_text( + "👻 JIGAIDO is watching.\n\n" + "This group's bounty list is now active.\n" + "You are now an admin (group creator).\n" + "/bounty — list bounties\n" + "/add — create a bounty\n" + "/track — track a bounty\n" + "/my — your tracked bounties" + ) + return + except Exception: + pass + await update.message.reply_text( "👻 JIGAIDO is watching.\n\n" "This group's bounty list is now active.\n"