(client, m: Message)
| 106 | |
| 107 | @Client.on_message(filters.command('api') & filters.private) |
| 108 | async def shortener_api_handler(client, m: Message): |
| 109 | user_id = m.from_user.id |
| 110 | user = await get_user(user_id) |
| 111 | cmd = m.command |
| 112 | |
| 113 | if len(cmd) == 1: |
| 114 | s = script.SHORTENER_API_MESSAGE.format(base_site=user["base_site"], shortener_api=user["shortener_api"]) |
| 115 | return await m.reply(s) |
| 116 | |
| 117 | elif len(cmd) == 2: |
| 118 | api = cmd[1].strip() |
| 119 | await update_user_info(user_id, {"shortener_api": api}) |
| 120 | await m.reply("Shortener API updated successfully to " + api) |
| 121 | else: |
| 122 | await m.reply("You are not authorized to use this command.") |
| 123 | |
| 124 | # Don't Remove Credit Tg - @VJ_Bots |
| 125 | # Subscribe YouTube Channel For Amazing Bot https://youtube.com/@Tech_VJ |
nothing calls this directly
no test coverage detected