Download telebot/plugins/command_list.py from thenamk3/cc: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/spaces/thenamk3/cc/resolve/main/telebot/plugins/command_list.py
- Command line
-
hf download hf://spaces/thenamk3/cc/telebot/plugins/command_list.py
-
curl -L -o command_list.py https://huggingface.co/spaces/thenamk3/cc/resolve/main/telebot/plugins/command_list.py
1.27 kB
| # Join @TeleBotHelp for custom plugins | |
| import asyncio | |
| import requests | |
| from telebot import CMD_HELP | |
| async def install(event): | |
| if event.fwd_from: | |
| return | |
| tele = await eor(event, "`Searching for all plugins...`") | |
| cmd = "ls telebot/plugins" | |
| process = await asyncio.create_subprocess_shell( | |
| cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE | |
| ) | |
| stdout, stderr = await process.communicate() | |
| o = stdout.decode() | |
| _o = o.split("\n") | |
| o = "\n".join(_o) | |
| OUTPUT = ( | |
| OUTPUT | |
| ) = f"Here is the list of plugins found in 'master' branch of TeleBot.\n{o}\n\nUse .help <cmd_name> to learn how a paticular plugin works.\nConsider joining @TeleBotSupport for help!" | |
| await tele.edit("`Plugins extracted, pasting it...`") | |
| message = OUTPUT | |
| url = "https://del.dog/documents" | |
| r = requests.post(url, data=message.encode("UTF-8")).json() | |
| url = f"https://del.dog/{r['key']}" | |
| await tele.edit( | |
| f"`All plugins available in` **TeleBot** `can be found` [here]({url})!!" | |
| ) | |
| CMD_HELP.update( | |
| {"command_list": ".cmds\nUse - Get the list of all plugins in the bot."} | |
| ) | |