mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
Merge branch 'V3/develop' into cog_guide_core
# Conflicts: # redbot/core/core_commands.py
This commit is contained in:
129
docs/_ext/deprecated_removed.py
Normal file
129
docs/_ext/deprecated_removed.py
Normal file
@@ -0,0 +1,129 @@
|
||||
"""
|
||||
A Sphinx extension adding a ``deprecated-removed`` directive that works
|
||||
similarly to CPython's directive with the same name.
|
||||
|
||||
The key difference is that instead of passing the version of planned removal,
|
||||
the writer must provide the minimum amount of days that must pass
|
||||
since the date of the release it was deprecated in.
|
||||
|
||||
Due to lack of a concrete release schedule for Red, this ensures that
|
||||
we give enough time to people affected by the changes no matter
|
||||
when the releases actually happen.
|
||||
|
||||
`DeprecatedRemoved` class is heavily based on
|
||||
`sphinx.domains.changeset.VersionChange` class that is available at:
|
||||
https://github.com/sphinx-doc/sphinx/blob/0949735210abaa05b6448e531984f159403053f4/sphinx/domains/changeset.py
|
||||
|
||||
Copyright 2007-2020 by the Sphinx team, see AUTHORS:
|
||||
https://github.com/sphinx-doc/sphinx/blob/82f495fed386c798735adf675f867b95d61ee0e1/AUTHORS
|
||||
|
||||
The original copy was distributed under BSD License and this derivative work
|
||||
is distributed under GNU GPL Version 3.
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import multiprocessing
|
||||
import subprocess
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from docutils import nodes
|
||||
from sphinx import addnodes
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.util.docutils import SphinxDirective
|
||||
|
||||
|
||||
class TagDateCache:
|
||||
def __init__(self) -> None:
|
||||
self._tags: Dict[str, datetime.date] = {}
|
||||
|
||||
def _populate_tags(self) -> None:
|
||||
with _LOCK:
|
||||
if self._tags:
|
||||
return
|
||||
out = subprocess.check_output(
|
||||
("git", "tag", "-l", "--format", "%(creatordate:raw)\t%(refname:short)"),
|
||||
text=True,
|
||||
)
|
||||
lines = out.splitlines(False)
|
||||
for line in lines:
|
||||
creator_date, tag_name = line.split("\t", maxsplit=1)
|
||||
timestamp = int(creator_date.split(" ", maxsplit=1)[0])
|
||||
self._tags[tag_name] = datetime.datetime.fromtimestamp(
|
||||
timestamp, tz=datetime.timezone.utc
|
||||
).date()
|
||||
|
||||
def get_tag_date(self, tag_name: str) -> Optional[datetime.date]:
|
||||
self._populate_tags()
|
||||
return self._tags.get(tag_name)
|
||||
|
||||
|
||||
_LOCK = multiprocessing.Manager().Lock()
|
||||
_TAGS = TagDateCache()
|
||||
|
||||
|
||||
class DeprecatedRemoved(SphinxDirective):
|
||||
has_content = True
|
||||
required_arguments = 2
|
||||
optional_arguments = 1
|
||||
final_argument_whitespace = True
|
||||
|
||||
def run(self) -> List[nodes.Node]:
|
||||
# Some Sphinx stuff
|
||||
node = addnodes.versionmodified()
|
||||
node.document = self.state.document
|
||||
self.set_source_info(node)
|
||||
node["type"] = self.name
|
||||
node["version"] = tuple(self.arguments)
|
||||
if len(self.arguments) == 3:
|
||||
inodes, messages = self.state.inline_text(self.arguments[2], self.lineno + 1)
|
||||
para = nodes.paragraph(self.arguments[2], "", *inodes, translatable=False)
|
||||
self.set_source_info(para)
|
||||
node.append(para)
|
||||
else:
|
||||
messages = []
|
||||
|
||||
# Text generation
|
||||
deprecation_version = self.arguments[0]
|
||||
minimum_days = int(self.arguments[1])
|
||||
tag_date = _TAGS.get_tag_date(deprecation_version)
|
||||
text = (
|
||||
f"Will be deprecated in version {deprecation_version},"
|
||||
" and removed in the first minor version that gets released"
|
||||
f" after {minimum_days} days since deprecation"
|
||||
if tag_date is None
|
||||
else f"Deprecated since version {deprecation_version},"
|
||||
" will be removed in the first minor version that gets released"
|
||||
f" after {tag_date + datetime.timedelta(days=minimum_days)}"
|
||||
)
|
||||
|
||||
# More Sphinx stuff
|
||||
if self.content:
|
||||
self.state.nested_parse(self.content, self.content_offset, node)
|
||||
classes = ["versionmodified"]
|
||||
if len(node):
|
||||
if isinstance(node[0], nodes.paragraph) and node[0].rawsource:
|
||||
content = nodes.inline(node[0].rawsource, translatable=True)
|
||||
content.source = node[0].source
|
||||
content.line = node[0].line
|
||||
content += node[0].children
|
||||
node[0].replace_self(nodes.paragraph("", "", content, translatable=False))
|
||||
|
||||
node[0].insert(0, nodes.inline("", f"{text}: ", classes=classes))
|
||||
else:
|
||||
para = nodes.paragraph(
|
||||
"", "", nodes.inline("", f"{text}.", classes=classes), translatable=False
|
||||
)
|
||||
node.append(para)
|
||||
|
||||
ret = [node]
|
||||
ret += messages
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
def setup(app: Sphinx) -> Dict[str, Any]:
|
||||
app.add_directive("deprecated-removed", DeprecatedRemoved)
|
||||
return {
|
||||
"version": "1.0",
|
||||
"parallel_read_safe": True,
|
||||
}
|
||||
@@ -12,39 +12,37 @@ Installing PM2
|
||||
|
||||
Start by installing Node.JS and NPM via your favorite package distributor. From there run the following command:
|
||||
|
||||
:code:`npm install pm2 -g`
|
||||
.. prompt:: bash
|
||||
|
||||
npm install pm2 -g
|
||||
|
||||
After PM2 is installed, run the following command to enable your Red instance to be managed by PM2. Replace the brackets with the required information.
|
||||
You can add additional Red based arguments after the instance, such as :code:`--dev`.
|
||||
You can add additional Red based arguments after the instance name, such as :code:`--dev`.
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
pm2 start redbot --name "<Insert a name here>" --interpreter "<Location to your Python Interpreter>" --interpreter-args "-O" -- <Red Instance> --no-prompt
|
||||
pm2 start "<path>" --name "<app_name>" -- -O -m redbot <instance_name> --no-prompt
|
||||
|
||||
.. code-block:: none
|
||||
**Arguments to replace**
|
||||
|
||||
Arguments to replace.
|
||||
- ``<app_name>`` - A name to identify the bot within pm2, this is not your Red instance.
|
||||
|
||||
<Insert a name here>
|
||||
A name to identify the bot within pm2, this is not your Red instance.
|
||||
- | ``<path>`` - The location of your Python interpreter.
|
||||
| To find out where that is, use the proper set of commands:
|
||||
|
||||
<Location to your Python Interpreter>
|
||||
The location of your Python interpreter, to find out where that is use the following command inside activated venv:
|
||||
which python
|
||||
.. prompt:: bash
|
||||
:prompts: $,(redenv) $
|
||||
:modifiers: auto
|
||||
|
||||
<Red Instance>
|
||||
The name of your Red instance.
|
||||
# If redbot is installed in a venv
|
||||
$ source ~/redenv/bin/activate
|
||||
(redenv) $ which python
|
||||
|
||||
If you used :code:`pyenv virtualenv` to create your virtual environment, please make the following changes to the above generated command
|
||||
# If redbot is installed in a pyenv virtualenv
|
||||
$ pyenv shell <virtualenv_name>
|
||||
(redenv) $ pyenv which python
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
<Location to your Python Interpreter>
|
||||
Run the following instead to get your Python interpreter
|
||||
pyenv which python
|
||||
|
||||
Replace the `redbot` part of `pm2 start redbot` with the output of the following (when ran inside your activated venv)
|
||||
pyenv which redbot
|
||||
- ``<instance_name>`` - The name of your Red instance.
|
||||
|
||||
------------------------------
|
||||
Ensuring that PM2 stays online
|
||||
@@ -52,4 +50,7 @@ Ensuring that PM2 stays online
|
||||
|
||||
To make sure that PM2 stays online and persistence between machine restarts, run the following commands:
|
||||
|
||||
:code:`pm2 save` & :code:`pm2 startup`
|
||||
.. prompt:: bash
|
||||
|
||||
pm2 save
|
||||
pm2 startup
|
||||
|
||||
@@ -14,21 +14,23 @@ In order to create the service file, you will first need to know two things, you
|
||||
|
||||
First, your Linux :code:`username` can be fetched with the following command:
|
||||
|
||||
.. code-block:: bash
|
||||
.. prompt:: bash
|
||||
|
||||
whoami
|
||||
|
||||
Next, your python :code:`path` can be fetched with the following commands:
|
||||
|
||||
.. code-block:: bash
|
||||
.. prompt:: bash
|
||||
:prompts: $,(redenv) $
|
||||
:modifiers: auto
|
||||
|
||||
# If redbot is installed in a venv
|
||||
source ~/redenv/bin/activate
|
||||
which python
|
||||
$ source ~/redenv/bin/activate
|
||||
(redenv) $ which python
|
||||
|
||||
# If redbot is installed in a pyenv virtualenv
|
||||
pyenv shell <virtualenv_name>
|
||||
pyenv which python
|
||||
$ pyenv shell <virtualenv_name>
|
||||
(redenv) $ pyenv which python
|
||||
|
||||
Then create the new service file:
|
||||
|
||||
@@ -67,20 +69,28 @@ Starting and enabling the service
|
||||
|
||||
To start the bot, run the service and add the instance name after the **@**:
|
||||
|
||||
:code:`sudo systemctl start red@instancename`
|
||||
.. prompt:: bash
|
||||
|
||||
sudo systemctl start red@instancename
|
||||
|
||||
To set the bot to start on boot, you must enable the service, again adding the instance name after the **@**:
|
||||
|
||||
:code:`sudo systemctl enable red@instancename`
|
||||
.. prompt:: bash
|
||||
|
||||
sudo systemctl enable red@instancename
|
||||
|
||||
If you need to shutdown the bot, you can use the ``[p]shutdown`` command or
|
||||
type the following command in the terminal, still by adding the instance name after the **@**:
|
||||
|
||||
:code:`sudo systemctl stop red@instancename`
|
||||
.. prompt:: bash
|
||||
|
||||
sudo systemctl stop red@instancename
|
||||
|
||||
.. warning:: If the service doesn't stop in the next 10 seconds, the process is killed.
|
||||
Check your logs to know the cause of the error that prevents the shutdown.
|
||||
|
||||
To view Red’s log, you can acccess through journalctl:
|
||||
|
||||
:code:`sudo journalctl -eu red@instancename`
|
||||
.. prompt:: bash
|
||||
|
||||
sudo journalctl -eu red@instancename
|
||||
|
||||
@@ -1,5 +1,146 @@
|
||||
.. 3.4.x Changelogs
|
||||
|
||||
Redbot 3.4.9 (2021-04-06)
|
||||
=========================
|
||||
|
||||
This is a hotfix release fixing an issue with command error handling.
|
||||
|
||||
discord.py version has been bumped to 1.7.1.
|
||||
|
||||
Thanks again to :ghuser:`Rapptz` for quick response on this issue.
|
||||
|
||||
|
||||
Redbot 3.4.8 (2021-04-06)
|
||||
=========================
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
| :ghuser:`6days9weeks`, :ghuser:`aikaterna`, :ghuser:`Drapersniper`, :ghuser:`fixator10`, :ghuser:`Flame442`, :ghuser:`flaree`, :ghuser:`jack1142`, :ghuser:`kingslayer268`, :ghuser:`Kowlin`, :ghuser:`Kreusada`, :ghuser:`Obi-Wan3`, :ghuser:`OofChair`, :ghuser:`palmtree5`, :ghuser:`phenom4n4n`, :ghuser:`PredaaA`, :ghuser:`Predeactor`, :ghuser:`rijusougata13`, :ghuser:`TheDiscordHistorian`, :ghuser:`Tobotimus`, :ghuser:`TrustyJAID`, :ghuser:`Twentysix26`, :ghuser:`Vexed01`
|
||||
|
||||
Read before updating
|
||||
--------------------
|
||||
|
||||
1. Information for Audio users that are using an external Lavalink instance (if you don't know what that is, you should skip this point):
|
||||
|
||||
Red 3.4.8 uses a new Lavalink jar that you will need to manually update from `our GitHub <https://github.com/Cog-Creators/Lavalink-Jars/releases/tag/3.3.2.3_1212>`__.
|
||||
|
||||
2. Fedora 31 and OpenSUSE Leap 15.1 are no longer supported as they have already reached end of life.
|
||||
|
||||
|
||||
End-user changelog
|
||||
------------------
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Added per-command embed settings (:issue:`4049`)
|
||||
|
||||
- See help of ``[p]embedset`` and ``[p]embedset command`` command group for more information
|
||||
|
||||
- The ``[p]servers`` command uses menus now (:issue:`4720`, :issue:`4831`)
|
||||
- ``[p]leave`` accepts server IDs now (:issue:`4831`)
|
||||
- Commands for listing global and local allowlists and blocklists will now, in addition to IDs, contain user/role names (:issue:`4839`)
|
||||
- Messages sent interactively in DM channels no longer fail (:issue:`4876`)
|
||||
- An error message will now be shown when a command that is only available in NSFW channels is used in a non-NSFW channel (:issue:`4933`)
|
||||
- Added more singular and plural forms in a bunch of commands in the bot (:issue:`4004`, :issue:`4898`)
|
||||
- Removed the option to drop the entire PostgreSQL database in ``redbot-setup delete`` due to limitations of PostgreSQL (:issue:`3699`, :issue:`3833`)
|
||||
- Added a progress bar to ``redbot-setup convert`` (:issue:`2952`)
|
||||
- Fixed how the command signature is shown in help for subcommands that have group args (:issue:`4928`)
|
||||
|
||||
Alias
|
||||
*****
|
||||
|
||||
- Fixed issues with command aliases for commands that take an arbitrary, but non-zero, number of arguments (e.g. ``[p]load``) (:issue:`4766`, :issue:`4871`)
|
||||
|
||||
Audio
|
||||
*****
|
||||
|
||||
- Fixed stuttering (:issue:`4565`)
|
||||
- Fixed random disconnects (:issue:`4565`)
|
||||
- Fixed the issues causing the player to be stuck on 00:00 (:issue:`4565`)
|
||||
- Fixed ghost players (:issue:`4565`)
|
||||
- Audio will no longer stop playing after a while (:issue:`4565`)
|
||||
- Fixed playlist loading for playlists with over 100 songs (:issue:`4932`)
|
||||
- Fixed an issue with alerts causing errors in playlists being loaded (:issue:`4932`)
|
||||
- Improved playlist extraction (:issue:`4932`)
|
||||
- Fixed an issue with consent pages appearing while trying to load songs or playlists (:issue:`4932`)
|
||||
|
||||
Cleanup
|
||||
*******
|
||||
|
||||
- ``[p]cleanup before`` and ``[p]cleanup after`` commands can now be used without a message ID if the invocation message replies to some message (:issue:`4790`)
|
||||
|
||||
Downloader
|
||||
**********
|
||||
|
||||
- Improved compatibility with Git 2.31 and newer (:issue:`4897`)
|
||||
|
||||
Filter
|
||||
******
|
||||
|
||||
- Added meaningful error messages for incorrect arguments in the ``[p]bank set`` command (:issue:`4789`, :issue:`4801`)
|
||||
|
||||
Mod
|
||||
***
|
||||
|
||||
- Improved performance of checking tempban expirations (:issue:`4907`)
|
||||
- Fixed tracking of nicknames that were set just before nick reset (:issue:`4830`)
|
||||
|
||||
Mutes
|
||||
*****
|
||||
|
||||
- Vastly improved performance of automatic unmute handling (:issue:`4906`)
|
||||
|
||||
Streams
|
||||
*******
|
||||
|
||||
- Streams cog should now load faster on bots that have many stream alerts set up (:issue:`4731`, :issue:`4742`)
|
||||
- Fixed possible memory leak related to automatic message deletion (:issue:`4731`, :issue:`4742`)
|
||||
- Streamer accounts that no longer exist are now properly handled (:issue:`4735`, :issue:`4746`)
|
||||
- Fixed stream alerts being sent even after unloading Streams cog (:issue:`4940`)
|
||||
- Checking Twitch streams will now make less API calls (:issue:`4938`)
|
||||
- Ratelimits from Twitch API are now properly handled (:issue:`4808`, :issue:`4883`)
|
||||
|
||||
Trivia
|
||||
******
|
||||
|
||||
- Added a new option for hiding the answer to the Trivia answer in a spoiler (:issue:`4700`, :issue:`4877`)
|
||||
|
||||
- ``[p]triviaset usespoilers`` command can be used to enable/disable this option
|
||||
|
||||
Warnings
|
||||
********
|
||||
|
||||
- Fixed output of ``[p]warnings`` command for members that are no longer in the server (:issue:`4900`, :issue:`4904`)
|
||||
- Embeds now use the default embed color of the bot (:issue:`4878`)
|
||||
|
||||
|
||||
Developer changelog
|
||||
-------------------
|
||||
|
||||
- Bumped discord.py version to 1.7.0 (:issue:`4928`)
|
||||
- Deprecated importing ``GuildConverter`` from ``redbot.core.commands.converter`` namespace (:issue:`4928`)
|
||||
|
||||
- ``discord.Guild`` or ``GuildConverter`` from ``redbot.core.commands`` should be used instead
|
||||
- Added ``guild`` parameter to `bot.allowed_by_whitelist_blacklist() <RedBase.allowed_by_whitelist_blacklist()>` which is meant to replace the deprecated ``guild_id`` parameter (:issue:`4905`, :issue:`4914`)
|
||||
|
||||
- Read the method's documentation for more information
|
||||
- Fixed ``on_red_api_tokens_update`` not being dispatched when the tokens were removed with ``[p]set api remove`` (:issue:`4916`, :issue:`4917`)
|
||||
|
||||
|
||||
Documentation changes
|
||||
---------------------
|
||||
|
||||
- Added a note about updating cogs in update message and documentation (:issue:`4910`)
|
||||
- Added `cog guide for Image cog <cog_guides/image>` (:issue:`4821`)
|
||||
- Updated Mac install guide with new ``brew`` commands (:issue:`4865`)
|
||||
- `getting-started` now contains an explanation of parameters that can take an arbitrary number of arguments (:issue:`4888`, :issue:`4889`)
|
||||
- Added a warning to Arch Linux install guide about the instructions being out-of-date (:issue:`4866`)
|
||||
- All shell commands in the documentation are now prefixed with an unselectable prompt (:issue:`4908`)
|
||||
- `systemd-service-guide` now asks the user to create the new service file using ``nano`` text editor (:issue:`4869`, :issue:`4870`)
|
||||
|
||||
- Instructions for all Linux-based operating systems now recommend to install ``nano``
|
||||
- Updated Python version in ``pyenv`` and Windows instructions (:issue:`4864`, :issue:`4942`)
|
||||
|
||||
|
||||
Redbot 3.4.7 (2021-02-26)
|
||||
=========================
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
|
||||
@@ -193,7 +193,7 @@ reorderpath
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]reorderpath <from\_> <to>
|
||||
[p]reorderpath <from_> <to>
|
||||
|
||||
**Description**
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, os.path.abspath(".."))
|
||||
sys.path.insert(0, os.path.abspath("_ext"))
|
||||
|
||||
os.environ["BUILDING_DOCS"] = "1"
|
||||
|
||||
@@ -42,6 +43,8 @@ extensions = [
|
||||
"sphinx.ext.napoleon",
|
||||
"sphinx.ext.doctest",
|
||||
"sphinxcontrib_trio",
|
||||
"sphinx-prompt",
|
||||
"deprecated_removed",
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
|
||||
@@ -83,7 +83,7 @@ In that file, place the following code:
|
||||
|
||||
from redbot.core import commands
|
||||
|
||||
class Mycog(commands.Cog):
|
||||
class MyCog(commands.Cog):
|
||||
"""My custom cog"""
|
||||
|
||||
@commands.command()
|
||||
@@ -96,11 +96,11 @@ Open :code:`__init__.py`. In that file, place the following:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from .mycog import Mycog
|
||||
from .mycog import MyCog
|
||||
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(Mycog())
|
||||
bot.add_cog(MyCog())
|
||||
|
||||
Make sure that both files are saved.
|
||||
|
||||
|
||||
@@ -40,7 +40,12 @@ Operating systems
|
||||
Arch Linux
|
||||
~~~~~~~~~~
|
||||
|
||||
.. code-block:: none
|
||||
.. warning::
|
||||
|
||||
Latest Python packages for Arch Linux provide Python 3.9 which Red does not currently support.
|
||||
To use Red on Arch Linux, you will need to install latest version of Python 3.8 on your own.
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
sudo pacman -Syu python python-pip git jre11-openjdk-headless base-devel nano
|
||||
|
||||
@@ -55,7 +60,7 @@ Continue by `creating-venv-linux`.
|
||||
CentOS and RHEL 7
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
sudo yum -y groupinstall development
|
||||
sudo yum -y install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel xz xz-devel tk-devel libffi-devel findutils java-11-openjdk-headless nano
|
||||
@@ -66,7 +71,7 @@ CentOS and RHEL 7
|
||||
|
||||
In order to install Git 2.11 or greater, we recommend adding the IUS repository:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
sudo yum -y install https://repo.ius.io/ius-release-el7.rpm
|
||||
sudo yum -y swap git git224
|
||||
@@ -82,7 +87,7 @@ Complete the rest of the installation by `installing Python 3.8 with pyenv <inst
|
||||
CentOS and RHEL 8
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
sudo yum -y install epel-release
|
||||
sudo yum -y update
|
||||
@@ -103,7 +108,7 @@ Debian and Raspbian Buster
|
||||
We recommend installing pyenv as a method of installing non-native versions of python on
|
||||
Debian/Raspbian Buster. This guide will tell you how. First, run the following commands:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
sudo apt update
|
||||
sudo apt -y install make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev libgdbm-dev uuid-dev python3-openssl git openjdk-11-jre-headless nano
|
||||
@@ -122,7 +127,7 @@ Fedora Linux
|
||||
Fedora Linux 32 and above has all required packages available in official repositories. Install
|
||||
them with dnf:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
sudo dnf -y install python38 git java-11-openjdk-headless @development-tools nano
|
||||
|
||||
@@ -139,14 +144,14 @@ Mac
|
||||
Install Brew: in Finder or Spotlight, search for and open *Terminal*. In the terminal, paste the
|
||||
following, then press Enter:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
||||
|
||||
After the installation, install the required packages by pasting the commands and pressing enter,
|
||||
one-by-one:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
brew install python@3.8
|
||||
echo 'export PATH="/usr/local/opt/python@3.8/bin:$PATH"' >> ~/.profile
|
||||
@@ -172,7 +177,7 @@ be installed to the ``/opt`` directory.
|
||||
|
||||
First, add the Opt-Python community repository:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
source /etc/os-release
|
||||
sudo zypper -n ar -f https://download.opensuse.org/repositories/home:/Rotkraut:/Opt-Python/openSUSE_Leap_${VERSION_ID}/ Opt-Python
|
||||
@@ -180,7 +185,7 @@ First, add the Opt-Python community repository:
|
||||
|
||||
Now install the pre-requirements with zypper:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
sudo zypper -n install opt-python38 opt-python38-setuptools git-core java-11-openjdk-headless nano
|
||||
sudo zypper -n install -t pattern devel_basis
|
||||
@@ -188,14 +193,14 @@ Now install the pre-requirements with zypper:
|
||||
Since Python is now installed to ``/opt/python``, we should add it to PATH. You can add a file in
|
||||
``/etc/profile.d/`` to do this:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
echo 'export PATH="/opt/python/bin:$PATH"' | sudo tee /etc/profile.d/opt-python.sh
|
||||
source /etc/profile.d/opt-python.sh
|
||||
|
||||
Now, install pip with easy_install:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
sudo /opt/python/bin/easy_install-3.8 pip
|
||||
|
||||
@@ -207,9 +212,9 @@ openSUSE Tumbleweed
|
||||
openSUSE Tumbleweed has all required dependencies available in official repositories. Install them
|
||||
with zypper:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
sudo zypper -n install python3-base python3-pip git-core java-11-openjdk-headless nano
|
||||
sudo zypper -n install python38-base python38-pip git-core java-11-openjdk-headless nano
|
||||
sudo zypper -n install -t pattern devel_basis
|
||||
|
||||
Continue by `creating-venv-linux`.
|
||||
@@ -224,7 +229,7 @@ Ubuntu 18.04 LTS
|
||||
|
||||
We recommend adding the ``git-core`` ppa to install Git 2.11 or greater:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
sudo apt update
|
||||
sudo apt -y install software-properties-common
|
||||
@@ -232,13 +237,13 @@ We recommend adding the ``git-core`` ppa to install Git 2.11 or greater:
|
||||
|
||||
We recommend adding the ``deadsnakes`` ppa to install Python 3.8.1 or greater:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
sudo add-apt-repository -y ppa:deadsnakes/ppa
|
||||
|
||||
Now install the pre-requirements with apt:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
sudo apt -y install python3.8 python3.8-dev python3.8-venv python3-pip git openjdk-11-jre-headless build-essential nano
|
||||
|
||||
@@ -254,7 +259,7 @@ Ubuntu 20.04 LTS
|
||||
|
||||
We recommend adding the ``git-core`` ppa to install Git 2.11 or greater:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
sudo apt update
|
||||
sudo apt -y install software-properties-common
|
||||
@@ -262,7 +267,7 @@ We recommend adding the ``git-core`` ppa to install Git 2.11 or greater:
|
||||
|
||||
Now install the pre-requirements with apt:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
sudo apt -y install python3.8 python3.8-dev python3.8-venv python3-pip git openjdk-11-jre-headless build-essential nano
|
||||
|
||||
@@ -278,7 +283,7 @@ Ubuntu non-LTS versions
|
||||
|
||||
We recommend adding the ``git-core`` ppa to install Git 2.11 or greater:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
sudo apt update
|
||||
sudo apt -y install software-properties-common
|
||||
@@ -287,7 +292,7 @@ We recommend adding the ``git-core`` ppa to install Git 2.11 or greater:
|
||||
Now, to install non-native version of python on non-LTS versions of Ubuntu, we recommend
|
||||
installing pyenv. To do this, first run the following commands:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
sudo apt -y install make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev libgdbm-dev uuid-dev python3-openssl git openjdk-11-jre-headless nano
|
||||
CXX=/usr/bin/g++
|
||||
@@ -311,7 +316,7 @@ On distributions where Python 3.8 needs to be compiled from source, we recommend
|
||||
This simplifies the compilation process and has the added bonus of simplifying setting up Red in a
|
||||
virtual environment.
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
command -v pyenv && pyenv update || curl https://pyenv.run | bash
|
||||
|
||||
@@ -320,9 +325,9 @@ instructions given to fix that, then close and reopen your shell.**
|
||||
|
||||
Then run the following command:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
CONFIGURE_OPTS=--enable-optimizations pyenv install 3.8.8 -v
|
||||
CONFIGURE_OPTS=--enable-optimizations pyenv install 3.8.9 -v
|
||||
|
||||
This may take a long time to complete, depending on your hardware. For some machines (such as
|
||||
Raspberry Pis and micro-tier VPSes), it may take over an hour; in this case, you may wish to remove
|
||||
@@ -332,9 +337,9 @@ slower.
|
||||
|
||||
After that is finished, run:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
|
||||
pyenv global 3.8.8
|
||||
pyenv global 3.8.9
|
||||
|
||||
Pyenv is now installed and your system should be configured to run Python 3.8.
|
||||
|
||||
@@ -372,11 +377,15 @@ First, choose a directory where you would like to create your virtual environmen
|
||||
to keep it in a location which is easy to type out the path to. From now, we'll call it
|
||||
``redenv`` and it will be located in your home directory.
|
||||
|
||||
Create your virtual environment with the following command::
|
||||
Create your virtual environment with the following command:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
python3.8 -m venv ~/redenv
|
||||
|
||||
And activate it with the following command::
|
||||
And activate it with the following command:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
source ~/redenv/bin/activate
|
||||
|
||||
@@ -398,18 +407,24 @@ Using ``pyenv virtualenv``
|
||||
Using ``pyenv virtualenv`` saves you the headache of remembering where you installed your virtual
|
||||
environments. This option is only available if you installed Python with pyenv.
|
||||
|
||||
First, ensure your pyenv interpreter is set to python 3.8.1 or greater with the following command::
|
||||
First, ensure your pyenv interpreter is set to python 3.8.1 or greater with the following command:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
pyenv version
|
||||
|
||||
Now, create a virtual environment with the following command::
|
||||
Now, create a virtual environment with the following command:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
pyenv virtualenv <name>
|
||||
|
||||
Replace ``<name>`` with whatever you like. If you ever forget what you named it,
|
||||
you can always use the command ``pyenv versions`` to list all virtual environments.
|
||||
|
||||
Now activate your virtualenv with the following command::
|
||||
Now activate your virtualenv with the following command:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
pyenv shell <name>
|
||||
|
||||
@@ -433,14 +448,16 @@ Choose one of the following commands to install Red.
|
||||
|
||||
To install without additional config backend support:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
:prompts: (redenv) $
|
||||
|
||||
python -m pip install -U pip setuptools wheel
|
||||
python -m pip install -U Red-DiscordBot
|
||||
|
||||
Or, to install with PostgreSQL support:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
:prompts: (redenv) $
|
||||
|
||||
python -m pip install -U pip setuptools wheel
|
||||
python -m pip install -U "Red-DiscordBot[postgres]"
|
||||
@@ -456,7 +473,8 @@ Setting Up and Running Red
|
||||
|
||||
After installation, set up your instance with the following command:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
:prompts: (redenv) $
|
||||
|
||||
redbot-setup
|
||||
|
||||
@@ -466,7 +484,8 @@ running the bot).
|
||||
|
||||
Once done setting up the instance, run the following command to run Red:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: bash
|
||||
:prompts: (redenv) $
|
||||
|
||||
redbot <your instance name>
|
||||
|
||||
|
||||
@@ -33,18 +33,18 @@ right-click on it and then click "Run as administrator".
|
||||
|
||||
Then run each of the following commands:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: powershell
|
||||
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
|
||||
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
||||
choco upgrade git --params "/GitOnlyOnPath /WindowsTerminal" -y
|
||||
choco upgrade visualstudio2019-workload-vctools -y
|
||||
choco upgrade python3 -y --version 3.8.8
|
||||
choco upgrade python3 -y --version 3.8.9
|
||||
|
||||
For Audio support, you should also run the following command before exiting:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: powershell
|
||||
|
||||
choco upgrade adoptopenjdk11jre -y
|
||||
|
||||
@@ -109,13 +109,13 @@ Start with opening a command prompt (open Start, search for "command prompt", th
|
||||
|
||||
Then create your virtual environment with the following command
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: batch
|
||||
|
||||
py -3.8 -m venv "%userprofile%\redenv"
|
||||
|
||||
And activate it with the following command
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: batch
|
||||
|
||||
"%userprofile%\redenv\Scripts\activate.bat"
|
||||
|
||||
@@ -138,14 +138,16 @@ Run **one** of the following set of commands, depending on what extras you want
|
||||
|
||||
* Normal installation:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: batch
|
||||
:prompts: (redenv) C:\\>
|
||||
|
||||
python -m pip install -U pip setuptools wheel
|
||||
python -m pip install -U Red-DiscordBot
|
||||
|
||||
* With PostgreSQL support:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: batch
|
||||
:prompts: (redenv) C:\\>
|
||||
|
||||
python -m pip install -U pip setuptools wheel
|
||||
python -m pip install -U Red-DiscordBot[postgres]
|
||||
@@ -156,7 +158,8 @@ Setting Up and Running Red
|
||||
|
||||
After installation, set up your instance with the following command:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: batch
|
||||
:prompts: (redenv) C:\\>
|
||||
|
||||
redbot-setup
|
||||
|
||||
@@ -166,7 +169,8 @@ running the bot).
|
||||
|
||||
Once done setting up the instance, run the following command to run Red:
|
||||
|
||||
.. code-block:: none
|
||||
.. prompt:: batch
|
||||
:prompts: (redenv) C:\\>
|
||||
|
||||
redbot <your instance name>
|
||||
|
||||
|
||||
@@ -37,13 +37,14 @@ If you have Red 3.2.0 or newer, you can upgrade by following these 4 easy steps:
|
||||
|
||||
2. Activate your venv with the following command:
|
||||
|
||||
.. code:: none
|
||||
.. prompt:: batch
|
||||
|
||||
"%userprofile%\redenv\Scripts\activate.bat"
|
||||
|
||||
3. Update Red with this command:
|
||||
|
||||
.. code:: none
|
||||
.. prompt:: batch
|
||||
:prompts: (redenv) C:\\>
|
||||
|
||||
python -m pip install -U Red-DiscordBot
|
||||
|
||||
@@ -53,6 +54,8 @@ If you have Red 3.2.0 or newer, you can upgrade by following these 4 easy steps:
|
||||
|
||||
4. Start your bot.
|
||||
|
||||
5. If you have any 3rd-party cogs installed, we highly recommend you update them with this command in Discord: ``[p]cog update`` (``[p]`` is considered as your prefix)
|
||||
|
||||
Linux & Mac
|
||||
-----------
|
||||
|
||||
@@ -64,19 +67,20 @@ If you have Red 3.2.0 or newer, you can upgrade by following these 4 easy steps:
|
||||
|
||||
If you used ``venv`` for your virtual environment, use:
|
||||
|
||||
.. code:: none
|
||||
.. prompt:: bash
|
||||
|
||||
source ~/redenv/bin/activate
|
||||
|
||||
If you used ``pyenv`` for your virtual environment, use:
|
||||
|
||||
.. code:: none
|
||||
.. prompt:: bash
|
||||
|
||||
pyenv shell <name>
|
||||
|
||||
3. Update Red with this command:
|
||||
|
||||
.. code:: none
|
||||
.. prompt:: bash
|
||||
:prompts: (redenv) $
|
||||
|
||||
python -m pip install -U Red-DiscordBot
|
||||
|
||||
@@ -86,6 +90,8 @@ If you have Red 3.2.0 or newer, you can upgrade by following these 4 easy steps:
|
||||
|
||||
4. Start your bot.
|
||||
|
||||
5. If you have any 3rd-party cogs installed, we highly recommend you update them with this command in Discord: ``[p]cog update`` (``[p]`` is considered as your prefix)
|
||||
|
||||
Red 3.1.X
|
||||
*********
|
||||
|
||||
@@ -107,7 +113,8 @@ Follow every step to ensure you have all dependencies up-to-date and only skip `
|
||||
- If you were using the MongoDB driver, **prior to launching your instance after update**,
|
||||
you will need to run the following commands to convert:
|
||||
|
||||
.. code::
|
||||
.. prompt:: bash
|
||||
:prompts: (redenv) $
|
||||
|
||||
python -m pip install dnspython~=1.16.0 motor~=2.0.0 pymongo~=3.8.0
|
||||
redbot-setup convert [instancename] json
|
||||
@@ -125,7 +132,8 @@ Red 3.0.2 and older
|
||||
- If you were using the MongoDB driver, **prior to updating**, you will need to convert your data to JSON backend,
|
||||
using following command:
|
||||
|
||||
.. code::
|
||||
.. prompt:: bash
|
||||
:prompts: (redenv) $
|
||||
|
||||
redbot-setup --edit
|
||||
|
||||
|
||||
Reference in New Issue
Block a user