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'```