MCPcopy Create free account
hub / github.com/VJBots/VJ-File-Store / shortener_api_handler

Function shortener_api_handler

clone_plugins/commands.py:108–122  ·  view source on GitHub ↗
(client, m: Message)

Source from the content-addressed store, hash-verified

106
107@Client.on_message(filters.command('api') & filters.private)
108async 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

Callers

nothing calls this directly

Calls 2

get_userFunction · 0.90
update_user_infoFunction · 0.90

Tested by

no test coverage detected