#something erorr help me!

1 messages · Page 1 of 1 (latest)

bronze jewel
#

Here's a bit of my code, I run it on termux.
I know sudo need rooted device, To make easier to copy the eror code i run it on normal device xD
Don't worry i run it on rooted erorr too

async def download(interaction: discord.Interaction):
    if reroll_in_progress:
        await interaction.response.send_message("A reroll is in progress. Please wait until it completes.", ephemeral=True)
        return

    if interaction.user.id not in allowed_ids:
        await interaction.response.send_message("Only the bot owner can use this command.", ephemeral=True)
        return
    else:
        subprocess.run(["sudo", "pkill", "com.truedevelopersstudio.automatictap.autoclicker"])
        subprocess.run(["sudo", "pkill", "com.zigzagame.evertale"])
        subprocess.run(["am", "start", "com.zigzagame.evertale/com.google.firebase.MessagingUnityPlayerActivity"])
        asyncio.sleep(15)
        subprocess.run(['bash', '/data/data/com.termux/files/home/godfinn/download.sh'])
        if os.path.exists("/data/data/com.termux/files/home/godfinn/download/Monster.json") and os.path.exists("/data/data/com.termux/files/home/godfinn/download/Ability.json"):
            folder_to_zip = '/data/data/com.termux/files/home/godfinn/download/'
            zip_file_path = '/data/data/com.termux/files/home/godfinn/godfinn.zip'
            await zip_folder(folder_to_zip, zip_file_path)
            subprocess.run(["rm", "-rf", "/data/data/com.termux/files/home/godfinn/download"])
            await interaction.followup.send(file=discord.File(zip_file_path))
            os.remove(zip_file_path)
        else:
            await interaction.followup.send("File not exist.")```


```ERROR    discord.app_commands.tree Ignoring exception in command 'download'
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/discord/app_commands/commands.py", line 828, in _do_call
    return await self._callback(interaction, **params)  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/home/rif/r9.py", line 128, in download
    subprocess.run(["sudo", "pkill", "com.truedevelopersstudio.automatictap.autoclicker"])
  File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/data/data/com.termux/files/usr/lib/python3.11/subprocess.py", line 1951, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'sudo'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/discord/app_commands/tree.py", line 1248, in _call
    await command._invoke_with_namespace(interaction, namespace)
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/discord/app_commands/commands.py", line 853, in _invoke_with_namespace
    return await self._do_call(interaction, transformed_values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/discord/app_commands/commands.py", line 846, in _do_call
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'download' raised an exception: FileNotFoundError: [Errno 2] No such file or directory: 'sudo'```
wraith briarBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

eager dust
#

discord? it looks like you're running an unsupported version of interactions.py... or you're running discord-py.

if you are using discord-py-slash-command, please update to the latest version (v5, 5.12.1) of interactions-py / discord-py-interactions. v4 and older are unsupported.

eager dust
#

can you show me the output of pip freeze or python3 -m pip freeze

bronze jewel
# eager dust can you show me the output of `pip freeze` or `python3 -m pip freeze`

aiohttp==3.9.3
aiosignal==1.3.1
attrs==23.2.0
certifi==2024.2.2
charset-normalizer==3.3.2
croniter==2.0.5
discord==2.3.2
discord-py-interactions==5.12.1
discord-py-slash-command==4.2.1
discord-typings==0.8.0
discord.py==2.3.2
emoji==2.12.1
frozenlist==1.4.1
idna==3.6
input==0.0.0
multidict==6.0.5
python-dateutil==2.9.0.post0
pytz==2024.1
rarfile==4.2
requests==2.31.0
six==1.16.0
speedtest==0.0.1
tomli==2.0.1
typing_extensions==4.11.0
urllib3==2.2.1
yarl==1.9.4

eager dust
#

discord-py-slash-command==4.2.1
discord.py==2.3.2
yeah you might want to uninstall these and just use discord-py-interactions. discord-py-slash-command (old) and discord-py-interactions (current) do NOT go well installed together

eager dust
#

(your code does appear to be using discord-py/discord-py-slash-command stuff either way, which is unsupported here. so yeah)