Closed BloodDragon2580 closed 7 months ago
Yes, you can make messages only visible to the person who used the command, this is known as ephemeral
messages, you can add it like so: await interaction.response.send_message(embed=embed_message, ephemeral=True)
to this line
If you'd so like, we don't know if this is something we'd want to do for the project globally, but feel free to add it yourself!
Nice thx for the very fast Support.
After change this for "/save" Command this error is showing:
2024-02-03 00:20:24,785 - client - INFO - Setting up RCON connection
2024-02-03 00:20:24,786 - client - DEBUG - Saving world
[2024-02-03 00:20:26] [ERROR ] discord.app_commands.tree: Ignoring exception in command 'save'
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\app_commands\commands.py", line 828, in _do_call
return await self._callback(interaction, **params) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\PalCON-Discord\main.py", line 125, in save
await interaction.response.send_message(embed=embed_message, ephemeral=true)
^^^^
NameError: name 'true' is not defined
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\app_commands\tree.py", line 1248, in _call
await command._invoke_with_namespace(interaction, namespace)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\app_commands\commands.py", line 853, in _invoke_with_namespace
return await self._do_call(interaction, transformed_values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\app_commands\commands.py", line 846, in _do_call
raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'save' raised an exception: NameError: name 'true' is not defined
True
not true
Brandon made a typo
Python's booleans (i.e. true-or-false data types) are capitalised: True
/False
That's why the Python interpreter is confused by true
here - since there's no variable with the name true
defined in the repo
It works wonderfully, many thanks to you.
Is there a way to make a message only visible to the admin? E.g. "/save" the post will be displayed to all users in the Discord Channel that the world has been saved.
I saw with another bot "Palbot" that it is only displayed for the person who executed the command. Not to mention that only certain messages were visible to all users.
Maybe it's a stupid question, but I'm still new to the whole Discord thing^^.