-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
401 additions
and
401 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,48 @@ | ||
.. _autostart_windows: | ||
|
||
============================================== | ||
Setting up auto-restart using batch on Windows | ||
============================================== | ||
|
||
.. note:: This guide assumes that you already have a working Red instance. | ||
|
||
----------------------- | ||
Creating the batch file | ||
----------------------- | ||
|
||
Create a new text document anywhere you want to. This file will be used to launch the bot, so you may want to put it somewhere convenient, like Documents or Desktop. | ||
|
||
Open that document in Notepad, and paste the following text in it: | ||
|
||
.. code-block:: batch | ||
@ECHO OFF | ||
:RED | ||
CALL "%userprofile%\redenv\Scripts\activate.bat" | ||
python -O -m redbot <your instance name> | ||
IF %ERRORLEVEL% NEQ 0 ( | ||
ECHO Restarting Red... | ||
GOTO RED | ||
) | ||
Replace ``<your instance name>`` with the instance name of your bot. | ||
If you created your VENV at a location other than the recommended one, replace ``%userprofile%\redenv\Scripts\activate.bat`` with the path to your VENV. | ||
|
||
Click "File", "Save as". Change the dropdown "Save as type" to "All Files (*.*)". Set the filename to ``start_redbot.bat``, and click save. | ||
|
||
There should now be a new file in the location you created the text document in. You can delete that text document as it is no longer needed. | ||
You can now use the ``start_redbot.bat`` batch file to launch Red by double clicking it. | ||
This script will automatically restart red when the ``[p]restart`` command is used or when the bot shuts down abnormally. | ||
|
||
------------------------- | ||
Launch the bot on startup | ||
------------------------- | ||
|
||
Create a shortcut of your ``start_redbot.bat`` file. | ||
|
||
Open the "Run" dialogue box using Windows Key + R. | ||
|
||
Enter ``shell:startup`` if you want the bot to launch only when the current user logs in, or ``shell:common startup`` if you want the bot to launch when any user logs in. | ||
|
||
Drag the shortcut into the folder that is opened. The bot will now launch on startup. | ||
.. _autostart_windows: | ||
|
||
============================================== | ||
Setting up auto-restart using batch on Windows | ||
============================================== | ||
|
||
.. note:: This guide assumes that you already have a working Red instance. | ||
|
||
----------------------- | ||
Creating the batch file | ||
----------------------- | ||
|
||
Create a new text document anywhere you want to. This file will be used to launch the bot, so you may want to put it somewhere convenient, like Documents or Desktop. | ||
|
||
Open that document in Notepad, and paste the following text in it: | ||
|
||
.. code-block:: batch | ||
@ECHO OFF | ||
:RED | ||
CALL "%userprofile%\redenv\Scripts\activate.bat" | ||
python -O -m redbot <your instance name> | ||
IF %ERRORLEVEL% NEQ 0 ( | ||
ECHO Restarting Red... | ||
GOTO RED | ||
) | ||
Replace ``<your instance name>`` with the instance name of your bot. | ||
If you created your VENV at a location other than the recommended one, replace ``%userprofile%\redenv\Scripts\activate.bat`` with the path to your VENV. | ||
|
||
Click "File", "Save as". Change the dropdown "Save as type" to "All Files (*.*)". Set the filename to ``start_redbot.bat``, and click save. | ||
|
||
There should now be a new file in the location you created the text document in. You can delete that text document as it is no longer needed. | ||
You can now use the ``start_redbot.bat`` batch file to launch Red by double clicking it. | ||
This script will automatically restart red when the ``[p]restart`` command is used or when the bot shuts down abnormally. | ||
|
||
------------------------- | ||
Launch the bot on startup | ||
------------------------- | ||
|
||
Create a shortcut of your ``start_redbot.bat`` file. | ||
|
||
Open the "Run" dialogue box using Windows Key + R. | ||
|
||
Enter ``shell:startup`` if you want the bot to launch only when the current user logs in, or ``shell:common startup`` if you want the bot to launch when any user logs in. | ||
|
||
Drag the shortcut into the folder that is opened. The bot will now launch on startup. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
.. tree module docs | ||
==== | ||
Tree | ||
==== | ||
|
||
Red uses a subclass of discord.py's ``CommandTree`` object in order to allow Cog Creators to add application commands to their cogs without worrying about the command count limit and to support caching ``AppCommand`` objects. When an app command is added to the bot's tree, it will not show up in ``tree.get_commands`` or other similar methods unless the command is "enabled" with ``[p]slash enable`` (similar to "load"ing a cog) and ``tree.red_check_enabled`` has been run since the command was added to the tree. | ||
|
||
.. note:: | ||
|
||
If you are adding app commands to the tree during load time, the loading process will call ``tree.red_check_enabled`` for your cog and its app commands. If you are adding app commands to the bot **outside of load time**, a call to ``tree.red_check_enabled`` after adding the commands is required to ensure the commands will appear properly. | ||
|
||
If application commands from your cog show up in ``[p]slash list`` as enabled from an ``(unknown)`` cog and disabled from your cog at the same time, you did not follow the instructions above. You must manually call ``tree.red_check_enabled`` **after** adding the commands to the tree. | ||
|
||
.. automodule:: redbot.core.tree | ||
|
||
RedTree | ||
^^^^^^^ | ||
|
||
.. autoclass:: RedTree | ||
:members: | ||
.. tree module docs | ||
==== | ||
Tree | ||
==== | ||
|
||
Red uses a subclass of discord.py's ``CommandTree`` object in order to allow Cog Creators to add application commands to their cogs without worrying about the command count limit and to support caching ``AppCommand`` objects. When an app command is added to the bot's tree, it will not show up in ``tree.get_commands`` or other similar methods unless the command is "enabled" with ``[p]slash enable`` (similar to "load"ing a cog) and ``tree.red_check_enabled`` has been run since the command was added to the tree. | ||
|
||
.. note:: | ||
|
||
If you are adding app commands to the tree during load time, the loading process will call ``tree.red_check_enabled`` for your cog and its app commands. If you are adding app commands to the bot **outside of load time**, a call to ``tree.red_check_enabled`` after adding the commands is required to ensure the commands will appear properly. | ||
|
||
If application commands from your cog show up in ``[p]slash list`` as enabled from an ``(unknown)`` cog and disabled from your cog at the same time, you did not follow the instructions above. You must manually call ``tree.red_check_enabled`` **after** adding the commands to the tree. | ||
|
||
.. automodule:: redbot.core.tree | ||
|
||
RedTree | ||
^^^^^^^ | ||
|
||
.. autoclass:: RedTree | ||
:members: |
Oops, something went wrong.