|
@@ -1,3 +1,4 @@
|
|
|
+import re
|
|
|
from io import BytesIO
|
|
|
from sys import executable
|
|
|
from struct import pack
|
|
@@ -408,16 +409,18 @@ async def vpn_handler(bot, event, command):
|
|
|
await event.reply('Готово!!~~ Файл конфигурации WireGuard отправлен в Ваши личные сообщения!')
|
|
|
|
|
|
async def run_handler(bot, event, command):
|
|
|
- if command.argc < 2:
|
|
|
+ if command.argc < 1:
|
|
|
await event.reply('Пожалуйста, не оставляйте ввод пустым!')
|
|
|
|
|
|
return
|
|
|
|
|
|
+ language_name, text = re.match(r'^(\w+)(?:\s|\n)((?:\n|.)*)$', command.args_string)
|
|
|
+
|
|
|
async with ClientSession() as session:
|
|
|
try:
|
|
|
async with session.post(
|
|
|
- f'https://farlands.txlyre.website/run/{command.args[0]}',
|
|
|
- data=command.args_string[command.args_string.find(' ')+1:]
|
|
|
+ f'https://farlands.txlyre.website/run/{language_name}',
|
|
|
+ data=text
|
|
|
) as resp:
|
|
|
if resp.status in (404, 500):
|
|
|
info = await resp.json()
|