Compare commits
83 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 974aa71759 | |||
| c1372806e8 | |||
| 35ed817203 | |||
| 5e431b52bf | |||
| 0827fb0c33 | |||
| b5f240fdb8 | |||
| 970c3a5ef0 | |||
| ef05727477 | |||
| e207f09f40 | |||
| c36db5dad1 | |||
| d06345dbe2 | |||
| 1763c76d69 | |||
| 45e5886282 | |||
| d593c9d625 | |||
| 0862681078 | |||
| 7cef720350 | |||
| eb1b997fa6 | |||
| 2342016314 | |||
| d654bd9538 | |||
| dd223a1a1d | |||
| 44508e1492 | |||
| 15932f3e51 | |||
| 7be20e127b | |||
| 9ce74b6ec8 | |||
| c0f24ae663 | |||
| b8e7e97efe | |||
| a48d4e9374 | |||
| c3f7c8936e | |||
| c1d73c3038 | |||
| f4fd244554 | |||
| 76068f2393 | |||
| 9943d8472b | |||
| a4c001dd39 | |||
| c45acb65ca | |||
| e73e1f38d2 | |||
| aaae7fbfe0 | |||
| 2a073bbd50 | |||
| 33f5114666 | |||
| f494bac4d9 | |||
| 9830e1d8c3 | |||
| 1dc8f937f5 | |||
| 95313ae446 | |||
| 706b4e63a2 | |||
| 1162df4157 | |||
| 797ac6d76a | |||
| b6447e68ec | |||
| 96fb81581e | |||
| d86adc4509 | |||
| 15e727ef4c | |||
| 4bce1994d0 | |||
| a3482f939a | |||
| 8cd50a1cbb | |||
| 761bd7eb2c | |||
| 2e78a3f829 | |||
| 03332be3aa | |||
| 385ee1b409 | |||
| e293d0546c | |||
| be4ccc4bfc | |||
| cc8b4b0585 | |||
| e1c4edba9f | |||
| 7a82c9ec68 | |||
| c722c9e117 | |||
| cd597b1665 | |||
| 47e9c657b2 | |||
| 0ac2a02968 | |||
| 2d312292ea | |||
| 9eafd44ec8 | |||
| fbea3e91dd | |||
| a6193e1f37 | |||
| 1e8b9ab681 | |||
| cf5e07851b | |||
| bb96050eaf | |||
| a871267b11 | |||
| d5eb0a9db1 | |||
| 6f6963b1af | |||
| 6e3fa6b73f | |||
| 01a69d2ebc | |||
| 71eade46f8 | |||
| cb2451c04e | |||
| 179feb155f | |||
| 94b98c2535 | |||
| 18061321cb | |||
| 4d6930c3a7 |
@@ -1,396 +0,0 @@
|
||||
|
||||
### Bandit config file generated
|
||||
|
||||
### This config may optionally select a subset of tests to run or skip by
|
||||
### filling out the 'tests' and 'skips' lists given below. If no tests are
|
||||
### specified for inclusion then it is assumed all tests are desired. The skips
|
||||
### set will remove specific tests from the include set. This can be controlled
|
||||
### using the -t/-s CLI options. Note that the same test ID should not appear
|
||||
### in both 'tests' and 'skips', this would be nonsensical and is detected by
|
||||
### Bandit at runtime.
|
||||
|
||||
# Available tests:
|
||||
# B101 : assert_used
|
||||
# B102 : exec_used
|
||||
# B103 : set_bad_file_permissions
|
||||
# B104 : hardcoded_bind_all_interfaces
|
||||
# B105 : hardcoded_password_string
|
||||
# B106 : hardcoded_password_funcarg
|
||||
# B107 : hardcoded_password_default
|
||||
# B108 : hardcoded_tmp_directory
|
||||
# B110 : try_except_pass
|
||||
# B112 : try_except_continue
|
||||
# B201 : flask_debug_true
|
||||
# B301 : pickle
|
||||
# B302 : marshal
|
||||
# B303 : md5
|
||||
# B304 : ciphers
|
||||
# B305 : cipher_modes
|
||||
# B306 : mktemp_q
|
||||
# B307 : eval
|
||||
# B308 : mark_safe
|
||||
# B309 : httpsconnection
|
||||
# B310 : urllib_urlopen
|
||||
# B311 : random
|
||||
# B312 : telnetlib
|
||||
# B313 : xml_bad_cElementTree
|
||||
# B314 : xml_bad_ElementTree
|
||||
# B315 : xml_bad_expatreader
|
||||
# B316 : xml_bad_expatbuilder
|
||||
# B317 : xml_bad_sax
|
||||
# B318 : xml_bad_minidom
|
||||
# B319 : xml_bad_pulldom
|
||||
# B320 : xml_bad_etree
|
||||
# B321 : ftplib
|
||||
# B322 : input
|
||||
# B323 : unverified_context
|
||||
# B324 : hashlib_new_insecure_functions
|
||||
# B325 : tempnam
|
||||
# B401 : import_telnetlib
|
||||
# B402 : import_ftplib
|
||||
# B403 : import_pickle
|
||||
# B404 : import_subprocess
|
||||
# B405 : import_xml_etree
|
||||
# B406 : import_xml_sax
|
||||
# B407 : import_xml_expat
|
||||
# B408 : import_xml_minidom
|
||||
# B409 : import_xml_pulldom
|
||||
# B410 : import_lxml
|
||||
# B411 : import_xmlrpclib
|
||||
# B412 : import_httpoxy
|
||||
# B413 : import_pycrypto
|
||||
# B501 : request_with_no_cert_validation
|
||||
# B502 : ssl_with_bad_version
|
||||
# B503 : ssl_with_bad_defaults
|
||||
# B504 : ssl_with_no_version
|
||||
# B505 : weak_cryptographic_key
|
||||
# B506 : yaml_load
|
||||
# B507 : ssh_no_host_key_verification
|
||||
# B601 : paramiko_calls
|
||||
# B602 : subprocess_popen_with_shell_equals_true
|
||||
# B603 : subprocess_without_shell_equals_true
|
||||
# B604 : any_other_function_with_shell_equals_true
|
||||
# B605 : start_process_with_a_shell
|
||||
# B606 : start_process_with_no_shell
|
||||
# B607 : start_process_with_partial_path
|
||||
# B608 : hardcoded_sql_expressions
|
||||
# B609 : linux_commands_wildcard_injection
|
||||
# B610 : django_extra_used
|
||||
# B611 : django_rawsql_used
|
||||
# B701 : jinja2_autoescape_false
|
||||
# B702 : use_of_mako_templates
|
||||
# B703 : django_mark_safe
|
||||
|
||||
# (optional) list included test IDs here, eg '[B101, B406]':
|
||||
tests:
|
||||
|
||||
# (optional) list skipped test IDs here, eg '[B101, B406]':
|
||||
skips: ['B322']
|
||||
|
||||
### (optional) plugin settings - some test plugins require configuration data
|
||||
### that may be given here, per-plugin. All bandit test plugins have a built in
|
||||
### set of sensible defaults and these will be used if no configuration is
|
||||
### provided. It is not necessary to provide settings for every (or any) plugin
|
||||
### if the defaults are acceptable.
|
||||
|
||||
any_other_function_with_shell_equals_true:
|
||||
no_shell:
|
||||
- os.execl
|
||||
- os.execle
|
||||
- os.execlp
|
||||
- os.execlpe
|
||||
- os.execv
|
||||
- os.execve
|
||||
- os.execvp
|
||||
- os.execvpe
|
||||
- os.spawnl
|
||||
- os.spawnle
|
||||
- os.spawnlp
|
||||
- os.spawnlpe
|
||||
- os.spawnv
|
||||
- os.spawnve
|
||||
- os.spawnvp
|
||||
- os.spawnvpe
|
||||
- os.startfile
|
||||
shell:
|
||||
- os.system
|
||||
- os.popen
|
||||
- os.popen2
|
||||
- os.popen3
|
||||
- os.popen4
|
||||
- popen2.popen2
|
||||
- popen2.popen3
|
||||
- popen2.popen4
|
||||
- popen2.Popen3
|
||||
- popen2.Popen4
|
||||
- commands.getoutput
|
||||
- commands.getstatusoutput
|
||||
subprocess:
|
||||
- subprocess.Popen
|
||||
- subprocess.call
|
||||
- subprocess.check_call
|
||||
- subprocess.check_output
|
||||
- subprocess.run
|
||||
hardcoded_tmp_directory:
|
||||
tmp_dirs:
|
||||
- /tmp
|
||||
- /var/tmp
|
||||
- /dev/shm
|
||||
linux_commands_wildcard_injection:
|
||||
no_shell:
|
||||
- os.execl
|
||||
- os.execle
|
||||
- os.execlp
|
||||
- os.execlpe
|
||||
- os.execv
|
||||
- os.execve
|
||||
- os.execvp
|
||||
- os.execvpe
|
||||
- os.spawnl
|
||||
- os.spawnle
|
||||
- os.spawnlp
|
||||
- os.spawnlpe
|
||||
- os.spawnv
|
||||
- os.spawnve
|
||||
- os.spawnvp
|
||||
- os.spawnvpe
|
||||
- os.startfile
|
||||
shell:
|
||||
- os.system
|
||||
- os.popen
|
||||
- os.popen2
|
||||
- os.popen3
|
||||
- os.popen4
|
||||
- popen2.popen2
|
||||
- popen2.popen3
|
||||
- popen2.popen4
|
||||
- popen2.Popen3
|
||||
- popen2.Popen4
|
||||
- commands.getoutput
|
||||
- commands.getstatusoutput
|
||||
subprocess:
|
||||
- subprocess.Popen
|
||||
- subprocess.call
|
||||
- subprocess.check_call
|
||||
- subprocess.check_output
|
||||
- subprocess.run
|
||||
ssl_with_bad_defaults:
|
||||
bad_protocol_versions:
|
||||
- PROTOCOL_SSLv2
|
||||
- SSLv2_METHOD
|
||||
- SSLv23_METHOD
|
||||
- PROTOCOL_SSLv3
|
||||
- PROTOCOL_TLSv1
|
||||
- SSLv3_METHOD
|
||||
- TLSv1_METHOD
|
||||
ssl_with_bad_version:
|
||||
bad_protocol_versions:
|
||||
- PROTOCOL_SSLv2
|
||||
- SSLv2_METHOD
|
||||
- SSLv23_METHOD
|
||||
- PROTOCOL_SSLv3
|
||||
- PROTOCOL_TLSv1
|
||||
- SSLv3_METHOD
|
||||
- TLSv1_METHOD
|
||||
start_process_with_a_shell:
|
||||
no_shell:
|
||||
- os.execl
|
||||
- os.execle
|
||||
- os.execlp
|
||||
- os.execlpe
|
||||
- os.execv
|
||||
- os.execve
|
||||
- os.execvp
|
||||
- os.execvpe
|
||||
- os.spawnl
|
||||
- os.spawnle
|
||||
- os.spawnlp
|
||||
- os.spawnlpe
|
||||
- os.spawnv
|
||||
- os.spawnve
|
||||
- os.spawnvp
|
||||
- os.spawnvpe
|
||||
- os.startfile
|
||||
shell:
|
||||
- os.system
|
||||
- os.popen
|
||||
- os.popen2
|
||||
- os.popen3
|
||||
- os.popen4
|
||||
- popen2.popen2
|
||||
- popen2.popen3
|
||||
- popen2.popen4
|
||||
- popen2.Popen3
|
||||
- popen2.Popen4
|
||||
- commands.getoutput
|
||||
- commands.getstatusoutput
|
||||
subprocess:
|
||||
- subprocess.Popen
|
||||
- subprocess.call
|
||||
- subprocess.check_call
|
||||
- subprocess.check_output
|
||||
- subprocess.run
|
||||
start_process_with_no_shell:
|
||||
no_shell:
|
||||
- os.execl
|
||||
- os.execle
|
||||
- os.execlp
|
||||
- os.execlpe
|
||||
- os.execv
|
||||
- os.execve
|
||||
- os.execvp
|
||||
- os.execvpe
|
||||
- os.spawnl
|
||||
- os.spawnle
|
||||
- os.spawnlp
|
||||
- os.spawnlpe
|
||||
- os.spawnv
|
||||
- os.spawnve
|
||||
- os.spawnvp
|
||||
- os.spawnvpe
|
||||
- os.startfile
|
||||
shell:
|
||||
- os.system
|
||||
- os.popen
|
||||
- os.popen2
|
||||
- os.popen3
|
||||
- os.popen4
|
||||
- popen2.popen2
|
||||
- popen2.popen3
|
||||
- popen2.popen4
|
||||
- popen2.Popen3
|
||||
- popen2.Popen4
|
||||
- commands.getoutput
|
||||
- commands.getstatusoutput
|
||||
subprocess:
|
||||
- subprocess.Popen
|
||||
- subprocess.call
|
||||
- subprocess.check_call
|
||||
- subprocess.check_output
|
||||
- subprocess.run
|
||||
start_process_with_partial_path:
|
||||
no_shell:
|
||||
- os.execl
|
||||
- os.execle
|
||||
- os.execlp
|
||||
- os.execlpe
|
||||
- os.execv
|
||||
- os.execve
|
||||
- os.execvp
|
||||
- os.execvpe
|
||||
- os.spawnl
|
||||
- os.spawnle
|
||||
- os.spawnlp
|
||||
- os.spawnlpe
|
||||
- os.spawnv
|
||||
- os.spawnve
|
||||
- os.spawnvp
|
||||
- os.spawnvpe
|
||||
- os.startfile
|
||||
shell:
|
||||
- os.system
|
||||
- os.popen
|
||||
- os.popen2
|
||||
- os.popen3
|
||||
- os.popen4
|
||||
- popen2.popen2
|
||||
- popen2.popen3
|
||||
- popen2.popen4
|
||||
- popen2.Popen3
|
||||
- popen2.Popen4
|
||||
- commands.getoutput
|
||||
- commands.getstatusoutput
|
||||
subprocess:
|
||||
- subprocess.Popen
|
||||
- subprocess.call
|
||||
- subprocess.check_call
|
||||
- subprocess.check_output
|
||||
- subprocess.run
|
||||
subprocess_popen_with_shell_equals_true:
|
||||
no_shell:
|
||||
- os.execl
|
||||
- os.execle
|
||||
- os.execlp
|
||||
- os.execlpe
|
||||
- os.execv
|
||||
- os.execve
|
||||
- os.execvp
|
||||
- os.execvpe
|
||||
- os.spawnl
|
||||
- os.spawnle
|
||||
- os.spawnlp
|
||||
- os.spawnlpe
|
||||
- os.spawnv
|
||||
- os.spawnve
|
||||
- os.spawnvp
|
||||
- os.spawnvpe
|
||||
- os.startfile
|
||||
shell:
|
||||
- os.system
|
||||
- os.popen
|
||||
- os.popen2
|
||||
- os.popen3
|
||||
- os.popen4
|
||||
- popen2.popen2
|
||||
- popen2.popen3
|
||||
- popen2.popen4
|
||||
- popen2.Popen3
|
||||
- popen2.Popen4
|
||||
- commands.getoutput
|
||||
- commands.getstatusoutput
|
||||
subprocess:
|
||||
- subprocess.Popen
|
||||
- subprocess.call
|
||||
- subprocess.check_call
|
||||
- subprocess.check_output
|
||||
- subprocess.run
|
||||
subprocess_without_shell_equals_true:
|
||||
no_shell:
|
||||
- os.execl
|
||||
- os.execle
|
||||
- os.execlp
|
||||
- os.execlpe
|
||||
- os.execv
|
||||
- os.execve
|
||||
- os.execvp
|
||||
- os.execvpe
|
||||
- os.spawnl
|
||||
- os.spawnle
|
||||
- os.spawnlp
|
||||
- os.spawnlpe
|
||||
- os.spawnv
|
||||
- os.spawnve
|
||||
- os.spawnvp
|
||||
- os.spawnvpe
|
||||
- os.startfile
|
||||
shell:
|
||||
- os.system
|
||||
- os.popen
|
||||
- os.popen2
|
||||
- os.popen3
|
||||
- os.popen4
|
||||
- popen2.popen2
|
||||
- popen2.popen3
|
||||
- popen2.popen4
|
||||
- popen2.Popen3
|
||||
- popen2.Popen4
|
||||
- commands.getoutput
|
||||
- commands.getstatusoutput
|
||||
subprocess:
|
||||
- subprocess.Popen
|
||||
- subprocess.call
|
||||
- subprocess.check_call
|
||||
- subprocess.check_output
|
||||
- subprocess.run
|
||||
try_except_continue:
|
||||
check_typed_exception: false
|
||||
try_except_pass:
|
||||
check_typed_exception: false
|
||||
weak_cryptographic_key:
|
||||
weak_key_size_dsa_high: 1024
|
||||
weak_key_size_dsa_medium: 2048
|
||||
weak_key_size_ec_high: 160
|
||||
weak_key_size_ec_medium: 224
|
||||
weak_key_size_rsa_high: 1024
|
||||
weak_key_size_rsa_medium: 2048
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
version: "2" # required to adjust maintainability checks
|
||||
checks:
|
||||
argument-count:
|
||||
config:
|
||||
threshold: 8 # work on this later
|
||||
complex-logic:
|
||||
enabled: false # Disabled in favor of using Radon for this
|
||||
config:
|
||||
threshold: 4
|
||||
file-lines:
|
||||
enabled: false # enable after audio stuff...
|
||||
config:
|
||||
threshold: 2000 # I would set this lower if not for cogs as command containers.
|
||||
method-complexity:
|
||||
enabled: false # Disabled in favor of using Radon for this
|
||||
config:
|
||||
threshold: 5
|
||||
method-count:
|
||||
enabled: false # I would set this lower if not for cogs as command containers.
|
||||
config:
|
||||
threshold: 20
|
||||
method-lines:
|
||||
enabled: false
|
||||
config:
|
||||
threshold: 25 # I'm fine with long methods, cautious about the complexity of a single method.
|
||||
nested-control-flow:
|
||||
config:
|
||||
threshold: 6
|
||||
return-statements:
|
||||
config:
|
||||
threshold: 6
|
||||
similar-code:
|
||||
enabled: false
|
||||
config:
|
||||
threshold: # language-specific defaults. an override will affect all languages.
|
||||
identical-code:
|
||||
enabled: false
|
||||
config:
|
||||
threshold: # language-specific defaults. an override will affect all languages.
|
||||
plugins:
|
||||
bandit:
|
||||
enabled: false
|
||||
radon:
|
||||
enabled: false
|
||||
config:
|
||||
threshold: "D"
|
||||
duplication:
|
||||
enabled: false
|
||||
config:
|
||||
languages:
|
||||
python:
|
||||
python_version: 3
|
||||
@@ -1,4 +1,17 @@
|
||||
* text eol=lf
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# binary file excludsions
|
||||
*.png binary
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
# Cogs
|
||||
/redbot/cogs/audio/** @aikaterna @Drapersniper
|
||||
/redbot/cogs/downloader/* @jack1142
|
||||
/redbot/cogs/streams/* @palmtree5
|
||||
/redbot/cogs/mutes/* @TrustyJAID
|
||||
|
||||
# Trivia Lists
|
||||
/redbot/cogs/trivia/data/lists/whosthatpokemon*.yaml @aikaterna
|
||||
|
||||
# Tests
|
||||
/redbot/pytest/downloader* @jack1142
|
||||
/tests/cogs/downloader/* @jack1142
|
||||
|
||||
# Schemas
|
||||
/schema/* @jack1142
|
||||
|
||||
# CI
|
||||
/.travis.yml @Kowlin
|
||||
/crowdin.yml @Kowlin
|
||||
/.github/workflows/* @Kowlin
|
||||
|
||||
# Excludes
|
||||
**/locales/* @ghost
|
||||
@@ -1,3 +0,0 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
patreon: Red_Devs
|
||||
@@ -1,5 +0,0 @@
|
||||
<!--
|
||||
Please be sure to use the correct template,
|
||||
if your report doesn't have the correct template please open an issue describing your issue in detail
|
||||
For support regarding the bot itself please visit the discord server over at https://discord.gg/red
|
||||
-->
|
||||
@@ -1,20 +0,0 @@
|
||||
Please be sure to read through other issues as well to make sure what you are suggesting/reporting has not already
|
||||
been suggested/reported
|
||||
|
||||
### Type:
|
||||
|
||||
- [ ] Suggestion
|
||||
- [ ] Bug
|
||||
|
||||
### Brief description of the problem
|
||||
|
||||
### Expected behavior
|
||||
|
||||
### Actual behavior
|
||||
|
||||
### Steps to reproduce
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
4.
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
name: Bug reports for commands
|
||||
about: For bugs that involve commands found within Red
|
||||
title: ''
|
||||
labels: 'Type: Bug'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# Command bugs
|
||||
|
||||
<!--
|
||||
Did you find a bug with a command? Fill out the following:
|
||||
-->
|
||||
|
||||
#### Command name
|
||||
|
||||
<!-- Replace this line with the name of the command -->
|
||||
|
||||
#### What cog is this command from?
|
||||
|
||||
<!-- Replace this line with the name of the cog -->
|
||||
|
||||
#### What were you expecting to happen?
|
||||
|
||||
<!-- Replace this line with a description of what you were expecting to happen -->
|
||||
|
||||
#### What actually happened?
|
||||
|
||||
<!-- Replace this line with a description of what actually happened. Include any error messages -->
|
||||
|
||||
#### How can we reproduce this issue?
|
||||
|
||||
<!-- Replace with numbered steps to reproduce the issue -->
|
||||
@@ -1,5 +0,0 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Support question
|
||||
url: https://discord.gg/red
|
||||
about: For any questions regarding on how to operate and run Red.
|
||||
@@ -1,44 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: For feature requests regarding Red itself.
|
||||
title: ''
|
||||
labels: 'Type: Feature'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# Feature request
|
||||
|
||||
<!-- This template is for feature requests. Please fill out the following: -->
|
||||
|
||||
|
||||
#### Select the type of feature you are requesting:
|
||||
|
||||
<!-- To check a box, replace the space between the [] with a x -->
|
||||
|
||||
- [ ] Cog
|
||||
- [ ] Command
|
||||
- [ ] API functionality
|
||||
|
||||
#### Describe your requested feature
|
||||
|
||||
<!--
|
||||
Feel free to describe in as much detail as you wish.
|
||||
|
||||
If you are requesting a cog to be included in core:
|
||||
- Describe the functionality in as much detail as possible
|
||||
- Include the command structure, if possible
|
||||
- Please note that unless it's something that should be core functionality,
|
||||
we reserve the right to reject your suggestion and point you to our cog
|
||||
board to request it for a third-party cog
|
||||
|
||||
If you are requesting a command:
|
||||
- Include what cog it should be in and a name for the command
|
||||
- Describe the intended functionality for the command
|
||||
- Note any restrictions on who can use the command or where it can be used
|
||||
|
||||
If you are requesting API functionality:
|
||||
- Describe what it should do
|
||||
- Note whether it is to extend existing functionality or introduce new functionality
|
||||
|
||||
-->
|
||||
@@ -1,30 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: For bugs that don't involve a command.
|
||||
title: ''
|
||||
labels: 'Type: Bug'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# Other bugs
|
||||
|
||||
<!--
|
||||
Did you find a bug with something other than a command? Fill out the following:
|
||||
-->
|
||||
|
||||
#### What were you trying to do?
|
||||
|
||||
<!-- Replace this line with a description of what you were trying to do -->
|
||||
|
||||
#### What were you expecting to happen?
|
||||
|
||||
<!-- Replace this line with a description of what you were expecting to happen -->
|
||||
|
||||
#### What actually happened?
|
||||
|
||||
<!-- Replace this line with a description of what actually happened. Include any error messages -->
|
||||
|
||||
#### How can we reproduce this issue?
|
||||
|
||||
<!-- Replace with numbered steps to reproduce the issue -->
|
||||
@@ -1,7 +0,0 @@
|
||||
### Type
|
||||
|
||||
- [ ] Bugfix
|
||||
- [ ] Enhancement
|
||||
- [ ] New feature
|
||||
|
||||
### Description of the changes
|
||||
@@ -1,7 +0,0 @@
|
||||
### Type
|
||||
|
||||
- [ ] Bugfix
|
||||
- [ ] Enhancement
|
||||
- [ ] New feature
|
||||
|
||||
### Description of the changes
|
||||
@@ -1,15 +0,0 @@
|
||||
# Bugfix request
|
||||
|
||||
<!--
|
||||
THIS TEMPLATE IS CURRENTLY UNUSED DUE TO GITHUB LIMITATIONS!
|
||||
To be used for pull requests that fix a bug
|
||||
-->
|
||||
|
||||
#### Describe the bug being fixed
|
||||
|
||||
<!--
|
||||
If an issue exists for the bug, mention
|
||||
that this PR fixes that issue
|
||||
-->
|
||||
|
||||
#### Anything we need to know about this fix?
|
||||
@@ -1,21 +0,0 @@
|
||||
# Enhancement request
|
||||
|
||||
<!--
|
||||
THIS TEMPLATE IS CURRENTLY UNUSED DUE TO GITHUB LIMITATIONS!
|
||||
To be used for PRs which enhance existing features
|
||||
-->
|
||||
|
||||
#### Describe the enhancement
|
||||
|
||||
<!--
|
||||
Describe what your changes do.
|
||||
If adding commands, describe any restrictions on their usage.
|
||||
- For example, who can use the command? Where can it be used?
|
||||
-->
|
||||
|
||||
#### Does this enhancement break existing functionality?
|
||||
|
||||
<!-- To check a box, replace the space between the [] with a x -->
|
||||
|
||||
- [ ] Yes
|
||||
- [ ] No
|
||||
@@ -1,22 +0,0 @@
|
||||
# New feature addition
|
||||
|
||||
<!--
|
||||
THIS TEMPLATE IS CURRENTLY UNUSED DUE TO GITHUB LIMITATIONS!
|
||||
To be used for PRs which add a new feature
|
||||
Examples of this include new APIs, new core cogs, etc.
|
||||
-->
|
||||
|
||||
#### What type of feature is this?
|
||||
|
||||
<!-- To check a box, replace the space between the [] with a x -->
|
||||
|
||||
- [ ] New core cog
|
||||
- [ ] New API
|
||||
- [ ] Other
|
||||
|
||||
#### Describe the feature
|
||||
|
||||
<!--
|
||||
If you are adding a cog, describe its commands in detail (functionality, usage restrictions, etc).
|
||||
If the new feature introduces new requirements, please try to explain why they are necessary.
|
||||
-->
|
||||
@@ -1,16 +0,0 @@
|
||||
# New release
|
||||
|
||||
<!--
|
||||
THIS TEMPLATE IS CURRENTLY UNUSED DUE TO GITHUB LIMITATIONS!
|
||||
To be used by collaborators for doing releases.
|
||||
Most contributors will not need to use this.
|
||||
-->
|
||||
|
||||
#### Version
|
||||
|
||||
|
||||
|
||||
#### Has a draft release been created for this?
|
||||
|
||||
- [ ] Yes
|
||||
- [ ] No
|
||||
@@ -1,6 +0,0 @@
|
||||
# Translations update
|
||||
|
||||
<!--
|
||||
THIS TEMPLATE IS CURRENTLY UNUSED DUE TO GITHUB LIMITATIONS!
|
||||
Used for PRs updating translations from Crowdin
|
||||
-->
|
||||
@@ -1,26 +0,0 @@
|
||||
name: Auto Labeler
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Apply Triage Label
|
||||
uses: actions/github-script@v3
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
const is_status_label = (label) => label.name.startsWith('Status: ');
|
||||
if (context.payload.issue.labels.some(is_status_label)) {
|
||||
console.log('Issue already has Status label, skipping...');
|
||||
return;
|
||||
}
|
||||
github.issues.addLabels({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
labels: ['Status: Needs Triage']
|
||||
});
|
||||
@@ -1,52 +0,0 @@
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [V3/develop]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
schedule:
|
||||
- cron: '0 14 * * 4'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
fetch-depth: 2
|
||||
|
||||
# If this run was triggered by a pull request event, then checkout
|
||||
# the head of the pull request instead of the merge commit.
|
||||
- run: git checkout HEAD^2
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: 'python'
|
||||
# Override automatic language detection by changing the below list
|
||||
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
|
||||
# Learn more...
|
||||
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
@@ -1,26 +0,0 @@
|
||||
name: Lint Python
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- dispatched_test
|
||||
|
||||
env:
|
||||
ref: ${{ github.event.client_payload.ref || '' }}
|
||||
|
||||
jobs:
|
||||
lint_python:
|
||||
name: Lint Python
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ env.ref }}
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.8"
|
||||
- run: "python -m pip install git+https://github.com/pycqa/pyflakes@1911c20#egg=pyflakes git+https://github.com/pycqa/pycodestyle@d219c68#egg=pycodestyle git+https://gitlab.com/pycqa/flake8@3.7.9#egg=flake8"
|
||||
name: Install Flake8
|
||||
- run: "python -m flake8 . --count --select=E9,F7,F82 --show-source"
|
||||
name: Flake8 Linting
|
||||
@@ -1,50 +0,0 @@
|
||||
name: Publish to Crowdin
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 12 * * THU'
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types: crowdin
|
||||
|
||||
env:
|
||||
CROWDIN_API_KEY: ${{ secrets.crowdin_token}}
|
||||
CROWDIN_PROJECT_ID: ${{ secrets.crowdin_identifier }}
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
if: github.repository == 'Cog-Creators/Red-DiscordBot'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.8'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
curl https://artifacts.crowdin.com/repo/GPG-KEY-crowdin | sudo apt-key add -
|
||||
echo "deb https://artifacts.crowdin.com/repo/deb/ /" | sudo tee -a /etc/apt/sources.list
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y crowdin
|
||||
pip install redgettext==3.1
|
||||
- name: Generate source files
|
||||
run: |
|
||||
make gettext
|
||||
- name: Upload source files
|
||||
run: |
|
||||
make upload_translations
|
||||
- name: Download translations
|
||||
run: |
|
||||
make download_translations
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v3
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: Automated Crowdin downstream
|
||||
title: "[i18n] Automated Crowdin downstream"
|
||||
body: |
|
||||
This is an automated PR.
|
||||
Please ensure that there are no errors or invalid files are in the PR.
|
||||
labels: "Automated PR, Category: i18n, Changelog Entry: Skipped"
|
||||
branch: "automated/i18n"
|
||||
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
||||
@@ -1,27 +0,0 @@
|
||||
name: Publish to PyPI
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
if: github.repository == 'Cog-Creators/Red-DiscordBot'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.8'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install setuptools wheel twine
|
||||
- name: Build and publish
|
||||
env:
|
||||
TWINE_USERNAME: __token__
|
||||
TWINE_PASSWORD: ${{ secrets.pypi_token }}
|
||||
run: |
|
||||
python setup.py sdist bdist_wheel
|
||||
twine upload dist/*
|
||||
@@ -1,85 +0,0 @@
|
||||
name: Tests
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- dispatched_test
|
||||
|
||||
env:
|
||||
ref: ${{ github.event.client_payload.ref || '' }}
|
||||
|
||||
jobs:
|
||||
tox:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python_version:
|
||||
- "3.8"
|
||||
tox_env:
|
||||
- py
|
||||
- style
|
||||
- docs
|
||||
include:
|
||||
- tox_env: py
|
||||
friendly_name: Tests
|
||||
- tox_env: style
|
||||
friendly_name: Style
|
||||
- tox_env: docs
|
||||
friendly_name: Docs
|
||||
fail-fast: false
|
||||
name: Tox - ${{ matrix.friendly_name }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ env.ref }}
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python_version }}
|
||||
- name: Install tox
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install tox
|
||||
- name: Tox test
|
||||
env:
|
||||
TOXENV: ${{ matrix.tox_env }}
|
||||
run: tox
|
||||
|
||||
tox-postgres:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python_version:
|
||||
- "3.8"
|
||||
fail-fast: false
|
||||
name: Tox - Postgres
|
||||
services:
|
||||
postgresql:
|
||||
image: postgres:10
|
||||
ports:
|
||||
- 5432:5432
|
||||
env:
|
||||
POSTGRES_DB: red_db
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_USER: postgres
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ env.ref }}
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python_version }}
|
||||
- name: Install tox
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install tox
|
||||
- name: Tox test
|
||||
env:
|
||||
TOXENV: postgres
|
||||
PGDATABASE: red_db
|
||||
PGUSER: postgres
|
||||
PGPASSWORD: postgres
|
||||
PGPORT: 5432
|
||||
run: tox
|
||||
@@ -1,143 +1,50 @@
|
||||
*.exe
|
||||
*.dll
|
||||
*.pot
|
||||
.data
|
||||
!/tests/cogs/dataconverter/data/**/*.json
|
||||
Pipfile
|
||||
Pipfile.lock
|
||||
.directory
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
### JetBrains template
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
|
||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
# User-specific stuff:
|
||||
.idea/
|
||||
*.iws
|
||||
.vscode/
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
## Plugin-specific files:
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# IntelliJ
|
||||
out/
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
# =========================
|
||||
# Operating System Files
|
||||
# =========================
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
# OSX
|
||||
# =========================
|
||||
|
||||
# Cursive Clojure plugin
|
||||
.idea/replstate.xml
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
### Python template
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
pip-wheel-metadata/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
.hypothesis/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
target/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# pyenv
|
||||
.python-version
|
||||
|
||||
# celery beat schedule file
|
||||
celerybeat-schedule
|
||||
|
||||
# SageMath parsed files
|
||||
*.sage.py
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# mkdocs documentation
|
||||
/site
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
|
||||
# pytest
|
||||
.pytest_cache/
|
||||
|
||||
# Pre-commit hooks
|
||||
/.pre-commit-config.yaml
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
__pycache__
|
||||
json
|
||||
cache
|
||||
@@ -1,148 +0,0 @@
|
||||
[MASTER]
|
||||
|
||||
# Specify a configuration file.
|
||||
#rcfile=
|
||||
|
||||
# Add files or directories to the blacklist. They should be base names, not
|
||||
# paths.
|
||||
ignore=pytest
|
||||
|
||||
# Pickle collected data for later comparisons.
|
||||
persistent=no
|
||||
|
||||
# List of plugins (as comma separated values of python modules names) to load,
|
||||
# usually to register additional checkers.
|
||||
load-plugins=
|
||||
|
||||
# DO NOT CHANGE THIS VALUE # Use multiple processes to speed up Pylint.
|
||||
jobs=1
|
||||
|
||||
# Allow loading of arbitrary C extensions. Extensions are imported into the
|
||||
# active Python interpreter and may run arbitrary code.
|
||||
unsafe-load-any-extension=no
|
||||
|
||||
# A comma-separated list of package or module names from where C extensions may
|
||||
# be loaded. Extensions are loading into the active Python interpreter and may
|
||||
# run arbitrary code
|
||||
extension-pkg-whitelist=
|
||||
|
||||
# Allow optimization of some AST trees. This will activate a peephole AST
|
||||
# optimizer, which will apply various small optimizations. For instance, it can
|
||||
# be used to obtain the result of joining multiple strings with the addition
|
||||
# operator. Joining a lot of strings can lead to a maximum recursion error in
|
||||
# Pylint and this flag can prevent that. It has one side effect, the resulting
|
||||
# AST will be different than the one from reality.
|
||||
optimize-ast=no
|
||||
|
||||
|
||||
[MESSAGES CONTROL]
|
||||
|
||||
# Only show warnings with the listed confidence levels. Leave empty to show
|
||||
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
|
||||
confidence=
|
||||
|
||||
# Enable the message, report, category or checker with the given id(s). You can
|
||||
# either give multiple identifier separated by comma (,) or put this option
|
||||
# multiple time. See also the "--disable" option for examples.
|
||||
|
||||
|
||||
enable=all
|
||||
|
||||
disable=C, # black is enforcing this for us already, incompatibly
|
||||
W, # unbroaden this to the below specifics later on.
|
||||
W0107, # uneccessary pass is stylisitc in most places
|
||||
W0212, # Should likely refactor around protected access warnings later
|
||||
W1203, # fstrings are too fast to care about enforcing this.
|
||||
W0612, # unused vars can sometimes indicate an issue, but ...
|
||||
W1401, # Should probably fix the reason this is disabled (start up screen)
|
||||
W0511, # Nope, todos are fine for future people to see things to do.
|
||||
W0613, # Too many places where we need to take unused args do to d.py ... also menus
|
||||
W0221, # Overriden converters.
|
||||
W0223, # abstractmethod not defined in mixins is expected
|
||||
I, # ...
|
||||
R # While some of these have merit, It's too large a burden to enable this right now.
|
||||
|
||||
|
||||
[REPORTS]
|
||||
|
||||
output-format=parseable
|
||||
files-output=no
|
||||
reports=no
|
||||
|
||||
|
||||
[LOGGING]
|
||||
|
||||
# Logging modules to check that the string format arguments are in logging
|
||||
# function parameter format
|
||||
logging-modules=logging
|
||||
|
||||
|
||||
[TYPECHECK]
|
||||
|
||||
# Tells whether missing members accessed in mixin class should be ignored. A
|
||||
# mixin class is detected if its name ends with "mixin" (case insensitive).
|
||||
ignore-mixin-members=yes
|
||||
|
||||
# TODO: Write a plyint plugin to allow this with these mixin classes
|
||||
# To use the abstractmethod we know will be defined in the final class.
|
||||
ignored-classes=redbot.cogs.mod.movetocore.MoveToCore,
|
||||
redbot.cogs.mod.kickban.KickBanMixin,
|
||||
redbot.cogs.mod.mutes.MuteMixin,
|
||||
redbot.cogs.mod.names.ModInfo,
|
||||
redbot.cogs.mod.settings.ModSettings,
|
||||
redbot.cogs.mod.events.Events
|
||||
|
||||
ignored-modules=distutils # https://github.com/PyCQA/pylint/issues/73
|
||||
|
||||
|
||||
[VARIABLES]
|
||||
|
||||
# Tells whether we should check for unused import in __init__ files.
|
||||
init-import=no
|
||||
|
||||
# A regular expression matching the name of dummy variables (i.e. expectedly
|
||||
# not used).
|
||||
dummy-variables-rgx=_$|dummy
|
||||
|
||||
|
||||
[SIMILARITIES]
|
||||
|
||||
# Minimum lines number of a similarity.
|
||||
min-similarity-lines=4
|
||||
|
||||
# Ignore comments when computing similarities.
|
||||
ignore-comments=yes
|
||||
|
||||
# Ignore docstrings when computing similarities.
|
||||
ignore-docstrings=yes
|
||||
|
||||
# Ignore imports when computing similarities.
|
||||
ignore-imports=no
|
||||
|
||||
|
||||
[MISCELLANEOUS]
|
||||
|
||||
# List of note tags to take in consideration, separated by a comma.
|
||||
notes=FIXME,XXX,TODO
|
||||
|
||||
|
||||
[CLASSES]
|
||||
|
||||
# List of method names used to declare (i.e. assign) instance attributes.
|
||||
defining-attr-methods=__init__,__new__,__call__
|
||||
|
||||
# List of valid names for the first argument in a class method.
|
||||
valid-classmethod-first-arg=cls
|
||||
|
||||
# List of valid names for the first argument in a metaclass class method.
|
||||
valid-metaclass-classmethod-first-arg=mcs
|
||||
|
||||
# List of member names, which should be excluded from the protected access
|
||||
# warning.
|
||||
exclude-protected=
|
||||
|
||||
[EXCEPTIONS]
|
||||
|
||||
# Exceptions that will emit a warning when being caught. Defaults to
|
||||
# "Exception"
|
||||
overgeneral-exceptions=Exception,discord.DiscordException
|
||||
@@ -1,16 +0,0 @@
|
||||
version: 2
|
||||
|
||||
formats:
|
||||
- pdf
|
||||
|
||||
build:
|
||||
image: latest
|
||||
|
||||
python:
|
||||
version: 3.8
|
||||
install:
|
||||
- requirements: docs/requirements.txt
|
||||
- method: pip
|
||||
path: .
|
||||
extra_requirements:
|
||||
- docs
|
||||
@@ -1,65 +0,0 @@
|
||||
dist: xenial
|
||||
language: python
|
||||
cache: pip
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
python:
|
||||
- 3.8.1
|
||||
env:
|
||||
global:
|
||||
- PIPENV_IGNORE_VIRTUALENVS=1
|
||||
|
||||
install:
|
||||
- pip install --upgrade pip tox
|
||||
|
||||
script:
|
||||
- tox
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- env: TOXENV=py
|
||||
- env: TOXENV=docs
|
||||
- env: TOXENV=style
|
||||
- env: TOXENV=postgres
|
||||
services: postgresql
|
||||
addons:
|
||||
postgresql: "10"
|
||||
before_script:
|
||||
- psql -c 'create database red_db;' -U postgres
|
||||
# These jobs only occur on tag creation if the prior ones succeed
|
||||
- stage: PyPi Deployment
|
||||
if: tag IS present
|
||||
python: 3.8.1
|
||||
env:
|
||||
- DEPLOYING=true
|
||||
- TOXENV=py38
|
||||
deploy:
|
||||
- provider: pypi
|
||||
distributions: sdist bdist_wheel
|
||||
user: Red-DiscordBot
|
||||
password:
|
||||
secure: Ty9vYnd/wCuQkVC/OsS4E2jT9LVDVfzsFrQc4U2hMYcTJnYbl/3omyObdCWCOBC40vUDkVHAQU8ULHzoCA+2KX9Ds/7/P5zCumAA0uJRR9Smw7OlRzSMxJI+/lGq4CwXKzxDZKuo5rsxXEbW5qmYjtO8Mk6KuLkvieb1vyr2DcqWEFzg/7TZNDfD1oP8et8ITQ26lLP1dtQx/jlAiIBzgK9wziuwj1Divb9A///VsGz43N8maZ+jfsDjYqrfUVWTy3ar7JPUplletenYCR1PmQ5C46XfV0kitKd1aITJ48YPAKyYgKy8AIT+Uz1JArTnqdzLSFRNELS57qS00lzgllbteCyWQ8Uzy0Zpxb/5DDH8/mL1n0MyJrF8qjZd2hLNAXg3z/k9bGXeiMLGwoxRlGXkL2XpiVgI93UKKyVyooGNMgPTc/QdSc7krjAWcOtX/HgLR34jxeLPFEdzJNAFIimfDD8N+XTFcNBw6EvOYm/n5MXkckNoX/G+ThNobHZ7VKSASltZ9zBRAJ2dDh35G3CYmVEk33U77RKbL9le/Za9QVBcAO8i6rqVGYkdO7thHHKHc/1CB1jNnjsFSDt0bURtNfAqfwKCurQC8487zbEzT+2fog3Wygv7g3cklaRg4guY8UjZuFWStYGqbroTsOCd9ATNqeO5B13pNhllSzU=
|
||||
skip_cleanup: true
|
||||
on:
|
||||
repo: Cog-Creators/Red-DiscordBot
|
||||
tags: true
|
||||
- stage: Crowdin Deployment
|
||||
if: tag IS present OR ENV(BUILD_CROWDIN)
|
||||
python: 3.8.1
|
||||
env:
|
||||
- DEPLOYING=true
|
||||
- TOXENV=py38
|
||||
before_deploy:
|
||||
- curl https://artifacts.crowdin.com/repo/GPG-KEY-crowdin | sudo apt-key add -
|
||||
- echo "deb https://artifacts.crowdin.com/repo/deb/ /" | sudo tee -a /etc/apt/sources.list
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -y crowdin
|
||||
- pip install redgettext==3.1
|
||||
deploy:
|
||||
- provider: script
|
||||
script: make upload_translations
|
||||
skip_cleanup: true
|
||||
on:
|
||||
repo: Cog-Creators/Red-DiscordBot
|
||||
tags: true
|
||||
@@ -1,159 +0,0 @@
|
||||
# Contents
|
||||
* [1. Introduction](#1-introduction)
|
||||
* [1.1 Why do these guidelines exist?](#11-why-do-these-guidelines-exist)
|
||||
* [1.2 What kinds of contributions are we looking for?](#12-what-kinds-of-contributions-are-we-looking-for)
|
||||
* [2. Ground Rules](#2-ground-rules)
|
||||
* [3. Your First Contribution](#3-your-first-contribution)
|
||||
* [4. Getting Started](#4-getting-started)
|
||||
* [4.1 Setting up your development environment](#41-setting-up-your-development-environment)
|
||||
* [4.2 Testing](#42-testing)
|
||||
* [4.3 Style](#43-style)
|
||||
* [4.4 Make](#44-make)
|
||||
* [4.5 Keeping your dependencies up to date](#45-keeping-your-dependencies-up-to-date)
|
||||
* [4.6 To contribute changes](#46-to-contribute-changes)
|
||||
* [4.7 How To Report A Bug](#47-how-to-report-a-bug)
|
||||
* [4.8 How To Suggest A Feature Or Enhancement](#48-how-to-suggest-a-feature-or-enhancement)
|
||||
* [5. Code Review Process](#5-code-review-process)
|
||||
* [5.1 Issues](#51-issues)
|
||||
* [5.2 Pull Requests](#52-pull-requests)
|
||||
* [5.3 Differences between "new features" and "improvements"](#53-differences-between-new-features-and-improvements)
|
||||
* [6. Community](#6-community)
|
||||
|
||||
# 1. Introduction
|
||||
**Welcome!** First off, thank you for contributing to the further development of Red. We're always looking for new ways to improve our project and we appreciate any help you can give us.
|
||||
|
||||
### 1.1 Why do these guidelines exist?
|
||||
Red is an open source project. This means that each and every one of the developers and contributors who have helped make Red what it is today have done so by volunteering their time and effort. It takes a lot of time to coordinate and organize issues and new features and to review and test pull requests. By following these guidelines you will help the developers streamline the contribution process and save them time. In doing so we hope to get back to each and every issue and pull request in a timely manner.
|
||||
|
||||
### 1.2 What kinds of contributions are we looking for?
|
||||
We love receiving contributions from our community. Any assistance you can provide with regards to bug fixes, feature enhancements, and documentation is more than welcome.
|
||||
|
||||
# 2. Ground Rules
|
||||
1. Ensure cross compatibility for Windows, Mac OS and Linux.
|
||||
2. Ensure all Python features used in contributions exist and work in Python 3.8.1 and above.
|
||||
3. Create new tests for code you add or bugs you fix. It helps us help you by making sure we don't accidentally break anything :grinning:
|
||||
4. Create any issues for new features you'd like to implement and explain why this feature is useful to everyone and not just you personally.
|
||||
5. Don't add new cogs unless specifically given approval in an issue discussing said cog idea.
|
||||
6. Be welcoming to newcomers and encourage diverse new contributors from all backgrounds. See [Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/).
|
||||
|
||||
# 3. Your First Contribution
|
||||
Unsure of how to get started contributing to Red? Please take a look at the Issues section of this repo and sort by the following labels:
|
||||
|
||||
* beginner - issues that can normally be fixed in just a few lines of code and maybe a test or two.
|
||||
* help-wanted - issues that are currently unassigned to anyone and may be a bit more involved/complex than issues tagged with beginner.
|
||||
|
||||
**Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
|
||||
|
||||
At this point you're ready to start making changes. Feel free to ask for help; everyone was a beginner at some point!
|
||||
|
||||
# 4. Getting Started
|
||||
|
||||
Red's repository is configured to follow a particular development workflow, using various reputable tools. We kindly ask that you stick to this workflow when contributing to Red, by following the guides below. This will help you to easily produce quality code, identify errors early, and streamline the code review process.
|
||||
|
||||
### 4.1 Setting up your development environment
|
||||
The following requirements must be installed prior to setting up:
|
||||
- Python 3.8.1 or greater
|
||||
- git
|
||||
- pip
|
||||
|
||||
If you're not on Windows, you should also have GNU make installed, and you can optionally install [pyenv](https://github.com/pyenv/pyenv), which can help you run tests for different python versions.
|
||||
|
||||
1. Fork and clone the repository to a directory on your local machine.
|
||||
2. Open a command line in that directory and execute the following command:
|
||||
```bash
|
||||
make newenv
|
||||
```
|
||||
Red, its dependencies, and all required development tools, are now installed to a virtual environment located in the `.venv` subdirectory. Red is installed in editable mode, meaning that edits you make to the source code in the repository will be reflected when you run Red.
|
||||
3. Activate the new virtual environment with one of the following commands:
|
||||
- Posix:
|
||||
```bash
|
||||
source .venv/bin/activate
|
||||
```
|
||||
- Windows:
|
||||
```powershell
|
||||
.venv\Scripts\activate
|
||||
```
|
||||
Each time you open a new command line, you should execute this command first. From here onwards, we will assume you are executing commands from within this activated virtual environment.
|
||||
|
||||
**Note:** If you're comfortable with setting up virtual environments yourself and would rather do it manually, just run `pip install -Ur tools/dev-requirements.txt` after setting it up.
|
||||
|
||||
### 4.2 Testing
|
||||
We're using [tox](https://github.com/tox-dev/tox) to run all of our tests. It's extremely simple to use, and if you followed the previous section correctly, it is already installed to your virtual environment.
|
||||
|
||||
Currently, tox does the following, creating its own virtual environments for each stage:
|
||||
- Runs all of our unit tests with [pytest](https://github.com/pytest-dev/pytest) on python 3.8 (test environment `py38`)
|
||||
- Ensures documentation builds without warnings, and all hyperlinks have a valid destination (test environment `docs`)
|
||||
- Ensures that the code meets our style guide with [black](https://github.com/ambv/black) (test environment `style`)
|
||||
|
||||
To run all of these tests, just run the command `tox` in the project directory.
|
||||
|
||||
To run a subset of these tests, use the command `tox -e <env>`, where `<env>` is the test environment you want tox to run. The test environments are noted in the dot points above.
|
||||
|
||||
Your PR will not be merged until all of these tests pass.
|
||||
|
||||
### 4.3 Style
|
||||
Our style checker of choice, [black](https://github.com/ambv/black), actually happens to be an auto-formatter. The checking functionality simply detects whether or not it would try to reformat something in your code, should you run the formatter on it. For this reason, we recommend using this tool as a formatter, regardless of any disagreements you might have with the style it enforces.
|
||||
|
||||
Use the command `black --help` to see how to use this tool. The full style guide is explained in detail on [black's GitHub repository](https://github.com/ambv/black). **There is one exception to this**, however, which is that we set the line length to 99, instead of black's default 88. This is already set in `pyproject.toml` configuration file in the repo so you can simply format code with Black like so: `black <src>`.
|
||||
|
||||
### 4.4 Make
|
||||
You may have noticed we have a `Makefile` and a `make.bat` in the top-level directory. For now, you can do a few things with them:
|
||||
1. `make reformat`: Reformat all python files in the project with Black
|
||||
2. `make stylecheck`: Check if any `.py` files in the project need reformatting
|
||||
3. `make newenv`: Set up a new virtual environment in the `.venv` subdirectory, and install Red and its dependencies. If one already exists, it is cleared out and replaced.
|
||||
4. `make syncenv`: Sync your environment with Red's latest dependencies.
|
||||
|
||||
The other make recipes are most likely for project maintainers rather than contributors.
|
||||
|
||||
You can specify the Python executable used in the make recipes with the `PYTHON` environment variable, e.g. `make PYTHON=/usr/bin/python3.8 newenv`.
|
||||
|
||||
### 4.5 Keeping your dependencies up to date
|
||||
Whenever you pull from upstream (V3/develop on the main repository) and you notice either of the files `setup.cfg` or `tools/dev-requirements.txt` have been changed, it can often mean some package dependencies have been updated, added or removed. To make sure you're testing and formatting with the most up-to-date versions of our dependencies, run `make syncenv`. You could also simply do `make newenv` to install them to a clean new virtual environment.
|
||||
|
||||
### 4.6 To contribute changes
|
||||
|
||||
1. Create a new branch on your fork
|
||||
2. Make the changes
|
||||
3. If you like the changes and think the main Red project could use it:
|
||||
* Run tests with `tox` to ensure your code is up to scratch
|
||||
* Create a Pull Request on GitHub with your changes
|
||||
- If you are contributing a behavior change, please keep in mind that behavior changes
|
||||
are conditional on them being appropriate for the project's current goals.
|
||||
If you would like to reduce the risk of putting in effort for something we aren't
|
||||
going to use, open an issue discussing it first.
|
||||
|
||||
### 4.7 How To Report A Bug
|
||||
Please see our **ISSUES.MD** for more information.
|
||||
|
||||
### 4.8 How To Suggest A Feature Or Enhancement
|
||||
The goal of Red is to be as useful to as many people as possible, this means that all features must be useful to anyone and any server that uses Red.
|
||||
|
||||
If you find yourself wanting a feature that Red does not already have, you're probably not alone. There's bound to be a great number of users out there needing the same thing and a lot of the features that Red has today have been added because of the needs of our users. Open an issue on our issues list and describe the feature you would like to see, how you would use it, how it should work, and why it would be useful to the Red community as a whole.
|
||||
|
||||
# 5. Code Review Process
|
||||
|
||||
We have a core team working tirelessly to implement new features and fix bugs for the Red community. This core team looks at and evaluates new issues and PRs on a daily basis.
|
||||
|
||||
The decisions we make are based on a simple majority of that team or by decree of the project owner.
|
||||
|
||||
### 5.1 Issues
|
||||
Any new issues will be looked at and evaluated for validity of a bug or for the usefulness of a suggested feature. If we have questions about your issue we will get back as soon as we can (usually in a day or two) and will try to make a decision within a week.
|
||||
|
||||
### 5.2 Pull Requests
|
||||
Pull requests are evaluated by their quality and how effectively they solve their corresponding issue. The process for reviewing pull requests is as follows:
|
||||
|
||||
1. A pull request is submitted
|
||||
2. Core team members will review and test the pull request (usually within a week)
|
||||
3. After a member of the core team approves your pull request:
|
||||
* If your pull request is considered an improvement or enhancement the project owner will have 1 day to veto or approve your pull request.
|
||||
* If your pull request is considered a new feature the project owner will have 1 week to veto or approve your pull request.
|
||||
4. If any feedback is given we expect a response within 1 week or we may decide to close the PR.
|
||||
5. If your pull request is not vetoed and no core member requests changes then it will be approved and merged into the project.
|
||||
|
||||
### 5.3 Differences between "new features" and "improvements"
|
||||
The difference between a new feature and improvement can be quite fuzzy and the project owner reserves all rights to decide under which category your PR falls.
|
||||
|
||||
At a very basic level a PR is a new feature if it changes the intended way any part of the Red project currently works or if it modifies the user experience (UX) in any significant way. Otherwise, it is likely to be considered an improvement.
|
||||
|
||||
# 6. Community
|
||||
You can chat with the core team and other community members about issues or pull requests in the #coding channel of the Red support server located [here](https://discord.gg/red).
|
||||
@@ -631,9 +631,8 @@ to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
Red - A fully customizable Discord bot
|
||||
Copyright (C) 2017-2020 Cog Creators
|
||||
Copyright (C) 2015-2017 Twentysix
|
||||
{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) {year} {name of author}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -653,8 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
Red-DiscordBot Copyright (C) 2017-2020 Cog Creators
|
||||
Red-DiscordBot Copyright (C) 2015-2017 Twentysix
|
||||
{project} Copyright (C) {year} {fullname}
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
@@ -673,35 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
|
||||
The Red-DiscordBot project contains subcomponents in audio.py that have a
|
||||
separate copyright notice and license terms. Your use of the source code for
|
||||
these subcomponents is subject to the terms and conditions of the following
|
||||
licenses.
|
||||
|
||||
This product bundles methods from https://github.com/Just-Some-Bots/MusicBot/
|
||||
blob/master/musicbot/spotify.py which are available under an MIT license.
|
||||
|
||||
Copyright (c) 2015-2018 Just-Some-Bots (https://github.com/Just-Some-Bots)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
This project vendors discord.ext.menus package (https://github.com/Rapptz/discord-ext-menus) made by Danny Y. (Rapptz) which is distributed under MIT License.
|
||||
Copy of this license can be found in discord-ext-menus.LICENSE file in redbot/vendored folder of this repository.
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
@@ -1,31 +0,0 @@
|
||||
PYTHON ?= python3.8
|
||||
|
||||
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
# Python Code Style
|
||||
reformat:
|
||||
$(PYTHON) -m black $(ROOT_DIR)
|
||||
stylecheck:
|
||||
$(PYTHON) -m black --check $(ROOT_DIR)
|
||||
stylediff:
|
||||
$(PYTHON) -m black --check --diff $(ROOT_DIR)
|
||||
|
||||
# Translations
|
||||
gettext:
|
||||
$(PYTHON) -m redgettext --command-docstrings --verbose --recursive redbot --exclude-files "redbot/pytest/**/*"
|
||||
upload_translations:
|
||||
crowdin upload sources
|
||||
download_translations:
|
||||
crowdin download
|
||||
|
||||
# Dependencies
|
||||
bumpdeps:
|
||||
$(PYTHON) tools/bumpdeps.py
|
||||
|
||||
# Development environment
|
||||
newenv:
|
||||
$(PYTHON) -m venv --clear .venv
|
||||
.venv/bin/pip install -U pip setuptools wheel
|
||||
$(MAKE) syncenv
|
||||
syncenv:
|
||||
.venv/bin/pip install -Ur ./tools/dev-requirements.txt
|
||||
@@ -1,134 +1,144 @@
|
||||
<h1 align="center">
|
||||
<br>
|
||||
<a href="https://github.com/Cog-Creators/Red-DiscordBot/tree/V3/develop"><img src="https://imgur.com/pY1WUFX.png" alt="Red - Discord Bot"></a>
|
||||
<br>
|
||||
Red Discord Bot
|
||||
<br>
|
||||
</h1>
|
||||
# Red - A multifunction Discord bot
|
||||
#### *Fun bringer, admin helper and music bot*
|
||||
[<img align="right" title="Art by Supergiant Games" src="https://www.supergiantgames.com/static/images/transistor/cartoon_red.png">](https://www.supergiantgames.com/games/transistor/)
|
||||
|
||||
<h4 align="center">Music, Moderation, Trivia, Stream Alerts and Fully Modular.</h4>
|
||||
[<img src="https://img.shields.io/badge/Support-me!-orange.svg">](https://www.patreon.com/Twentysix26) [<img src="https://img.shields.io/badge/Official-Server-green.svg">](https://discord.gg/0k4npTwMvTpv9wrh) **< Announcements & Help!**
|
||||
##**[ [This version is obsolete and no longer being supported. Use the current one] ](https://github.com/Twentysix26/Red-DiscordBot/)**
|
||||
### Cool title, but what does it do exactly?
|
||||
A bit of everything. Seriously though:
|
||||
It has the [most common features](#general-commands) of many chatbots (!flip, !8, stopwatch, etc.), **custom commands** (inspired by Twitch's [Nightbot](https://www.nightbot.tv/)), memes.
|
||||
It features some games such as **Trivia**, rock paper scissors, [users can earn and play with credits](#economy-commands) in the slot machine.
|
||||
[The audio part is quite fleshed out](#audio-commands). Users can **stream youtube videos**, create **playlists** that everyone will be able to play and control (previous/next song, pause/resume, shuffle...).
|
||||
**MP3 and flac files can also be streamed** (see [FAQ](#faq) for details on local playlists)
|
||||
**Twitch's online notifications**: Red will notify the channels you want whenever you favorite Twitch streamers are online.
|
||||
As for the moderation tools, it includes a **powerful message filter with regular expression capabilities** and **mass messages cleanup**.
|
||||
[I'm planning to expand all this much more](#todo-list).
|
||||
See the [command list](#general-commands) for an even better idea of what this bot can do.
|
||||
|
||||
<p align="center">
|
||||
<a href="https://discord.gg/red">
|
||||
<img src="https://discordapp.com/api/guilds/133049272517001216/widget.png?style=shield" alt="Discord Server">
|
||||
</a>
|
||||
<a href="https://pypi.org/project/Red-DiscordBot/">
|
||||
<img alt="PyPI" src="https://img.shields.io/pypi/v/Red-Discordbot">
|
||||
</a>
|
||||
<a href="https://www.python.org/downloads/">
|
||||
<img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/Red-Discordbot">
|
||||
</a>
|
||||
<a href="https://github.com/Rapptz/discord.py/">
|
||||
<img src="https://img.shields.io/badge/discord-py-blue.svg" alt="discord.py">
|
||||
</a>
|
||||
<a href="https://www.patreon.com/Red_Devs">
|
||||
<img src="https://img.shields.io/badge/Support-Red!-red.svg" alt="Support Red on Patreon!">
|
||||
</a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://github.com/Cog-Creators/Red-DiscordBot/actions">
|
||||
<img src="https://img.shields.io/github/workflow/status/Cog-Creators/Red-Discordbot/Tests?label=tests" alt="GitHub Actions">
|
||||
</a>
|
||||
<a href="http://red-discordbot.readthedocs.io/en/stable/?badge=stable">
|
||||
<img src="https://readthedocs.org/projects/red-discordbot/badge/?version=stable" alt="Red on readthedocs.org">
|
||||
</a>
|
||||
<a href="https://github.com/ambv/black">
|
||||
<img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code Style: Black">
|
||||
</a>
|
||||
<a href="http://makeapullrequest.com">
|
||||
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg">
|
||||
</a>
|
||||
<a href="https://crowdin.com/project/red-discordbot">
|
||||
<img src="https://d322cqt584bo4o.cloudfront.net/red-discordbot/localized.svg" alt="Localized with Crowdin">
|
||||
</a>
|
||||
</p>
|
||||
### I don't even know what I'm looking at. How do I install this?
|
||||
Do not panic. [Enter the wiki and follow the tutorials](https://github.com/Twentysix26/Red-DiscordBot/wiki)!
|
||||
If you have any issue, consult the [troubleshooting](https://github.com/Twentysix26/Red-DiscordBot/wiki/Troubleshooting) page, and if you're still stuck, [join the official server](https://discord.gg/0k4npTwMvTpv9wrh) so you can get some help.
|
||||
Once you're done, take a look at the command list and have fun.
|
||||
|
||||
<p align="center">
|
||||
<a href="#overview">Overview</a>
|
||||
•
|
||||
<a href="#installation">Installation</a>
|
||||
•
|
||||
<a href="http://red-discordbot.readthedocs.io/en/stable/index.html">Documentation</a>
|
||||
•
|
||||
<a href="#plugins">Plugins</a>
|
||||
•
|
||||
<a href="#join-the-community">Community</a>
|
||||
•
|
||||
<a href="#license">License</a>
|
||||
</p>
|
||||
### General commands
|
||||
|
||||
# Overview
|
||||
| Command | Description |
|
||||
|-----------------------------------------------|--------------------------------------------|
|
||||
| !flip | Flip a coin |
|
||||
| !rps [rock/paper/scissors] | Play RPS |
|
||||
| !proverb | Random proverb |
|
||||
| !choose [option1 or option2 or option3 (...)] | Random choice. Supports multiple words |
|
||||
| !8 [question?] | Ask 8 ball a question |
|
||||
| !sw | Start/stop the stopwatch |
|
||||
| !trivia | Trivia help and lists |
|
||||
| !trivia [list] | Start a trivia session |
|
||||
| !trivia stop | Stop a trivia session |
|
||||
| !twitch [stream] | Check if stream is online |
|
||||
| !twitchalert [stream] | Red sends an alert in the channel when the stream is online (admin only)|
|
||||
| !stoptwitchalert [stream] | Stop stream alerts (admin only) |
|
||||
| !roll [number] | Random number between 0 and chosen number. |
|
||||
| !gif [text] | GIF search |
|
||||
| !imdb [movie/etc] | Retrieve information from IMDB |
|
||||
| !meme [id;text1;text2] | Create a meme |
|
||||
| !poll [question;answer1;answer2 (...)] | Start poll in the current channel |
|
||||
| !endpoll | Stop poll |
|
||||
| !addcom [command] [text] | Add a custom command |
|
||||
| !editcom [command] [text] | Edit a custom command |
|
||||
| !delcom [command] | Delete a custom command |
|
||||
| !customcommands | Custom commands' list |
|
||||
| !help | Command list |
|
||||
| !audio help | Audio command list and playlist explanation.|
|
||||
| !economy | Explanation of the economy module |
|
||||
| !admin help | Admin commands list |
|
||||
| !meme help | Explanation of !meme |
|
||||
|
||||
Red is a fully modular bot – meaning all features and commands can be enabled/disabled to your
|
||||
liking, making it completely customizable. This is a *self-hosted bot* – meaning you will need
|
||||
to host and maintain your own instance. You can turn Red into an admin bot, music bot, trivia bot,
|
||||
new best friend or all of these together!
|
||||
### Audio commands
|
||||
|
||||
[Installation](#installation) is easy, and you do **NOT** need to know anything about coding! Aside
|
||||
from installing and updating, every part of the bot can be controlled from within Discord.
|
||||
| Command | Description |
|
||||
|----------------------------|---------------------------------------------------------------------|
|
||||
| !youtube [link] | Play a youtube video in a voice channel |
|
||||
| !sing | Make Red sing |
|
||||
| !stop | Stop any voice channel activity |
|
||||
| !play [playlist_name] | Play chosen playlist |
|
||||
| !playlists | Playlist's list |
|
||||
| !next or !skip | Next song |
|
||||
| !prev | Previous song |
|
||||
| !pause | Pause song |
|
||||
| !resume | Resume song |
|
||||
| !replay or !repeat | Replay current song |
|
||||
| !title or !song | Current song's title + link |
|
||||
| !shuffle | Mix current playlist |
|
||||
| !volume [0-1] | Sets Red's output volume |
|
||||
| !addplaylist [name] [link] | Add a youtube playlist |
|
||||
| !delplaylist [name] | Delete a youtube playlist. Limited to author and admins |
|
||||
| !getplaylist | Get the current playlist through DM. This also works with favorites |
|
||||
| !addfavorite | Add song to your favorites |
|
||||
| !delfavorite | Remove song from your favorites |
|
||||
| !playfavorites | Play your favorites |
|
||||
| !local [playlist_name] | Play chosen local playlist |
|
||||
| !local or !locallist | Local playlists' list |
|
||||
| !downloadmode | Enables or disables download mode. (admin only) |
|
||||
|
||||
**The default set of modules includes and is not limited to:**
|
||||
### Admin commands
|
||||
|
||||
- Moderation features (kick/ban/softban/hackban, mod-log, filter, chat cleanup)
|
||||
- Trivia (lists are included and can be easily added)
|
||||
- Music features (YouTube, SoundCloud, local files, playlists, queues)
|
||||
- Stream alerts (Twitch, Youtube, Hitbox, Picarto)
|
||||
- Bank (slot machine, user credits)
|
||||
- Custom commands
|
||||
- Imgur/gif search
|
||||
- Admin automation (self-role assignment, cross-server announcements, mod-mail reports)
|
||||
- Customisable command permissions
|
||||
| Command | Description |
|
||||
|-----------------------------------------------------------|---------------------------------------------------|
|
||||
| !addwords [word1 word2 (...)] [phrase/with/many/words] | Add words to message filter |
|
||||
| !removewords [word1 word2 (...)] [phrase/with/many/words] | Remove words from message filter |
|
||||
| !addregex [regex] | Add regular expression to message filter |
|
||||
| !removeregex [regex] | Remove regular expression from message filter |
|
||||
| !shutdown | Close the bot |
|
||||
| !join [invite] | Join another server |
|
||||
| !leaveserver | Leave server |
|
||||
| !shush | Ignore the current channel |
|
||||
| !talk | Stop ignoring the current channel |
|
||||
| !reload | Reload most files. Useful in case of manual edits |
|
||||
| !name [name] | Change the bot's name |
|
||||
| !cleanup [number] | Delete the last [number] messages |
|
||||
| !cleanup [name/mention] [number] | Delete the last [number] of messages by [name] |
|
||||
| !blacklist [name/mention] | Add user to blacklist. Red will ignore that user |
|
||||
| !forgive [name/mention] | Remove user from blacklist |
|
||||
| !setting [setting] [value] | Modify setting |
|
||||
|
||||
**Additionally, other [plugins](#plugins) (cogs) can be easily found and added from our growing
|
||||
community of cog repositories.**
|
||||
|
||||
# Installation
|
||||
### Economy commands
|
||||
|
||||
**The following platforms are officially supported:**
|
||||
| Command | Description |
|
||||
|-------------|--------------------------------------|
|
||||
| !register | Register a new account |
|
||||
| !balance | Check your balance |
|
||||
| !slot [bid] | Play the slot machine |
|
||||
| !slot help | Slot machine explanation and payouts |
|
||||
| !payday | Receive credits |
|
||||
|
||||
- [Windows](https://red-discordbot.readthedocs.io/en/stable/install_windows.html)
|
||||
- [MacOS](https://red-discordbot.readthedocs.io/en/stable/install_linux_mac.html)
|
||||
- [Most major linux distributions](https://red-discordbot.readthedocs.io/en/stable/install_linux_mac.html)
|
||||
### FAQ
|
||||
>I've done everything the README asked me to and it still doesn't work! Were you drunk when you coded this?
|
||||
|
||||
If after reading the guide you are still experiencing issues, feel free to join the
|
||||
[Official Discord Server](https://discord.gg/red) and ask in the **#support** channel for help.
|
||||
You're probably missing something.
|
||||
Feel free to join [my server](https://discord.gg/0k4npTwMvTpv9wrh) and head to #support to get some help! Oh, and my drinking habits are none of your business.
|
||||
|
||||
# Plugins
|
||||
>Does this bot work on multiple servers?
|
||||
|
||||
Red is fully modular, allowing you to load and unload plugins of your choice, and install 3rd party
|
||||
plugins directly from Discord! A few examples are:
|
||||
Sure it does. Should you do it? Maybe. The permissions system is not that great at the moment but if you trust the people running the server it's ok. It's not advisable to send the bot in random servers at the moment.
|
||||
Custom commands only work in the server they were created in. Same for the message filter. This is by design. Also, remember that the bot can only be in one voice channel at once.
|
||||
|
||||
- Cleverbot integration (talk to Red and she talks back)
|
||||
- Ban sync
|
||||
- Welcome messages
|
||||
- Casino
|
||||
- Reaction roles
|
||||
- Slow Mode
|
||||
- AniList
|
||||
- And much, much more!
|
||||
>Will you implement [feature]?
|
||||
|
||||
Feel free to take a [peek](https://index.discord.red) at a list of
|
||||
available 3rd party cogs!
|
||||
Suggestions are always very welcome.
|
||||
|
||||
# Join the community!
|
||||
>How do local playlists work?
|
||||
|
||||
**Red** is in continuous development, and it’s supported by an active community which produces new
|
||||
content (cogs/plugins) for everyone to enjoy. New features are constantly added. If you can’t
|
||||
[find](https://cogboard.red/t/approved-repositories/210) the cog you’re looking for,
|
||||
consult our [guide](https://red-discordbot.readthedocs.io/en/stable/guide_cog_creation.html) on
|
||||
building your own cogs!
|
||||
Make as many folders as you want inside the localtracks folder. Names must be without spaces. Every folder counts as a different playlist. Every playlist can contain mp3 and flac files. Users can stream them by doing !local [playlist_name] and see the full list
|
||||
with !local or !locallist. They can also add tracks to their favorites.
|
||||
|
||||
Join us on our [Official Discord Server](https://discord.gg/red)!
|
||||
>What's download mode?
|
||||
|
||||
# License
|
||||
Everytime you play the audio of a youtube video with download mode on the audio will be first downloaded and stored into the "cache" folder. It is recommended that you use this mode to avoid streaming problems. This is the default mode, you can switch between modes with !downloadmode.
|
||||
|
||||
Released under the [GNU GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html) license.
|
||||
>Why is this bot called Red and the admin role "Transistor"? What's the meaning of !sing?
|
||||
|
||||
Red is named after the main character of "Transistor", a video game by
|
||||
[Super Giant Games](https://www.supergiantgames.com/games/transistor/).
|
||||
They're all references to [Transistor](https://www.supergiantgames.com/games/transistor/), a videogame by Supergiant Games.
|
||||
|
||||
Artwork created by [Sinlaire](https://sinlaire.deviantart.com/) on Deviant Art for the Red Discord
|
||||
Bot Project.
|
||||
|
||||
This project vendors [discord.ext.menus](https://github.com/Rapptz/discord-ext-menus) package made by Danny Y. (Rapptz) which is distributed under MIT License.
|
||||
Copy of this license can be found in [discord-ext-menus.LICENSE](redbot/vendored/discord-ext-menus.LICENSE) file in [redbot/vendored](redbot/vendored) folder of this repository.
|
||||
### TODO List
|
||||
- [x] [Start rewriting Red](https://github.com/Twentysix26/Red-DiscordBot/tree/develop)
|
||||
- [ ] ~~Bundle some malware and slowly build up a botnet for world domination~~
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
api_key_env: CROWDIN_API_KEY
|
||||
project_identifier_env: CROWDIN_PROJECT_ID
|
||||
base_path: ./redbot/
|
||||
preserve_hierarchy: true
|
||||
files:
|
||||
- source: cogs/**/messages.pot
|
||||
translation: /%original_path%/%locale%.po
|
||||
- source: core/**/messages.pot
|
||||
translation: /%original_path%/%locale%.po
|
||||
@@ -0,0 +1,132 @@
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import glob
|
||||
|
||||
default_settings = ('{"TRIVIA_ADMIN_ONLY": false, "EDIT_CC_ADMIN_ONLY": false, "PASSWORD": "PASSWORDHERE", "FILTER": true, "CUSTOMCOMMANDS": true, ' +
|
||||
'"TRIVIA_MAX_SCORE": 10, "TRIVIA_DELAY": 15, "LOGGING": true, "EMAIL": "EMAILHERE", "ADMINROLE": "Transistor", "DOWNLOADMODE" : true, ' +
|
||||
'"VOLUME": 0.20, "TRIVIA_BOT_PLAYS" : false, "TRIVIA_TIMEOUT" : 120, "DEBUG_ID" : "IgnoreThis", "POLL_DURATION" : 60, "PREFIX" : "!"}')
|
||||
|
||||
default_apis = ('{"IMGFLIP_USERNAME": "USERNAMEHERE", "IMGFLIP_PASSWORD": "PASSWORDHERE", "MYAPIFILMS_TOKEN" : "TOKENHERE"}')
|
||||
|
||||
logger = logging.getLogger("__main__")
|
||||
|
||||
|
||||
def fileIO(filename, IO, data=None):
|
||||
if IO == "save" and data != None:
|
||||
with open(filename, encoding='utf-8', mode="w") as f:
|
||||
f.write(json.dumps(data))
|
||||
elif IO == "load" and data == None:
|
||||
with open(filename, encoding='utf-8', mode="r") as f:
|
||||
return json.loads(f.read())
|
||||
elif IO == "check" and data == None:
|
||||
try:
|
||||
with open(filename, encoding='utf-8', mode="r") as f:
|
||||
return True
|
||||
except:
|
||||
return False
|
||||
else:
|
||||
logger.info("Invalid fileIO call")
|
||||
|
||||
def loadProverbs():
|
||||
with open("proverbs.txt", encoding='utf-8', mode="r") as f:
|
||||
data = f.readlines()
|
||||
return data
|
||||
|
||||
def loadAndCheckSettings():
|
||||
to_delete = []
|
||||
try:
|
||||
current_settings = fileIO("json/settings.json", "load")
|
||||
default = json.loads(default_settings)
|
||||
if current_settings.keys() != default.keys():
|
||||
logger.warning("Something wrong detected with settings.json. Starting check...")
|
||||
for field in default:
|
||||
if field not in current_settings:
|
||||
logger.info("Adding " + field + " field.")
|
||||
current_settings[field] = default[field]
|
||||
for field in current_settings:
|
||||
if field not in default:
|
||||
logger.info("Removing " + field + " field.")
|
||||
to_delete.append(field)
|
||||
for field in to_delete:
|
||||
del current_settings[field]
|
||||
logger.warning("Your settings.json was deprecated (missing or useless fields detected). I fixed it. " +
|
||||
"If the file was missing any field I've added it and put default values. You might want to check it.")
|
||||
fileIO("json/settings.json", "save", current_settings)
|
||||
return current_settings
|
||||
except IOError:
|
||||
fileIO("json/settings.json", "save", json.loads(default_settings))
|
||||
logger.error("Your settings.json is missing. I've created a new one. Edit it with your settings and restart me.")
|
||||
exit(1)
|
||||
except:
|
||||
logger.error("Your settings.json seems to be invalid. Check it. If you're unable to fix it delete it and I'll create a new one the next start.")
|
||||
exit(1)
|
||||
|
||||
def migration():
|
||||
if not os.path.exists("json/"):
|
||||
os.makedirs("json")
|
||||
logger.info("Creating json folder...")
|
||||
|
||||
if not os.path.exists("cache/"): #Stores youtube audio for DOWNLOADMODE
|
||||
os.makedirs("cache")
|
||||
|
||||
if not os.path.exists("trivia/"):
|
||||
os.makedirs("trivia")
|
||||
|
||||
files = glob.glob("*.json")
|
||||
if files != []:
|
||||
logger.info("Moving your json files into the json folder...")
|
||||
for f in files:
|
||||
logger.info("Moving {}...".format(f))
|
||||
os.rename(f, "json/" + f)
|
||||
|
||||
def createEmptyFiles():
|
||||
files = {"twitch.json": [], "commands.json": {}, "economy.json" : {}, "filter.json" : {}, "regex_filter.json" : {}, "shushlist.json" : [], "blacklist.json" : []}
|
||||
games = ["Multi Theft Auto", "her Turn()", "Tomb Raider II", "some music.", "NEO Scavenger", "Python", "World Domination", "with your heart."]
|
||||
files["games.json"] = games
|
||||
for f, data in files.items() :
|
||||
if not os.path.isfile("json/" + f):
|
||||
logger.info("Missing {}. Creating it...".format(f))
|
||||
fileIO("json/" + f, "save", data)
|
||||
if not os.path.isfile("json/settings.json"):
|
||||
logger.info("Missing settings.json. Creating it...\n")
|
||||
fileIO("json/settings.json", "save", json.loads(default_settings))
|
||||
print("You have to configure your settings. If you'd like to do it manually, close this window.\nOtherwise type your bot's account email. DO NOT use your own account for the bot, make a new one.\n\nEmail:")
|
||||
email = input(">")
|
||||
print("Now enter the password.")
|
||||
password = input(">")
|
||||
print("Admin role? Leave empty for default (Transistor)")
|
||||
admin_role = input(">")
|
||||
if admin_role == "":
|
||||
admin_role = "Transistor"
|
||||
print("Command prefix? Leave empty for default, '!'. Maximum 1 character.")
|
||||
prefix = input(">")
|
||||
if len(prefix) != 1 or prefix == " ":
|
||||
print("Invalid prefix. Setting prefix as '!'...")
|
||||
prefix = "!"
|
||||
new_settings = json.loads(default_settings)
|
||||
new_settings["EMAIL"] = email
|
||||
new_settings["PASSWORD"] = password
|
||||
new_settings["ADMINROLE"] = admin_role
|
||||
new_settings["PREFIX"] = prefix
|
||||
fileIO("json/settings.json", "save", new_settings )
|
||||
logger.info("Settings have been saved.")
|
||||
|
||||
if not os.path.isfile("json/apis.json"):
|
||||
logger.info("Missing apis.json. Creating it...\n")
|
||||
fileIO("json/apis.json", "save", json.loads(default_apis))
|
||||
print("\nIt's now time to configure optional services\nIf you're not interested, leave empty and keep pressing enter.\nMemes feature: create an account on https://imgflip.com/.\nimgflip username:")
|
||||
imgflip_username = input(">")
|
||||
print("Now enter the imgflip password.")
|
||||
imgflip_password = input(">")
|
||||
if imgflip_username == "": imgflip_username = "USERNAMEHERE"
|
||||
if imgflip_password == "": imgflip_password = "PASSWORDHERE"
|
||||
print("\n!imdb configuration. Get your token here http://www.myapifilms.com/token.do\nOr just press enter if you're not interested.")
|
||||
imdb_token = input(">")
|
||||
if imdb_token == "": imdb_token = "TOKENHERE"
|
||||
new_settings = json.loads(default_apis)
|
||||
new_settings["IMGFLIP_USERNAME"] = imgflip_username
|
||||
new_settings["IMGFLIP_PASSWORD"] = imgflip_password
|
||||
new_settings["MYAPIFILMS_TOKEN"] = imdb_token
|
||||
fileIO("json/apis.json", "save", new_settings )
|
||||
logger.info("API Settings have been saved.\n")
|
||||
|
Before Width: | Height: | Size: 334 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 255 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 40 KiB |
@@ -1,20 +0,0 @@
|
||||
# Minimal makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = python3 -msphinx
|
||||
SPHINXPROJ = Red-DiscordBot
|
||||
SOURCEDIR = .
|
||||
BUILDDIR = _build
|
||||
|
||||
# Put it first so that "make" without argument is like "make help".
|
||||
help:
|
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
.PHONY: help Makefile
|
||||
|
||||
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||
%: Makefile
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
@@ -1,18 +0,0 @@
|
||||
{% extends '!layout.html' %}
|
||||
{% block document %}
|
||||
{% if version_slug == 'latest' %}
|
||||
<div class="admonition warning">
|
||||
<p class="first admonition-title">Warning</p>
|
||||
<p class="last">
|
||||
This document is for Red's development version, which can be significantly different from previous releases.
|
||||
If you're a regular user, you should read the <a href="{{ dict(versions)['stable'] }}">Red documentation for the current stable release</a>.
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{{ super() }}
|
||||
<a href="https://github.com/Cog-Creators/Red-DiscordBot">
|
||||
<img style="position: absolute; top: 0; right: 0; border: 0;"
|
||||
src="https://github.blog/wp-content/uploads/2008/12/forkme_right_darkblue_121621.png?resize=149%2C149"
|
||||
class="attachment-full size-full" alt="Fork me on GitHub">
|
||||
</a>
|
||||
{% endblock %}
|
||||
@@ -1,39 +0,0 @@
|
||||
.. _about-venvs:
|
||||
|
||||
==========================
|
||||
About Virtual Environments
|
||||
==========================
|
||||
Creating a virtual environment is really easy and usually prevents many common installation
|
||||
problems.
|
||||
|
||||
**What Are Virtual Environments For?**
|
||||
|
||||
Virtual environments allow you to isolate Red's library dependencies, cog dependencies and python
|
||||
binaries from the rest of your system. There is no performance overhead to using virtual environment
|
||||
and it saves you from a lot of troubles during setup. It also makes sure Red and its dependencies
|
||||
are installed to a predictable location which makes uninstalling Red as simple as removing a single folder,
|
||||
without worrying about losing your data or other things on your system becoming broken.
|
||||
|
||||
|
||||
--------------------------------------------
|
||||
Virtual Environments with Multiple Instances
|
||||
--------------------------------------------
|
||||
If you are running multiple instances of Red on the same machine, you have the option of either
|
||||
using the same virtual environment for all of them, or creating separate ones.
|
||||
|
||||
.. note::
|
||||
|
||||
This only applies for multiple instances of V3. If you are running a V2 instance as well,
|
||||
you **must** use separate virtual environments.
|
||||
|
||||
The advantages of using a *single* virtual environment for all of your V3 instances are:
|
||||
|
||||
- When updating Red, you will only need to update it once for all instances (however you will still need to restart all instances for the changes to take effect)
|
||||
- It will save space on your hard drive
|
||||
|
||||
On the other hand, you may wish to update each of your instances individually.
|
||||
|
||||
.. important::
|
||||
|
||||
Windows users with multiple instances should create *separate* virtual environments, as
|
||||
updating multiple running instances at once is likely to cause errors.
|
||||
@@ -1,44 +0,0 @@
|
||||
.. pm2 service guide
|
||||
|
||||
==============================================
|
||||
Setting up auto-restart using pm2 on Linux
|
||||
==============================================
|
||||
|
||||
.. note:: This guide is for setting up PM2 on a Linux environment. This guide assumes that you already have a working Red instance.
|
||||
|
||||
--------------
|
||||
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`
|
||||
|
||||
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`.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
pm2 start redbot --name "<Insert a name here>" --interpreter "<Location to your Python Interpreter>" --interpreter-args "-O" -- <Red Instance> --no-prompt
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
Arguments to replace.
|
||||
|
||||
<Insert a name here>
|
||||
A name to identify the bot within pm2, this is not your Red instance.
|
||||
|
||||
<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
|
||||
|
||||
<Red Instance>
|
||||
The name of your Red instance.
|
||||
|
||||
------------------------------
|
||||
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`
|
||||
@@ -1,84 +0,0 @@
|
||||
.. _systemd-service-guide:
|
||||
|
||||
==============================================
|
||||
Setting up auto-restart using systemd on Linux
|
||||
==============================================
|
||||
|
||||
-------------------------
|
||||
Creating the service file
|
||||
-------------------------
|
||||
|
||||
In order to create the service file, you will first need to know two things, your Linux :code:`username` and your Python :code:`path`
|
||||
|
||||
First, your Linux :code:`username` can be fetched with the following command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
whoami
|
||||
|
||||
Next, your python :code:`path` can be fetched with the following commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# If redbot is installed in a venv
|
||||
source ~/redenv/bin/activate
|
||||
which python
|
||||
|
||||
# If redbot is installed in a pyenv virtualenv
|
||||
pyenv shell <virtualenv_name>
|
||||
pyenv which python
|
||||
|
||||
Then create the new service file:
|
||||
|
||||
:code:`sudo -e /etc/systemd/system/red@.service`
|
||||
|
||||
Paste the following in the file, and replace all instances of :code:`username` with the Linux username you retrieved above, and :code:`path` with the python path you retrieved above.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[Unit]
|
||||
Description=%I redbot
|
||||
After=multi-user.target
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
ExecStart=path -O -m redbot %I --no-prompt
|
||||
User=username
|
||||
Group=username
|
||||
Type=idle
|
||||
Restart=always
|
||||
RestartSec=15
|
||||
RestartPreventExitStatus=0
|
||||
TimeoutStopSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
Save and exit :code:`ctrl + O; enter; ctrl + x`
|
||||
|
||||
---------------------------------
|
||||
Starting and enabling the service
|
||||
---------------------------------
|
||||
|
||||
.. note:: This same file can be used to start as many instances of the bot as you wish, without creating more service files, just start and enable more services and add any bot instance name after the **@**
|
||||
|
||||
To start the bot, run the service and add the instance name after the **@**:
|
||||
|
||||
:code:`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`
|
||||
|
||||
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`
|
||||
|
||||
.. 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`
|
||||
@@ -1,79 +0,0 @@
|
||||
===========================================
|
||||
Creating a bot account
|
||||
===========================================
|
||||
|
||||
To use Red you will require a bot account and to enable privileged intents. Both these steps will be covered below.
|
||||
|
||||
.. _creating-a-bot-account:
|
||||
|
||||
-------------------------------
|
||||
Creating the bot application
|
||||
-------------------------------
|
||||
|
||||
In order to use Red, we must first create a Discord Bot account.
|
||||
|
||||
Creating a Bot account is a pretty straightforward process.
|
||||
|
||||
1. Make sure you're logged on to the `Discord website <https://discord.com>`_.
|
||||
2. Navigate to the `application page <https://discord.com/developers/applications>`_
|
||||
3. Click on the "New Application" button.
|
||||
|
||||
.. image:: /.resources/bot-guide/discord_create_app_button.png
|
||||
:alt: The new application button.
|
||||
|
||||
4. Give the application a name and click "Create".
|
||||
|
||||
.. image:: /.resources/bot-guide/discord_create_app_form.png
|
||||
:alt: The new application form filled in.
|
||||
|
||||
5. Create a Bot User by navigating to the "Bot" tab and clicking "Add Bot".
|
||||
|
||||
- Click "Yes, do it!" to continue.
|
||||
|
||||
.. image:: /.resources/bot-guide/discord_create_bot_user.png
|
||||
:alt: The Add Bot button.
|
||||
6. If you want others to be able to invite your bot tick the **Public Bot**. Keeping it unticked will prevent others from inviting your bot to their servers and only you will be able to add the bot to servers (provided that you have needed permissions in the server you want to add the bot to).
|
||||
|
||||
- Make sure **Require OAuth2 Code Grant** is unchecked.
|
||||
|
||||
.. image:: /.resources/bot-guide/discord_bot_user_options.png
|
||||
:alt: How the Bot User options should look like for most people.
|
||||
|
||||
7. Copy the token using the "Copy" button.
|
||||
|
||||
- **This is not the Client Secret at the General Information page**
|
||||
|
||||
.. warning::
|
||||
|
||||
Do not share your token as it is like your password.
|
||||
If you shared your token you can regenerate it.
|
||||
|
||||
Continue to the next section to enable privileged intents.
|
||||
|
||||
.. _enabling-privileged-intents:
|
||||
|
||||
-------------------------------
|
||||
Enabling Privileged Intents
|
||||
-------------------------------
|
||||
.. warning::
|
||||
Due to Discord API changes, Red Bot requires all intents.
|
||||
\This section is required.
|
||||
|
||||
1. Make sure you're logged on to the `Discord website <https://discord.com>`_.
|
||||
2. Navigate to the `application page <https://discord.com/developers/applications>`_
|
||||
3. Click on the bot you want to enable privileged intents for.
|
||||
4. Navigate to the bot tab on the left side of the screen.
|
||||
|
||||
.. image:: /.resources/bot-guide/discord_bot_tab.png
|
||||
:alt: The bot tab in the application page.
|
||||
|
||||
5. Scroll down to the "Privileged Gateway Intents" section, enable both privileged intents and save your changes.
|
||||
|
||||
.. image:: /.resources/bot-guide/discord_privileged_intents.png
|
||||
:alt: The privileged gateway intents selector.
|
||||
|
||||
.. warning::
|
||||
|
||||
Red bots with over 100 servers require `bot verification <https://support.discord.com/hc/en-us/articles/360040720412>`_ which is not covered in this guide.
|
||||
|
||||
*Parts of this guide have been adapted from* `discord.py intro <https://discordpy.readthedocs.io/en/stable/discord.html#discord-intro>`_ *and* `discord.py privileged intents <https://discordpy.readthedocs.io/en/stable/intents.html#privileged-intents>`_.
|
||||
@@ -1,232 +0,0 @@
|
||||
.. v3.1.0 Changelog
|
||||
|
||||
####################
|
||||
v3.1.0 Release Notes
|
||||
####################
|
||||
|
||||
----------------------
|
||||
Mongo Driver Migration
|
||||
----------------------
|
||||
|
||||
Due to the required changes of the Mongo driver for Config, all existing Mongo users will need to
|
||||
complete the below instructions to continue to use Mongo after updating to 3.1.
|
||||
This includes **all** users, regardless of any prior migration attempt to a development version of
|
||||
3.1.
|
||||
|
||||
#. Upgrade to 3.1
|
||||
#. Convert all existing Mongo instances to JSON using the new converters
|
||||
#. Start each bot instance while using JSON and load any and all cogs you have in order to successfully preserve data.
|
||||
#. Turn each instance off and convert back to Mongo.
|
||||
**NOTE:** No data is wiped from your Mongo database when converting to JSON.
|
||||
You may want to use a *new* database name when converting back to Mongo in order to not have duplicate data.
|
||||
|
||||
-------------
|
||||
Setup Utility
|
||||
-------------
|
||||
|
||||
New commands were introduced to simplify the conversion/editing/removal process both on our end and the users end.
|
||||
Please use ``redbot-setup --help`` to learn how to use the new features.
|
||||
|
||||
.. HINT::
|
||||
|
||||
Converting to JSON: ``redbot-setup convert <instance_name> json``
|
||||
|
||||
Converting to Mongo: ``redbot-setup convert <instance_name> mongo``
|
||||
|
||||
################
|
||||
v3.1.0 Changelog
|
||||
################
|
||||
|
||||
-----
|
||||
Audio
|
||||
-----
|
||||
|
||||
* Add Spotify support (`#2328`_)
|
||||
* Play local folders via text command (`#2457`_)
|
||||
* Change pause to a toggle (`#2461`_)
|
||||
* Remove aliases (`#2462`_)
|
||||
* Add track length restriction (`#2465`_)
|
||||
* Seek command can now seek to position (`#2470`_)
|
||||
* Add option for dc at queue end (`#2472`_)
|
||||
* Emptydisconnect and status refactor (`#2473`_)
|
||||
* Queue clean and queue clear addition (`#2476`_)
|
||||
* Fix for audioset status (`#2481`_)
|
||||
* Playlist download addition (`#2482`_)
|
||||
* Add songs when search-queuing (`#2513`_)
|
||||
* Match v2 behavior for channel change (`#2521`_)
|
||||
* Bot will no longer complain about permissions when trying to connect to user-limited channel, if it has "Move Members" permission (`#2525`_)
|
||||
* Fix issue on audiostats command when more than 20 servers to display (`#2533`_)
|
||||
* Fix for prev command display (`#2556`_)
|
||||
* Fix for localtrack playing (`#2557`_)
|
||||
* Fix for playlist queue when not playing (`#2586`_)
|
||||
* Track search and append fixes (`#2591`_)
|
||||
* DJ role should ask for a role (`#2606`_)
|
||||
|
||||
----
|
||||
Core
|
||||
----
|
||||
|
||||
* Warn on usage of ``yaml.load`` (`#2326`_)
|
||||
* New Event dispatch: ``on_message_without_command`` (`#2338`_)
|
||||
* Improve output format of cooldown messages (`#2412`_)
|
||||
* Delete cooldown messages when expired (`#2469`_)
|
||||
* Fix local blacklist/whitelist management (`#2531`_)
|
||||
* ``[p]set locale`` now only accepts actual locales (`#2553`_)
|
||||
* ``[p]listlocales`` now displays ``en-US`` (`#2553`_)
|
||||
* ``redbot --version`` will now give you current version of Red (`#2567`_)
|
||||
* Redesign help and related formatter (`#2628`_)
|
||||
* Default locale changed from ``en`` to ``en-US`` (`#2642`_)
|
||||
* New command ``[p]datapath`` that prints the bot's datapath (`#2652`_)
|
||||
|
||||
------
|
||||
Config
|
||||
------
|
||||
|
||||
* Updated Mongo driver to support large guilds (`#2536`_)
|
||||
* Introduced ``init_custom`` method on Config objects (`#2545`_)
|
||||
* We now record custom group primary key lengths in the core config object (`#2550`_)
|
||||
* Migrated internal UUIDs to maintain cross platform consistency (`#2604`_)
|
||||
|
||||
-------------
|
||||
DataConverter
|
||||
-------------
|
||||
|
||||
* It's dead jim (Removal) (`#2554`_)
|
||||
|
||||
----------
|
||||
discord.py
|
||||
----------
|
||||
|
||||
* No longer vendoring discord.py (`#2587`_)
|
||||
* Upgraded discord.py dependency to version 1.0.1 (`#2587`_)
|
||||
|
||||
----------
|
||||
Downloader
|
||||
----------
|
||||
|
||||
* ``[p]cog install`` will now tell user that cog has to be loaded (`#2523`_)
|
||||
* The message when libraries fail to install is now formatted (`#2576`_)
|
||||
* Fixed bug, that caused Downloader to include submodules on cog list (`#2590`_)
|
||||
* ``[p]cog uninstall`` allows to uninstall multiple cogs now (`#2592`_)
|
||||
* ``[p]cog uninstall`` will now remove cog from installed cogs even if it can't find the cog in install path anymore (`#2595`_)
|
||||
* ``[p]cog install`` will not allow to install cogs which aren't suitable for installed version of Red anymore (`#2605`_)
|
||||
* Cog Developers now have to use ``min_bot_version`` in form of version string instead of ``bot_version`` in info.json and they can also use ``max_bot_version`` to specify maximum version of Red, more in :ref:`info-json-format`. (`#2605`_)
|
||||
|
||||
------
|
||||
Filter
|
||||
------
|
||||
|
||||
* Filter performs significantly better on large servers. (`#2509`_)
|
||||
|
||||
--------
|
||||
Launcher
|
||||
--------
|
||||
|
||||
* Fixed extras in the launcher (`#2588`_)
|
||||
|
||||
---
|
||||
Mod
|
||||
---
|
||||
|
||||
* Admins can now decide how many times message has to be repeated before ``deleterepeats`` removes it (`#2437`_)
|
||||
* Fix: make ``[p]ban [days]`` optional as per the doc (`#2602`_)
|
||||
* Added the command ``voicekick`` to kick members from a voice channel with optional mod case. (`#2639`_)
|
||||
|
||||
-----------
|
||||
Permissions
|
||||
-----------
|
||||
|
||||
* Removed: ``p`` alias for ``permissions`` command (`#2467`_)
|
||||
|
||||
-------------
|
||||
Setup Scripts
|
||||
-------------
|
||||
|
||||
* ``redbot-setup`` now uses the click CLI library (`#2579`_)
|
||||
* ``redbot-setup convert`` now used to convert between libraries (`#2579`_)
|
||||
* Backup support for Mongo is currently broken (`#2579`_)
|
||||
|
||||
-------
|
||||
Streams
|
||||
-------
|
||||
|
||||
* Add support for custom stream alert messages per guild (`#2600`_)
|
||||
* Add ability to exclude rerun Twitch streams, and note rerun streams in embed status (`#2620`_)
|
||||
|
||||
-----
|
||||
Tests
|
||||
-----
|
||||
|
||||
* Test for ``trivia`` cog uses explicitly utf-8 encoding for checking yaml files (`#2565`_)
|
||||
|
||||
------
|
||||
Trivia
|
||||
------
|
||||
|
||||
* Fix of dead image link for Sao Tome and Principe in ``worldflags`` trivia (`#2540`_)
|
||||
|
||||
-----------------
|
||||
Utility Functions
|
||||
-----------------
|
||||
|
||||
* New: ``chat_formatting.humanize_timedelta`` (`#2412`_)
|
||||
* ``Tunnel`` - Spelling correction of method name - changed ``files_from_attatch`` to ``files_from_attach`` (old name is left for backwards compatibility) (`#2496`_)
|
||||
* ``Tunnel`` - fixed behavior of ``react_close()``, now when tunnel closes message will be sent to other end (`#2507`_)
|
||||
* ``chat_formatting.humanize_list`` - Improved error handling of empty lists (`#2597`_)
|
||||
|
||||
.. _#2326: https://github.com/Cog-Creators/Red-DiscordBot/pull/2326
|
||||
.. _#2328: https://github.com/Cog-Creators/Red-DiscordBot/pull/2328
|
||||
.. _#2338: https://github.com/Cog-Creators/Red-DiscordBot/pull/2338
|
||||
.. _#2412: https://github.com/Cog-Creators/Red-DiscordBot/pull/2412
|
||||
.. _#2437: https://github.com/Cog-Creators/Red-DiscordBot/pull/2437
|
||||
.. _#2457: https://github.com/Cog-Creators/Red-DiscordBot/pull/2457
|
||||
.. _#2461: https://github.com/Cog-Creators/Red-DiscordBot/pull/2461
|
||||
.. _#2462: https://github.com/Cog-Creators/Red-DiscordBot/pull/2462
|
||||
.. _#2465: https://github.com/Cog-Creators/Red-DiscordBot/pull/2465
|
||||
.. _#2467: https://github.com/Cog-Creators/Red-DiscordBot/pull/2467
|
||||
.. _#2469: https://github.com/Cog-Creators/Red-DiscordBot/pull/2469
|
||||
.. _#2470: https://github.com/Cog-Creators/Red-DiscordBot/pull/2470
|
||||
.. _#2472: https://github.com/Cog-Creators/Red-DiscordBot/pull/2472
|
||||
.. _#2473: https://github.com/Cog-Creators/Red-DiscordBot/pull/2473
|
||||
.. _#2476: https://github.com/Cog-Creators/Red-DiscordBot/pull/2476
|
||||
.. _#2481: https://github.com/Cog-Creators/Red-DiscordBot/pull/2481
|
||||
.. _#2482: https://github.com/Cog-Creators/Red-DiscordBot/pull/2482
|
||||
.. _#2496: https://github.com/Cog-Creators/Red-DiscordBot/pull/2496
|
||||
.. _#2507: https://github.com/Cog-Creators/Red-DiscordBot/pull/2507
|
||||
.. _#2509: https://github.com/Cog-Creators/Red-DiscordBot/pull/2509
|
||||
.. _#2513: https://github.com/Cog-Creators/Red-DiscordBot/pull/2513
|
||||
.. _#2521: https://github.com/Cog-Creators/Red-DiscordBot/pull/2521
|
||||
.. _#2523: https://github.com/Cog-Creators/Red-DiscordBot/pull/2523
|
||||
.. _#2525: https://github.com/Cog-Creators/Red-DiscordBot/pull/2525
|
||||
.. _#2531: https://github.com/Cog-Creators/Red-DiscordBot/pull/2531
|
||||
.. _#2533: https://github.com/Cog-Creators/Red-DiscordBot/pull/2533
|
||||
.. _#2536: https://github.com/Cog-Creators/Red-DiscordBot/pull/2536
|
||||
.. _#2540: https://github.com/Cog-Creators/Red-DiscordBot/pull/2540
|
||||
.. _#2545: https://github.com/Cog-Creators/Red-DiscordBot/pull/2545
|
||||
.. _#2550: https://github.com/Cog-Creators/Red-DiscordBot/pull/2550
|
||||
.. _#2553: https://github.com/Cog-Creators/Red-DiscordBot/pull/2553
|
||||
.. _#2554: https://github.com/Cog-Creators/Red-DiscordBot/pull/2554
|
||||
.. _#2556: https://github.com/Cog-Creators/Red-DiscordBot/pull/2556
|
||||
.. _#2557: https://github.com/Cog-Creators/Red-DiscordBot/pull/2557
|
||||
.. _#2565: https://github.com/Cog-Creators/Red-DiscordBot/pull/2565
|
||||
.. _#2567: https://github.com/Cog-Creators/Red-DiscordBot/pull/2567
|
||||
.. _#2576: https://github.com/Cog-Creators/Red-DiscordBot/pull/2576
|
||||
.. _#2579: https://github.com/Cog-Creators/Red-DiscordBot/pull/2579
|
||||
.. _#2586: https://github.com/Cog-Creators/Red-DiscordBot/pull/2586
|
||||
.. _#2587: https://github.com/Cog-Creators/Red-DiscordBot/pull/2587
|
||||
.. _#2588: https://github.com/Cog-Creators/Red-DiscordBot/pull/2588
|
||||
.. _#2590: https://github.com/Cog-Creators/Red-DiscordBot/pull/2590
|
||||
.. _#2591: https://github.com/Cog-Creators/Red-DiscordBot/pull/2591
|
||||
.. _#2592: https://github.com/Cog-Creators/Red-DiscordBot/pull/2592
|
||||
.. _#2595: https://github.com/Cog-Creators/Red-DiscordBot/pull/2595
|
||||
.. _#2597: https://github.com/Cog-Creators/Red-DiscordBot/pull/2597
|
||||
.. _#2600: https://github.com/Cog-Creators/Red-DiscordBot/pull/2600
|
||||
.. _#2602: https://github.com/Cog-Creators/Red-DiscordBot/pull/2602
|
||||
.. _#2604: https://github.com/Cog-Creators/Red-DiscordBot/pull/2604
|
||||
.. _#2605: https://github.com/Cog-Creators/Red-DiscordBot/pull/2605
|
||||
.. _#2606: https://github.com/Cog-Creators/Red-DiscordBot/pull/2606
|
||||
.. _#2620: https://github.com/Cog-Creators/Red-DiscordBot/pull/2620
|
||||
.. _#2628: https://github.com/Cog-Creators/Red-DiscordBot/pull/2628
|
||||
.. _#2639: https://github.com/Cog-Creators/Red-DiscordBot/pull/2639
|
||||
.. _#2642: https://github.com/Cog-Creators/Red-DiscordBot/pull/2642
|
||||
.. _#2652: https://github.com/Cog-Creators/Red-DiscordBot/pull/2652
|
||||
@@ -1,565 +0,0 @@
|
||||
.. 3.2.x Changelogs
|
||||
|
||||
Redbot 3.2.3 (2020-01-17)
|
||||
=========================
|
||||
|
||||
Core Bot Changes
|
||||
----------------
|
||||
|
||||
- Further improvements have been made to bot startup and shutdown.
|
||||
- Prefixes are now cached for performance.
|
||||
- Added the means for cog creators to use a global preinvoke hook.
|
||||
- The bot now ensures it has at least the bare neccessary permissions before running commands.
|
||||
- Deleting instances works as intended again.
|
||||
- Sinbad stopped fighting it and embraced the entrypoint madness.
|
||||
|
||||
Core Commands
|
||||
-------------
|
||||
|
||||
- The servers command now also shows the ids.
|
||||
|
||||
Admin Cog
|
||||
---------
|
||||
|
||||
- The selfrole command now has reasonable expectations about hierarchy.
|
||||
|
||||
Help Formatter
|
||||
--------------
|
||||
|
||||
- ``[botname]`` is now replaced with the bot's display name in help text.
|
||||
- New features added for cog creators to further customize help behavior.
|
||||
|
||||
- Check out our command reference for details on new ``format_help_for_context`` method.
|
||||
- Embed settings are now consistent.
|
||||
|
||||
Downloader
|
||||
----------
|
||||
|
||||
- Improved a few user facing messages.
|
||||
- Added pagination of output on cog update.
|
||||
- Added logging of failures.
|
||||
|
||||
Docs
|
||||
----
|
||||
|
||||
There's more detail to the below changes, so go read the docs.
|
||||
For some reason, documenting documentation changes is hard.
|
||||
|
||||
- Added instructions about git version.
|
||||
- Clarified instructions for installation and update.
|
||||
- Added more details to the API key reference.
|
||||
- Fixed some typos and versioning mistakes.
|
||||
|
||||
|
||||
Audio
|
||||
-----
|
||||
|
||||
Draper did things.
|
||||
|
||||
- No seriously, Draper did things.
|
||||
- Wait you wanted details? Ok, I guess we can share those.
|
||||
- Audio properly disconnects with autodisconnect, even if notify is being used.
|
||||
- Symbolic links now work as intended for local tracks.
|
||||
- Bump play now shows the correct time till next track.
|
||||
- Multiple user facing messages have been made more correct.
|
||||
|
||||
Redbot 3.2.2 (2020-01-10)
|
||||
=========================
|
||||
|
||||
Hotfixes
|
||||
--------
|
||||
|
||||
- Fix Help Pagination issue
|
||||
|
||||
Docs
|
||||
----
|
||||
|
||||
- Correct venv docs
|
||||
|
||||
|
||||
Redbot 3.2.1 (2020-01-10)
|
||||
=========================
|
||||
|
||||
Hotfixes
|
||||
--------
|
||||
|
||||
- Fix Mongo conversion from being incorrectly blocked
|
||||
- Fix announcer not creating a message for success feedback
|
||||
- Log an error with creating case types rather than crash
|
||||
|
||||
|
||||
Redbot 3.2.0 (2020-01-09)
|
||||
=========================
|
||||
Core Bot Changes
|
||||
----------------
|
||||
|
||||
Breaking Changes
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
- Modlog casetypes no longer have an attribute for auditlog action type. (`#2897 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2897>`_)
|
||||
- Removed ``redbot.core.modlog.get_next_case_number()``. (`#2908 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2908>`_)
|
||||
- Removed ``bank.MAX_BALANCE``, use ``bank.get_max_balance()`` from now on. (`#2926 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2926>`_)
|
||||
- The main bot config is no longer directly accessible to cogs. New methods have been added for use where this is concerned.
|
||||
New methods for this include
|
||||
|
||||
- ``bot.get_shared_api_tokens``
|
||||
- ``bot.set_shared_api_tokens``
|
||||
- ``bot.get_embed_color``
|
||||
- ``bot.get_embed_colour``
|
||||
- ``bot.get_admin_roles``
|
||||
- ``bot.get_admin_role_ids``
|
||||
- ``bot.get_mod_roles``
|
||||
- ``bot.get_mod_role_ids`` (`#2967 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2967>`_)
|
||||
- Reserved some command names for internal Red use. These are available programatically as ``redbot.core.commands.RESERVED_COMMAND_NAMES``. (`#2973 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2973>`_)
|
||||
- Removed ``bot._counter``, Made a few more attrs private (``cog_mgr``, ``main_dir``). (`#2976 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2976>`_)
|
||||
- Extension's ``setup()`` function should no longer assume that we are, or even will be connected to Discord.
|
||||
This also means that cog creators should no longer use ``bot.wait_until_ready()`` inside it. (`#3073 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3073>`_)
|
||||
- Removed the mongo driver. (`#3099 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3099>`_)
|
||||
|
||||
|
||||
Bug Fixes
|
||||
~~~~~~~~~
|
||||
|
||||
- Help now properly hides disabled commands. (`#2863 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2863>`_)
|
||||
- Fixed ``bot.remove_command`` throwing an error when trying to remove a non-existent command. (`#2888 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2888>`_)
|
||||
- ``Command.can_see`` now works as intended for disabled commands. (`#2892 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2892>`_)
|
||||
- Modlog entries now show up properly without the mod cog loaded. (`#2897 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2897>`_)
|
||||
- Fixed an error in ``[p]reason`` when setting the reason for a case without a moderator. (`#2908 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2908>`_)
|
||||
- Bank functions now check the recipient balance before transferring and stop the transfer if the recipient's balance will go above the maximum allowed balance. (`#2923 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2923>`_)
|
||||
- Removed potential for additional bad API calls per ban/unban. (`#2945 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2945>`_)
|
||||
- The ``[p]invite`` command no longer errors when a user has the bot blocked or DMs disabled in the server. (`#2948 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2948>`_)
|
||||
- Stopped using the ``:`` character in backup's filename - Windows doesn't accept it. (`#2954 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2954>`_)
|
||||
- ``redbot-setup delete`` no longer errors with "unexpected keyword argument". (`#2955 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2955>`_)
|
||||
- ``redbot-setup delete`` no longer prompts about backup when the user passes the option ``--no-prompt``. (`#2956 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2956>`_)
|
||||
- Cleaned up the ``[p]inviteset public`` and ``[p]inviteset perms`` help strings. (`#2963 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2963>`_)
|
||||
- ```[p]embedset user`` now only affects DM's. (`#2966 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2966>`_)
|
||||
- Fixed an unfriendly error when the provided instance name doesn't exist. (`#2968 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2968>`_)
|
||||
- Fixed the help text and response of ``[p]set usebotcolor`` to accurately reflect what the command is doing. (`#2974 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2974>`_)
|
||||
- Red no longer types infinitely when a command with a cooldown is called within the last second of a cooldown. (`#2985 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2985>`_)
|
||||
- Removed f-string usage in the launcher to prevent our error handling from causing an error. (`#3002 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3002>`_)
|
||||
- Fixed ``MessagePredicate.greater`` and ``MessagePredicate.less`` allowing any valid int instead of only valid ints/floats that are greater/less than the given value. (`#3004 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3004>`_)
|
||||
- Fixed an error in ``[p]uptime`` when the uptime is under a second. (`#3009 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3009>`_)
|
||||
- Added quotation marks to the response of ``[p]helpset tagline`` so that two consecutive full stops do not appear. (`#3010 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3010>`_)
|
||||
- Fixed an issue with clearing rules in permissions. (`#3014 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3014>`_)
|
||||
- Lavalink will now be restarted after an unexpected shutdown. (`#3033 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3033>`_)
|
||||
- Added a 3rd-party lib folder to ``sys.path`` before loading cogs. This prevents issues with 3rd-party cogs failing to load when Downloader is not loaded to install requirements. (`#3036 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3036>`_)
|
||||
- Escaped track descriptions so that they do not break markdown. (`#3047 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3047>`_)
|
||||
- Red will now properly send a message when the invoked command is guild-only. (`#3057 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3057>`_)
|
||||
- Arguments ``--co-owner`` and ``--load-cogs`` now properly require at least one argument to be passed. (`#3060 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3060>`_)
|
||||
- Now always appends the 3rd-party lib folder to the end of ``sys.path`` to avoid shadowing Red's dependencies. (`#3062 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3062>`_)
|
||||
- Fixed ``is_automod_immune``'s handling of the guild check and added support for checking webhooks. (`#3100 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3100>`_)
|
||||
- Fixed the generation of the ``repos.json`` file in the backup process. (`#3114 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3114>`_)
|
||||
- Fixed an issue where calling audio commands when not in a voice channel could result in a crash. (`#3120 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3120>`_)
|
||||
- Added handling for invalid folder names in the data path gracefully in ``redbot-setup`` and ``redbot --edit``. (`#3171 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3171>`_)
|
||||
- ``--owner`` and ``-p`` cli flags now work when added from launcher. (`#3174 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3174>`_)
|
||||
- Red will now prevent users from locking themselves out with localblacklist. (`#3207 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3207>`_)
|
||||
- Fixed help ending up a little too large for discord embed limits. (`#3208 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3208>`_)
|
||||
- Fixed formatting issues in commands that list whitelisted/blacklisted users/roles when the list is empty. (`#3219 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3219>`_)
|
||||
- Red will now prevent users from locking the guild owner out with localblacklist (unless the command caller is bot owner). (`#3221 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3221>`_)
|
||||
- Guild owners are no longer affected by the local whitelist and blacklist. (`#3221 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3221>`_)
|
||||
- Fixed an attribute error that can be raised in ``humanize_timedelta`` if ``seconds = 0``. (`#3231 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3231>`_)
|
||||
- Fixed ``ctx.clean_prefix`` issues resulting from undocumented changes from discord. (`#3249 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3249>`_)
|
||||
- ``redbot.core.bot.Bot.owner_id`` is now set in the post connection startup. (`#3273 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3273>`_)
|
||||
- ``redbot.core.bot.Bot.send_to_owners()`` and ``redbot.core.bot.Bot.get_owner_notification_destinations()`` now wait until Red is done with post connection startup to ensure owner ID is available. (`#3273 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3273>`_)
|
||||
|
||||
|
||||
Enhancements
|
||||
~~~~~~~~~~~~
|
||||
|
||||
- Added the option to modify the RPC port with the ``--rpc-port`` flag. (`#2429 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2429>`_)
|
||||
- Slots now has a 62.5% expected payout and will not inflate economy when spammed. (`#2875 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2875>`_)
|
||||
- Allowed passing ``cls`` in the ``redbot.core.commands.group()`` decorator. (`#2881 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2881>`_)
|
||||
- Red's Help Formatter is now considered to have a stable API. (`#2892 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2892>`_)
|
||||
- Modlog no longer generates cases without being told to for actions the bot did. (`#2897 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2897>`_)
|
||||
- Some generic modlog casetypes are now pre-registered for cog creator use. (`#2897 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2897>`_)
|
||||
- ModLog is now much faster at creating cases, especially in large servers. (`#2908 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2908>`_)
|
||||
- JSON config files are now stored without indentation, this is to reduce the file size and increase the performance of write operations. (`#2921 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2921>`_)
|
||||
- ``--[no-]backup``, ``--[no-]drop-db`` and ``--[no-]remove-datapath`` in the ``redbot-setup delete`` command are now on/off flags. (`#2958 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2958>`_)
|
||||
- The confirmation prompts in ``redbot-setup`` now have default values for user convenience. (`#2958 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2958>`_)
|
||||
- ``redbot-setup delete`` now has the option to leave Red's data untouched on database backends. (`#2962 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2962>`_)
|
||||
- Red now takes less time to fetch cases, unban members, and list warnings. (`#2964 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2964>`_)
|
||||
- Red now handles more things prior to connecting to discord to reduce issues during the initial load. (`#3045 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3045>`_)
|
||||
- ``bot.send_filtered`` now returns the message that is sent. (`#3052 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3052>`_)
|
||||
- Red will now send a message when the invoked command is DM-only. (`#3057 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3057>`_)
|
||||
- All ``y/n`` confirmations in cli commands are now unified. (`#3060 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3060>`_)
|
||||
- Changed ``[p]info`` to say "This bot is an..." instead of "This is an..." for clarity. (`#3121 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3121>`_)
|
||||
- ``redbot-setup`` will now use the instance name in default data paths to avoid creating a second instance with the same data path. (`#3171 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3171>`_)
|
||||
- Instance names can now only include characters A-z, numbers, underscores, and hyphens. Old instances are unaffected by this change. (`#3171 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3171>`_)
|
||||
- Clarified that ``[p]backup`` saves the **bot's** data in the help text. (`#3172 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3172>`_)
|
||||
- Added ``redbot --debuginfo`` flag which shows useful information for debugging. (`#3183 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3183>`_)
|
||||
- Added the Python executable field to ``[p]debuginfo``. (`#3184 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3184>`_)
|
||||
- When Red prompts for a token, it will now print a link to the guide explaining how to obtain a token. (`#3204 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3204>`_)
|
||||
- ``redbot-setup`` will no longer log to disk. (`#3269 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3269>`_)
|
||||
- ``redbot.core.bot.Bot.send_to_owners()`` and ``redbot.core.bot.Bot.get_owner_notification_destinations()`` now log when they are not able to find the owner notification destination. (`#3273 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3273>`_)
|
||||
- The lib folder is now cleared on minor Python version changes. ``[p]cog reinstallreqs`` in Downloader can be used to regenerate the lib folder for a new Python version. (`#3274 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3274>`_)
|
||||
- If Red detects operating system or architecture change, it will now warn the owner about possible problems with the lib folder. (`#3274 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3274>`_)
|
||||
- ``[p]playlist download`` will now compress playlists larger than the server attachment limit and attempt to send that. (`#3279 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3279>`_)
|
||||
|
||||
|
||||
New Features
|
||||
~~~~~~~~~~~~
|
||||
|
||||
- Added functions to acquire locks on Config groups and values. These locks are acquired by default when calling a value as a context manager. See ``Value.get_lock`` for details. (`#2654 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2654>`_)
|
||||
- Added a config driver for PostgreSQL. (`#2723 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2723>`_)
|
||||
- Added methods to Config for accessing things by id without mocked objects
|
||||
|
||||
- ``Config.guild_from_id``
|
||||
- ``Config.user_from_id``
|
||||
- ``Config.role_from_id``
|
||||
- ``Config.channel_from_id``
|
||||
- ``Config.member_from_ids``
|
||||
- This one requires multiple ids, one for the guild, one for the user
|
||||
- Consequence of discord's object model (`#2804 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2804>`_)
|
||||
- New method ``humanize_number`` in ``redbot.core.utils.chat_formatting`` to convert numbers into text that respects the current locale. (`#2836 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2836>`_)
|
||||
- Added new commands to Economy
|
||||
|
||||
- ``[p]bank prune user`` - This will delete a user's bank account.
|
||||
- ``[p]bank prune local`` - This will prune the bank of accounts for users who are no longer in the server.
|
||||
- ``[p]bank prune global`` - This will prune the global bank of accounts for users who do not share any servers with the bot. (`#2845 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2845>`_)
|
||||
- Red now uses towncrier for changelog generation. (`#2872 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2872>`_)
|
||||
- Added ``redbot.core.modlog.get_latest_case`` to fetch the case object for the most recent ModLog case. (`#2908 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2908>`_)
|
||||
- Added ``[p]bankset maxbal`` to set the maximum bank balance. (`#2926 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2926>`_)
|
||||
- Added a few methods and classes replacing direct config access (which is no longer supported)
|
||||
|
||||
- ``redbot.core.Red.allowed_by_whitelist_blacklist``
|
||||
- ``redbot.core.Red.get_valid_prefixes``
|
||||
- ``redbot.core.Red.clear_shared_api_tokens``
|
||||
- ``redbot.core.commands.help.HelpSettings`` (`#2976 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2976>`_)
|
||||
- Added the cli flag ``redbot --edit`` which is used to edit the instance name, token, owner, and datapath. (`#3060 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3060>`_)
|
||||
- Added ``[p]licenseinfo``. (`#3090 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3090>`_)
|
||||
- Ensured that people can migrate from MongoDB. (`#3108 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3108>`_)
|
||||
- Added a command to list disabled commands globally or per guild. (`#3118 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3118>`_)
|
||||
- New event ``on_red_api_tokens_update`` is now dispatched when shared api keys for a service are updated. (`#3134 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3134>`_)
|
||||
- Added ``redbot-setup backup``. (`#3235 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3235>`_)
|
||||
- Added the method ``redbot.core.bot.Bot.wait_until_red_ready()`` that waits until Red's post connection startup is done. (`#3273 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3273>`_)
|
||||
|
||||
|
||||
Removals
|
||||
~~~~~~~~
|
||||
|
||||
- ``[p]set owner`` and ``[p]set token`` have been removed in favor of managing server side. (`#2928 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2928>`_)
|
||||
- Shared libraries are marked for removal in Red 3.4. (`#3106 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3106>`_)
|
||||
- Removed ``[p]backup``. Use the cli command ``redbot-setup backup`` instead. (`#3235 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3235>`_)
|
||||
- Removed the functions ``safe_delete``, ``fuzzy_command_search``, ``format_fuzzy_results`` and ``create_backup`` from ``redbot.core.utils``. (`#3240 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3240>`_)
|
||||
- Removed a lot of the launcher's handled behavior. (`#3289 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3289>`_)
|
||||
|
||||
|
||||
Miscellaneous changes
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- `#2527 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2527>`_, `#2571 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2571>`_, `#2723 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2723>`_, `#2836 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2836>`_, `#2849 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2849>`_, `#2861 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2861>`_, `#2885 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2885>`_, `#2890 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2890>`_, `#2897 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2897>`_, `#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_, `#2924 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2924>`_, `#2939 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2939>`_, `#2940 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2940>`_, `#2941 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2941>`_, `#2949 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2949>`_, `#2953 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2953>`_, `#2964 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2964>`_, `#2986 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2986>`_, `#2993 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2993>`_, `#2997 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2997>`_, `#3008 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3008>`_, `#3017 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3017>`_, `#3048 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3048>`_, `#3059 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3059>`_, `#3080 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3080>`_, `#3089 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3089>`_, `#3104 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3104>`_, `#3106 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3106>`_, `#3129 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3129>`_, `#3152 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3152>`_, `#3160 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3160>`_, `#3168 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3168>`_, `#3173 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3173>`_, `#3176 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3176>`_, `#3186 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3186>`_, `#3192 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3192>`_, `#3193 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3193>`_, `#3195 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3195>`_, `#3202 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3202>`_, `#3214 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3214>`_, `#3223 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3223>`_, `#3229 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3229>`_, `#3245 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3245>`_, `#3247 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3247>`_, `#3248 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3248>`_, `#3250 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3250>`_, `#3254 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3254>`_, `#3255 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3255>`_, `#3256 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3256>`_, `#3258 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3258>`_, `#3261 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3261>`_, `#3275 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3275>`_, `#3276 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3276>`_, `#3293 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3293>`_, `#3278 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3278>`_, `#3285 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3285>`_, `#3296 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3296>`_,
|
||||
|
||||
|
||||
Dependency changes
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Added ``pytest-mock`` requirement to ``tests`` extra. (`#2571 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2571>`_)
|
||||
- Updated the python minimum requirement to 3.8.1, updated JRE to Java 11. (`#3245 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3245>`_)
|
||||
- Bumped dependency versions. (`#3288 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3288>`_)
|
||||
- Bumped red-lavalink version. (`#3290 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3290>`_)
|
||||
|
||||
|
||||
Documentation Changes
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Started the user guides covering cogs and the user interface of the bot. This includes, for now, a "Getting started" guide. (`#1734 <https://github.com/Cog-Creators/Red-DiscordBot/issues/1734>`_)
|
||||
- Added documentation for PM2 support. (`#2105 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2105>`_)
|
||||
- Updated linux install docs, adding sections for Fedora Linux, Debian/Raspbian Buster, and openSUSE. (`#2558 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2558>`_)
|
||||
- Created documentation covering what we consider a developer facing breaking change and the guarantees regarding them. (`#2882 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2882>`_)
|
||||
- Fixed the user parameter being labeled as ``discord.TextChannel`` instead of ``discord.abc.User`` in ``redbot.core.utils.predicates``. (`#2914 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2914>`_)
|
||||
- Updated towncrier info in the contribution guidelines to explain how to create a changelog for a standalone PR. (`#2915 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2915>`_)
|
||||
- Reworded the virtual environment guide to make it sound less scary. (`#2920 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2920>`_)
|
||||
- Driver docs no longer show twice. (`#2972 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2972>`_)
|
||||
- Added more information about ``redbot.core.utils.humanize_timedelta`` into the docs. (`#2986 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2986>`_)
|
||||
- Added a direct link to the "Installing Red" section in "Installing using powershell and chocolatey". (`#2995 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2995>`_)
|
||||
- Updated Git PATH install (Windows), capitalized some words, stopped mentioning the launcher. (`#2998 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2998>`_)
|
||||
- Added autostart documentation for Red users who installed Red inside of a virtual environment. (`#3005 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3005>`_)
|
||||
- Updated the Cog Creation guide with a note regarding the Develop version as well as the folder layout for local cogs. (`#3021 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3021>`_)
|
||||
- Added links to the getting started guide at the end of installation guides. (`#3025 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3025>`_)
|
||||
- Added proper docstrings to enums that show in drivers docs. (`#3035 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3035>`_)
|
||||
- Discord.py doc links will now always use the docs for the currently used version of discord.py. (`#3053 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3053>`_)
|
||||
- Added ``|DPY_VERSION|`` substitution that will automatically get replaced by the current discord.py version. (`#3053 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3053>`_)
|
||||
- Added missing descriptions for function returns. (`#3054 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3054>`_)
|
||||
- Stopped overwriting the ``docs/prolog.txt`` file in ``conf.py``. (`#3082 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3082>`_)
|
||||
- Fixed some typos and wording, added MS Azure to the host list. (`#3083 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3083>`_)
|
||||
- Updated the docs footer copyright to 2019. (`#3105 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3105>`_)
|
||||
- Added a deprecation note about shared libraries in the Downloader Framework docs. (`#3106 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3106>`_)
|
||||
- Updated the apikey framework documentation. Changed ``bot.get_shared_api_keys()`` to ``bot.get_shared_api_tokens()``. (`#3110 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3110>`_)
|
||||
- Added information about ``info.json``'s ``min_python_version`` key in Downloader Framework docs. (`#3124 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3124>`_)
|
||||
- Added an event reference for the ``on_red_api_tokens_update`` event in the Shared API Keys docs. (`#3134 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3134>`_)
|
||||
- Added notes explaining the best practices with config. (`#3149 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3149>`_)
|
||||
- Documented additional attributes in Context. (`#3151 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3151>`_)
|
||||
- Updated Windows docs with up to date dependency instructions. (`#3188 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3188>`_)
|
||||
- Added a "Publishing cogs for V3" document explaining how to make user's cogs work with Downloader. (`#3234 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3234>`_)
|
||||
- Fixed broken docs for ``redbot.core.commands.Context.react_quietly``. (`#3257 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3257>`_)
|
||||
- Updated copyright notices on License and RTD config to 2020. (`#3259 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3259>`_)
|
||||
- Added a line about setuptools and wheel. (`#3262 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3262>`_)
|
||||
- Ensured development builds are not advertised to the wrong audience. (`#3292 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3292>`_)
|
||||
- Clarified the usage intent of some of the chat formatting functions. (`#3292 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3292>`_)
|
||||
|
||||
|
||||
Admin
|
||||
-----
|
||||
|
||||
Breaking Changes
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
- Changed ``[p]announce ignore`` and ``[p]announce channel`` to ``[p]announceset ignore`` and ``[p]announceset channel``. (`#3250 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3250>`_)
|
||||
- Changed ``[p]selfrole <role>`` to ``[p]selfrole add <role>``, changed ``[p]selfrole add`` to ``[p]selfroleset add`` , and changed ``[p]selfrole delete`` to ``[p]selfroleset remove``. (`#3250 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3250>`_)
|
||||
|
||||
|
||||
Bug Fixes
|
||||
~~~~~~~~~
|
||||
|
||||
- Fixed ``[p]announce`` failing after encountering an error attempting to message the bot owner. (`#3166 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3166>`_)
|
||||
- Improved the clarity of user facing messages when the user is not allowed to do something due to Discord hierarchy rules. (`#3250 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3250>`_)
|
||||
- Fixed some role managing commands not properly checking if Red had ``manage_roles`` perms before attempting to manage roles. (`#3250 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3250>`_)
|
||||
- Fixed ``[p]editrole`` commands not checking if roles to be edited are higher than Red's highest role before trying to edit them. (`#3250 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3250>`_)
|
||||
- Fixed ``[p]announce ignore`` and ``[p]announce channel`` not being able to be used by guild owners and administrators. (`#3250 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3250>`_)
|
||||
|
||||
|
||||
Enhancements
|
||||
~~~~~~~~~~~~
|
||||
|
||||
- Added custom issue messages for adding and removing roles, this makes it easier to create translations. (`#3016 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3016>`_)
|
||||
|
||||
|
||||
Audio
|
||||
-----
|
||||
|
||||
Bug Fixes
|
||||
~~~~~~~~~
|
||||
|
||||
- ``[p]playlist remove`` now removes the playlist url if the playlist was created through ``[p]playlist save``. (`#2861 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2861>`_)
|
||||
- Users are no longer able to accidentally overwrite existing playlist if a new one with the same name is created/renamed. (`#2861 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2861>`_)
|
||||
- ``[p]audioset settings`` no longer shows lavalink JAR version. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- Fixed a ``KeyError: loadType`` when trying to play tracks. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- ``[p]audioset settings`` now uses ``ctx.is_owner()`` to check if the context author is the bot owner. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- Fixed track indexs being off by 1 in ``[p]search``. (`#2940 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2940>`_)
|
||||
- Fixed an issue where updating your Spotify and YouTube Data API tokens did not refresh them. (`#3047 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3047>`_)
|
||||
- Fixed an issue where the blacklist was not being applied correctly. (`#3047 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3047>`_)
|
||||
- Fixed an issue in ``[p]audioset restrictions blacklist list`` where it would call the list a ``Whitelist``. (`#3047 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3047>`_)
|
||||
- Red's status is now properly cleared on emptydisconnect. (`#3050 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3050>`_)
|
||||
- Fixed a console spam caused sometimes when auto disconnect and auto pause are used. (`#3123 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3123>`_)
|
||||
- Fixed an error that was thrown when running ``[p]audioset dj``. (`#3165 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3165>`_)
|
||||
- Fixed a crash that could happen when the bot can't connect to the lavalink node. (`#3238 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3238>`_)
|
||||
- Restricted the number of songs shown in the queue to first 500 to avoid heartbeats. (`#3279 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3279>`_)
|
||||
- Added more cooldowns to playlist commands and restricted the queue and playlists to 10k songs to avoid bot errors. (`#3286 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3286>`_)
|
||||
|
||||
|
||||
Enhancements
|
||||
~~~~~~~~~~~~
|
||||
|
||||
- ``[p]playlist upload`` will now load playlists generated via ``[p]playlist download`` much faster if the playlist uses the new scheme. (`#2861 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2861>`_)
|
||||
- ``[p]playlist`` commands now can be used by everyone regardless of DJ settings, however it will respect DJ settings when creating/modifying playlists in the server scope. (`#2861 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2861>`_)
|
||||
- Spotify, Youtube Data, and Lavalink API calls can be cached to avoid repeated calls in the future, see ``[p]audioset cache``. (`#2890 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2890>`_)
|
||||
- Playlists will now start playing as soon as first track is loaded. (`#2890 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2890>`_)
|
||||
- ``[p]audioset localpath`` can set a path anywhere in your machine now. Note: This path needs to be visible by ``Lavalink.jar``. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- ``[p]queue`` now works when there are no tracks in the queue, showing the track currently playing. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- ``[p]audioset settings`` now reports Red Lavalink version. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- Adding and removing reactions in Audio is no longer a blocking action. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- When shuffle is on, queue now shows the correct play order. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- ``[p]seek`` and ``[p]skip`` can be used by user if they are the song requester while DJ mode is enabled and votes are disabled. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- Adding a playlist and an album to a saved playlist skips tracks already in the playlist. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- DJ mode is now turned off if the DJ role is deleted. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- When playing a localtrack, ``[p]play`` and ``[p]bumpplay`` no longer require the use of the prefix "localtracks\\".
|
||||
|
||||
Before: ``[p]bumpplay localtracks\\ENM\\501 - Inside The Machine.mp3``
|
||||
Now: ``[p]bumpplay ENM\\501 - Inside The Machine.mp3``
|
||||
Now nested folders: ``[p]bumpplay Parent Folder\\Nested Folder\\track.mp3`` (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- Removed commas in explanations about how to set API keys. (`#2905 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2905>`_)
|
||||
- Expanded local track support to all file formats (m3u, m4a, mp4, etc). (`#2940 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2940>`_)
|
||||
- Cooldowns are now reset upon failure of commands that have a cooldown timer. (`#2940 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2940>`_)
|
||||
- Improved the explanation in the help string for ``[p]audioset emptydisconnect``. (`#3051 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3051>`_)
|
||||
- Added a typing indicator to playlist dedupe. (`#3058 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3058>`_)
|
||||
- Exposed clearer errors to users in the play commands. (`#3085 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3085>`_)
|
||||
- Better error handling when the player is unable to play multiple tracks in the sequence. (`#3165 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3165>`_)
|
||||
|
||||
|
||||
New Features
|
||||
~~~~~~~~~~~~
|
||||
|
||||
- Added support for nested folders in the localtrack folder. (`#270 <https://github.com/Cog-Creators/Red-DiscordBot/issues/270>`_)
|
||||
- Now auto pauses the queue when the voice channel is empty. (`#721 <https://github.com/Cog-Creators/Red-DiscordBot/issues/721>`_)
|
||||
- All Playlist commands now accept optional arguments, use ``[p]help playlist <subcommand>`` for more details. (`#2861 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2861>`_)
|
||||
- ``[p]playlist rename`` will now allow users to rename existing playlists. (`#2861 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2861>`_)
|
||||
- ``[p]playlist update`` will now allow users to update non-custom Playlists to the latest available tracks. (`#2861 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2861>`_)
|
||||
- There are now 3 different scopes of playlist. To define them, use the ``--scope`` argument.
|
||||
|
||||
``Global Playlist``
|
||||
|
||||
- These playlists will be available in all servers the bot is in.
|
||||
- These can be managed by the Bot Owner only.
|
||||
|
||||
``Server Playlist``
|
||||
|
||||
- These playlists will only be available in the server they were created in.
|
||||
- These can be managed by the Bot Owner, Guild Owner, Mods, Admins, DJs, and the Creator (if the DJ role is disabled).
|
||||
|
||||
``User Playlist``
|
||||
|
||||
- These playlists will be available in all servers both the bot and the creator are in.
|
||||
- These can be managed by the Bot Owner and Creator only. (`#2861 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2861>`_)
|
||||
- ``[p]audioset cache`` can be used to set the cache level. **It's off by default**. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- ``[p]genre`` can be used to play spotify playlists. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- ``[p]audioset cacheage`` can be used to set the maximum age of an entry in the cache. **Default is 365 days**. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- ``[p]audioset autoplay`` can be used to enable auto play once the queue runs out. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- New events dispatched by Audio.
|
||||
|
||||
- ``on_red_audio_track_start(guild: discord.Guild, track: lavalink.Track, requester: discord.Member)``
|
||||
- ``on_red_audio_track_end(guild: discord.Guild, track: lavalink.Track, requester: discord.Member)``
|
||||
- ``on_red_audio_track_enqueue(guild: discord.Guild, track: lavalink.Track, requester: discord.Member)``
|
||||
- ``on_red_audio_track_auto_play(guild: discord.Guild, track: lavalink.Track, requester: discord.Member)``
|
||||
- ``on_red_audio_queue_end(guild: discord.Guild, track: lavalink.Track, requester: discord.Member)``
|
||||
- ``on_red_audio_audio_disconnect(guild: discord.Guild)``
|
||||
- ``on_red_audio_skip_track(guild: discord.Guild, track: lavalink.Track, requester: discord.Member)`` (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- ``[p]queue shuffle`` can be used to shuffle the queue manually. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- ``[p]queue clean self`` can be used to remove all songs you requested from the queue. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- ``[p]audioset restrictions`` can be used to add or remove keywords which songs must have or are not allowed to have. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- ``[p]playlist dedupe`` can be used to remove duplicated tracks from a playlist. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- ``[p]autoplay`` can be used to play a random song. (`#2904 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2904>`_)
|
||||
- ``[p]bumpplay`` can be used to add a song to the front of the queue. (`#2940 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2940>`_)
|
||||
- ``[p]shuffle`` has an additional argument to tell the bot whether it should shuffle bumped tracks. (`#2940 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2940>`_)
|
||||
- Added global whitelist/blacklist commands. (`#3047 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3047>`_)
|
||||
- Added self-managed daily playlists in the GUILD scope, these are called "Daily playlist - YYYY-MM-DD" and auto delete after 7 days. (`#3199 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3199>`_)
|
||||
|
||||
|
||||
CustomCom
|
||||
---------
|
||||
|
||||
Enhancements
|
||||
~~~~~~~~~~~~
|
||||
|
||||
- The group command ``[p]cc create`` can now be used to create simple CCs without specifying "simple". (`#1767 <https://github.com/Cog-Creators/Red-DiscordBot/issues/1767>`_)
|
||||
- Added a query option for CC typehints for URL-based CCs. (`#3228 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3228>`_)
|
||||
- Now uses the ``humanize_list`` utility for iterable parameter results, e.g. ``{#:Role.members}``. (`#3277 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3277>`_)
|
||||
|
||||
|
||||
Downloader
|
||||
----------
|
||||
|
||||
Bug Fixes
|
||||
~~~~~~~~~
|
||||
|
||||
- Made the regex for repo names use raw strings to stop causing a ``DeprecationWarning`` for invalid escape sequences. (`#2571 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2571>`_)
|
||||
- Downloader will no longer attempt to install cogs that are already installed. (`#2571 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2571>`_)
|
||||
- Repo names can now only contain the characters listed in the help text (A-Z, 0-9, underscores, and hyphens). (`#2827 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2827>`_)
|
||||
- ``[p]findcog`` no longer attempts to find a cog for commands without a cog. (`#2902 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2902>`_)
|
||||
- Downloader will no longer attempt to install a cog with same name as another cog that is already installed. (`#2927 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2927>`_)
|
||||
- Added error handling for when a remote repository or branch is deleted, now notifies the which repository failed and continues to update the others. (`#2936 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2936>`_)
|
||||
- ``[p]cog install`` will no longer error if a cog has an empty install message. (`#3024 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3024>`_)
|
||||
- Made ``redbot.cogs.downloader.repo_manager.Repo.clean_url`` work with relative urls. This property is ``str`` type now. (`#3141 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3141>`_)
|
||||
- Fixed an error on repo add from empty string values for the ``install_msg`` info.json field. (`#3153 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3153>`_)
|
||||
- Disabled all git auth prompts when adding/updating a repo with Downloader. (`#3159 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3159>`_)
|
||||
- ``[p]findcog`` now properly works for cogs with less typical folder structure. (`#3177 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3177>`_)
|
||||
- ``[p]cog uninstall`` now fully unloads cog - the bot will not try to load it on next startup. (`#3179 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3179>`_)
|
||||
|
||||
|
||||
Enhancements
|
||||
~~~~~~~~~~~~
|
||||
|
||||
- Downloader will now check if the Python and bot versions match requirements in ``info.json`` during update. (`#1866 <https://github.com/Cog-Creators/Red-DiscordBot/issues/1866>`_)
|
||||
- ``[p]cog install`` now accepts multiple cog names. (`#2527 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2527>`_)
|
||||
- When passing cogs to ``[p]cog update``, it will now only update those cogs, not all cogs from the repo those cogs are from. (`#2527 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2527>`_)
|
||||
- Added error messages for failures when installing/reinstalling requirements and copying cogs and shared libraries. (`#2571 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2571>`_)
|
||||
- ``[p]findcog`` now uses sanitized urls (without HTTP Basic Auth fragments). (`#3129 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3129>`_)
|
||||
- ``[p]repo info`` will now show the repo's url, branch, and authors. (`#3225 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3225>`_)
|
||||
- ``[p]cog info`` will now show cog authors. (`#3225 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3225>`_)
|
||||
- ``[p]findcog`` will now show the repo's branch. (`#3225 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3225>`_)
|
||||
|
||||
|
||||
New Features
|
||||
~~~~~~~~~~~~
|
||||
|
||||
- Added ``[p]repo update [repos]`` which updates repos without updating the cogs from them. (`#2527 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2527>`_)
|
||||
- Added ``[p]cog installversion <repo_name> <revision> <cogs>`` which installs cogs from a specified revision (commit, tag) of the given repo. When using this command, the cog will automatically be pinned. (`#2527 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2527>`_)
|
||||
- Added ``[p]cog pin <cogs>`` and ``[p]cog unpin <cogs>`` for pinning cogs. Cogs that are pinned will not be updated when using update commands. (`#2527 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2527>`_)
|
||||
- Added ``[p]cog checkforupdates`` that lists which cogs can be updated (including pinned cog) without updating them. (`#2527 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2527>`_)
|
||||
- Added ``[p]cog updateallfromrepos <repos>`` that updates all cogs from the given repos. (`#2527 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2527>`_)
|
||||
- Added ``[p]cog updatetoversion <repo_name> <revision> [cogs]`` that updates all cogs or ones of user's choosing to chosen revision of the given repo. (`#2527 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2527>`_)
|
||||
- Added ``[p]cog reinstallreqs`` that reinstalls cog requirements and shared libraries for all installed cogs. (`#3167 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3167>`_)
|
||||
|
||||
|
||||
Documentation Changes
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
- Added ``redbot.cogs.downloader.installable.InstalledModule`` to Downloader's framework docs. (`#2527 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2527>`_)
|
||||
- Removed API References for Downloader. (`#3234 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3234>`_)
|
||||
|
||||
|
||||
Image
|
||||
-----
|
||||
|
||||
Enhancements
|
||||
~~~~~~~~~~~~
|
||||
|
||||
- Updated the giphycreds command to match the formatting of the other API commands. (`#2905 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2905>`_)
|
||||
- Removed commas from explanations about how to set API keys. (`#2905 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2905>`_)
|
||||
|
||||
|
||||
Mod
|
||||
---
|
||||
|
||||
Bug Fixes
|
||||
~~~~~~~~~
|
||||
|
||||
- ``[p]userinfo`` no longer breaks when a user has an absurd numbers of roles. (`#2910 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2910>`_)
|
||||
- Fixed Mod cog not recording username changes for ``[p]names`` and ``[p]userinfo`` commands. (`#2918 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2918>`_)
|
||||
- Fixed ``[p]modset deletedelay`` deleting non-command messages. (`#2924 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2924>`_)
|
||||
- Fixed an error when reloading Mod. (`#2932 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2932>`_)
|
||||
|
||||
|
||||
Enhancements
|
||||
~~~~~~~~~~~~
|
||||
|
||||
- Slowmode now accepts integer-only inputs as seconds. (`#2884 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2884>`_)
|
||||
|
||||
|
||||
Permissions
|
||||
-----------
|
||||
|
||||
Bug Fixes
|
||||
~~~~~~~~~
|
||||
|
||||
- Defaults are now cleared properly when clearing all rules. (`#3037 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3037>`_)
|
||||
|
||||
|
||||
Enhancements
|
||||
~~~~~~~~~~~~
|
||||
|
||||
- Better explained the usage of commands with the ``<who_or_what>`` argument. (`#2991 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2991>`_)
|
||||
|
||||
|
||||
Streams
|
||||
-------
|
||||
|
||||
Bug Fixes
|
||||
~~~~~~~~~
|
||||
|
||||
- Fixed a ``TypeError`` in the ``TwitchStream`` class when calling Twitch client_id from Red shared APIs tokens. (`#3042 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3042>`_)
|
||||
- Changed the ``stream_alert`` function for Twitch alerts to make it work with how the ``TwitchStream`` class works now. (`#3042 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3042>`_)
|
||||
|
||||
|
||||
Enhancements
|
||||
~~~~~~~~~~~~
|
||||
|
||||
- Removed commas from explanations about how to set API keys. (`#2905 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2905>`_)
|
||||
|
||||
|
||||
Trivia
|
||||
------
|
||||
|
||||
Bug Fixes
|
||||
~~~~~~~~~
|
||||
|
||||
- Fixed a typo in Ahsoka Tano's name in the Starwars trivia list. (`#2909 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2909>`_)
|
||||
- Fixed a bug where ``[p]trivia leaderboard`` failed to run. (`#2911 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2911>`_)
|
||||
- Fixed a typo in the Greek mythology trivia list regarding Hermes' staff. (`#2994 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2994>`_)
|
||||
- Fixed a question in the Overwatch trivia list that accepted blank responses. (`#2996 <https://github.com/Cog-Creators/Red-DiscordBot/issues/2996>`_)
|
||||
- Fixed questions and answers that were incorrect in the Clash Royale trivia list. (`#3236 <https://github.com/Cog-Creators/Red-DiscordBot/issues/3236>`_)
|
||||
|
||||
|
||||
Enhancements
|
||||
~~~~~~~~~~~~
|
||||
|
||||
- Added trivia lists for Prince and Michael Jackson lyrics. (`#12 <https://github.com/Cog-Creators/Red-DiscordBot/issues/12>`_)
|
||||
@@ -1,910 +0,0 @@
|
||||
.. 3.3.x Changelogs
|
||||
|
||||
Redbot 3.3.12 (2020-08-18)
|
||||
==========================
|
||||
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
| :ghuser:`Dav-Git`, :ghuser:`douglas-cpp`, :ghuser:`flaree`, :ghuser:`jack1142`, :ghuser:`Kowlin`, :ghuser:`MeatyChunks`, :ghuser:`PredaaA`, :ghuser:`Predeactor`, :ghuser:`thisisjvgrace`, :ghuser:`Vexed01`, :ghuser:`zephyrkul`
|
||||
|
||||
End-user changelog
|
||||
------------------
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Red now logs clearer error if it can't find package to load in any cog path during bot startup (:issue:`4079`)
|
||||
|
||||
Mod
|
||||
***
|
||||
|
||||
- ``[p]mute voice`` and ``[p]unmute voice`` now take action instantly if bot has Move Members permission (:issue:`4064`)
|
||||
- Added typing to ``[p](un)mute guild`` to indicate that mute is being processed (:issue:`4066`, :issue:`4172`)
|
||||
|
||||
Streams
|
||||
*******
|
||||
|
||||
- Improve error messages for invalid channel names/IDs (:issue:`4147`, :issue:`4148`)
|
||||
|
||||
Trivia Lists
|
||||
************
|
||||
|
||||
- Added ``whosthatpokemon2`` trivia containing Pokémons from 2nd generation (:issue:`4102`)
|
||||
- Added ``whosthatpokemon3`` trivia containing Pokémons from 3rd generation (:issue:`4141`)
|
||||
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
- Updated features list in ``[p]serverinfo`` with the latest changes from Discord (:issue:`4116`)
|
||||
- Simple version of ``[p]serverinfo`` now shows info about more detailed ``[p]serverinfo 1`` (:issue:`4121`)
|
||||
|
||||
|
||||
Redbot 3.3.11 (2020-08-10)
|
||||
==========================
|
||||
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
| :ghuser:`douglas-cpp`, :ghuser:`Drapersniper`, :ghuser:`Flame`, :ghuser:`jack1142`, :ghuser:`MeatyChunks`, :ghuser:`Vexed01`, :ghuser:`yamikaitou`
|
||||
|
||||
End-user changelog
|
||||
------------------
|
||||
|
||||
Audio
|
||||
*****
|
||||
|
||||
- Audio should now work again on all voice regions (:issue:`4162`, :issue:`4168`)
|
||||
- Removed an edge case where an unfriendly error message was sent in Audio cog (:issue:`3879`)
|
||||
|
||||
Cleanup
|
||||
*******
|
||||
|
||||
- Fixed a bug causing ``[p]cleanup`` commands to clear all messages within last 2 weeks when ``0`` is passed as the amount of messages to delete (:issue:`4114`, :issue:`4115`)
|
||||
|
||||
CustomCommands
|
||||
**************
|
||||
|
||||
- ``[p]cc show`` now sends an error message when command with the provided name couldn't be found (:issue:`4108`)
|
||||
|
||||
Downloader
|
||||
**********
|
||||
|
||||
- ``[p]findcog`` no longer fails for 3rd-party cogs without any author (:issue:`4032`, :issue:`4042`)
|
||||
- Update commands no longer crash when a different repo is added under a repo name that was once used (:issue:`4086`)
|
||||
|
||||
Permissions
|
||||
***********
|
||||
|
||||
- ``[p]permissions removeserverrule`` and ``[p]permissions removeglobalrule`` no longer error when trying to remove a rule that doesn't exist (:issue:`4028`, :issue:`4036`)
|
||||
|
||||
Warnings
|
||||
********
|
||||
|
||||
- ``[p]warn`` now sends an error message (instead of no feedback) when an unregistered reason is used by someone who doesn't have Administrator permission (:issue:`3839`, :issue:`3840`)
|
||||
|
||||
|
||||
Redbot 3.3.10 (2020-07-09)
|
||||
==========================
|
||||
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
| :ghuser:`aikaterna`, :ghuser:`bobloy`, :ghuser:`Dav-Git`, :ghuser:`Drapersniper`, :ghuser:`Flame442`, :ghuser:`flaree`, :ghuser:`Injabie3`, :ghuser:`jack1142`, :ghuser:`mikeshardmind`, :ghuser:`MiniJennJenn`, :ghuser:`NeuroAssassin`, :ghuser:`thisisjvgrace`, :ghuser:`Vexed01`
|
||||
|
||||
End-user changelog
|
||||
------------------
|
||||
|
||||
Audio
|
||||
*****
|
||||
|
||||
- Added information about internally managed jar to ``[p]audioset info`` (:issue:`3915`)
|
||||
- Updated to Lavaplayer 1.3.50
|
||||
- Twitch playback and YouTube searching should be functioning again.
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Fixed delayed help when ``[p]set deletedelay`` is enabled (:issue:`3884`, :issue:`3883`)
|
||||
- Bumped the Discord.py requirement from 1.3.3 to 1.3.4 (:issue:`4053`)
|
||||
- Added settings view commands for nearly all cogs. (:issue:`4041`)
|
||||
- Added more strings to be fully translatable by i18n. (:issue:`4044`)
|
||||
|
||||
Downloader
|
||||
**********
|
||||
|
||||
- Added ``[p]cog listpinned`` subcommand to see currently pinned cogs (:issue:`3974`)
|
||||
- Fixed unnecessary typing when running downloader commands (:issue:`3964`, :issue:`3948`)
|
||||
- Added embed version of ``[p]findcog`` (:issue:`3965`, :issue:`3944`)
|
||||
- Fixed ``[p]findcog`` not differentiating between core cogs and local cogs(:issue:`3969`, :issue:`3966`)
|
||||
|
||||
Filter
|
||||
******
|
||||
|
||||
- Added ``[p]filter list`` to show filtered words, and removed DMs when no subcommand was passed (:issue:`3973`)
|
||||
|
||||
Image
|
||||
*****
|
||||
|
||||
- Updated instructions for obtaining and setting the GIPHY API key (:issue:`3994`)
|
||||
|
||||
Mod
|
||||
***
|
||||
|
||||
- Added option to delete messages within the passed amount of days with ``[p]tempban`` (:issue:`3958`)
|
||||
- Added the ability to permanently ban a temporary banned user with ``[p]hackban`` (:issue:`4025`)
|
||||
- Fixed the passed reason not being used when using ``[p]tempban`` (:issue:`3958`)
|
||||
- Fixed invite being sent with ``[p]tempban`` even when no invite was set (:issue:`3991`)
|
||||
- Prevented an issue whereby the author may lock him self out of using the bot via whitelists (:issue:`3903`)
|
||||
- Reduced the number of API calls made to the storage APIs (:issue:`3910`)
|
||||
|
||||
Permissions
|
||||
***********
|
||||
|
||||
- Uploaded YAML files now accept integer commands without quotes (:issue:`3987`, :issue:`3185`)
|
||||
- Uploaded YAML files now accept command rules with empty dictionaries (:issue:`3987`, :issue:`3961`)
|
||||
|
||||
Streams
|
||||
*******
|
||||
|
||||
- Fixed streams cog sending multiple owner notifications about twitch secret not set (:issue:`3901`, :issue:`3587`)
|
||||
- Fixed old bearer tokens not being invalidated when the API key is updated (:issue:`3990`, :issue:`3917`)
|
||||
|
||||
Trivia Lists
|
||||
************
|
||||
|
||||
- Fixed URLs in ``whosthatpokemon`` (:issue:`3975`, :issue:`3023`)
|
||||
- Fixed trivia files ``leagueults`` and ``sports`` (:issue:`4026`)
|
||||
- Updated ``greekmyth`` to include more answer variations (:issue:`3970`)
|
||||
- Added new ``lotr`` trivia list (:issue:`3980`)
|
||||
- Added new ``r6seige`` trivia list (:issue:`4026`)
|
||||
|
||||
|
||||
Developer changelog
|
||||
-------------------
|
||||
|
||||
- Added the utility functions ``map``, ``find``, and ``next`` to ``AsyncIter`` (:issue:`3921`, :issue:`3887`)
|
||||
- Updated deprecation times for ``APIToken``, and loops being passed to various functions to the first minor release (represented by ``X`` in ``3.X.0``) after 2020-08-05 (:issue:`3608`)
|
||||
- Updated deprecation warnings for shared libs to reflect that they have been moved for an undefined time (:issue:`3608`)
|
||||
- Added new ``discord.com`` domain to ``INVITE_URL_RE`` common filter (:issue:`4012`)
|
||||
- Fixed incorrect role mention regex in ``MessagePredicate`` (:issue:`4030`)
|
||||
- Vendor the ``discord.ext.menus`` module (:issue:`4039`)
|
||||
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
- Improved error responses for when Modlog and Autoban on mention spam were already disabled (:issue:`3951`, :issue:`3949`)
|
||||
- Clarified that ``[p]embedset user`` only affects commands executed in DMs (:issue:`3972`, :issue:`3953`)
|
||||
- Added link to Getting Started guide if the bot was not in any guilds (:issue:`3906`)
|
||||
- Fixed exceptions being ignored or not sent to log files in special cases (:issue:`3895`)
|
||||
- Added the option of using dots in the instance name when creating your instances (:issue:`3920`)
|
||||
- Added a confirmation when using hyphens in instance names to discourage the use of them (:issue:`3920`)
|
||||
- Fixed migration owner notifications being sent even when migration was not necessary (:issue:`3911`. :issue:`3909`)
|
||||
- Fixed commands being translated where they should not be (:issue:`3938`, :issue:`3919`)
|
||||
- Fixed grammar errors and added full stopts in ``core_commands.py`` (:issue:`4023`)
|
||||
|
||||
|
||||
Redbot 3.3.9 (2020-06-12)
|
||||
=========================
|
||||
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
| :ghuser:`aikaterna`, :ghuser:`Dav-Git`, :ghuser:`Drapersniper`, :ghuser:`Flame442`, :ghuser:`mikeshardmind`, :ghuser:`NeuroAssassin`, :ghuser:`Predeactor`, :ghuser:`Vexed01`
|
||||
|
|
||||
| **Read before updating**:
|
||||
| 1. Bot owners can no longer restrict access to some commands in Permissions cog using global permissions rules. Look at `Permissions changelog <important-339-2>` for full details.
|
||||
| 2. There's been a change in behavior of warning messages. Look at `Warnings changelog <important-339-1>` for full details.
|
||||
|
||||
|
||||
End-user changelog
|
||||
------------------
|
||||
|
||||
Security
|
||||
********
|
||||
|
||||
**NOTE**: If you can't update immediately, we recommend disabling the affected command until you can.
|
||||
|
||||
- **Mod** - ``[p]tempban`` now properly respects Discord's hierarchy rules (:issue:`3957`)
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- ``[p]info`` command can now be used when bot doesn't have Embed Links permission (:issue:`3907`, :issue:`3102`)
|
||||
- Fixed ungraceful error that happened in ``[p]set custominfo`` when provided text was too long (:issue:`3923`)
|
||||
- Red's start up message now shows storage type (:issue:`3935`)
|
||||
|
||||
Audio
|
||||
*****
|
||||
|
||||
- Audio now properly ignores streams when max length is enabled (:issue:`3878`, :issue:`3877`)
|
||||
- Commands that should work in DMs no longer error (:issue:`3880`)
|
||||
|
||||
Filter
|
||||
******
|
||||
|
||||
- Fixed behavior of detecting quotes in commands for adding/removing filtered words (:issue:`3925`)
|
||||
|
||||
.. _important-339-2:
|
||||
|
||||
Permissions
|
||||
***********
|
||||
|
||||
- **Both global and server rules** can no longer prevent guild owners from accessing commands for changing server rules. Bot owners can still use ``[p]command disable`` if they wish to completely disable any command in Permissions cog (:issue:`3955`, :issue:`3107`)
|
||||
|
||||
Full list of affected commands:
|
||||
|
||||
- ``[p]permissions acl getserver``
|
||||
- ``[p]permissions acl setserver``
|
||||
- ``[p]permissions acl updateserver``
|
||||
- ``[p]permissions addserverrule``
|
||||
- ``[p]permissions removeserverrule``
|
||||
- ``[p]permissions setdefaultserverrule``
|
||||
- ``[p]permissions clearserverrules``
|
||||
- ``[p]permissions canrun``
|
||||
- ``[p]permissions explain``
|
||||
|
||||
.. _important-339-1:
|
||||
|
||||
Warnings
|
||||
********
|
||||
|
||||
- Warnings sent to users don't show the moderator who warned the user by default now. Newly added ``[p]warningset showmoderators`` command can be used to switch this behaviour (:issue:`3781`)
|
||||
- Warn channel functionality has been fixed (:issue:`3781`)
|
||||
|
||||
|
||||
Developer changelog
|
||||
-------------------
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Added `bot.set_prefixes() <RedBase.set_prefixes()>` method that allows developers to set global/server prefixes (:issue:`3890`)
|
||||
|
||||
|
||||
Documentation changes
|
||||
---------------------
|
||||
|
||||
- Added Oracle Cloud to free hosting section in :ref:`host-list` (:issue:`3916`)
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
- Added missing help message for Downloader, Reports and Streams cogs (:issue:`3892`)
|
||||
- **Core Bot** - cooldown in ``[p]contact`` no longer applies when it's used without any arguments (:issue:`3942`)
|
||||
- **Core Bot** - improved instructions on obtaining user ID in help of ``[p]dm`` command (:issue:`3946`)
|
||||
- **Alias** - ``[p]alias global`` group, ``[p]alias help``, and ``[p]alias show`` commands can now be used in DMs (:issue:`3941`, :issue:`3940`)
|
||||
- **Audio** - Typo fix (:issue:`3889`, :issue:`3900`)
|
||||
- **Audio** - Fixed ``[p]audioset autoplay`` being available in DMs (:issue:`3899`)
|
||||
- **Bank** - ``[p]bankset`` now displays bank's scope (:issue:`3954`)
|
||||
- **Mod** - Preemptive fix for d.py 1.4 (:issue:`3891`)
|
||||
|
||||
|
||||
Redbot 3.3.8 (2020-05-29)
|
||||
==================================
|
||||
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
| :ghuser:`aikaterna`, :ghuser:`Bakersbakebread`, :ghuser:`DariusStClair`, :ghuser:`Dav-Git`, :ghuser:`Drapersniper`, :ghuser:`Flame442`, :ghuser:`jack1142`, :ghuser:`mikeshardmind`, :ghuser:`NeuroAssassin`, :ghuser:`PredaaA`, :ghuser:`Predeactor`, :ghuser:`qaisjp`, :ghuser:`Tobotimus`
|
||||
|
||||
End-user changelog
|
||||
------------------
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Important fixes to how PostgreSQL data backend saves data in bulks (:issue:`3829`)
|
||||
- Fixed ``[p]localwhitelist`` and ``[p]localblacklist`` commands (:issue:`3857`)
|
||||
- Red now includes information on how to update when sending information about being out of date (:issue:`3744`)
|
||||
- Using backslashes in bot's username/nickname no longer causes issues (:issue:`3826`, :issue:`3825`)
|
||||
|
||||
Admin
|
||||
*****
|
||||
|
||||
- Fixed server lock (:issue:`3815`, :issue:`3814`)
|
||||
|
||||
Alias
|
||||
*****
|
||||
|
||||
- Added pagination to ``[p]alias list`` and ``[p]alias global list`` to avoid errors for users with a lot of aliases (:issue:`3844`, :issue:`3834`)
|
||||
- ``[p]alias help`` should now work more reliably (:issue:`3864`)
|
||||
|
||||
Audio
|
||||
*****
|
||||
|
||||
- Twitch playback is functional once again (:issue:`3873`)
|
||||
- Recent errors with YouTube playback should be resolved (:issue:`3873`)
|
||||
- Added new option (settable with ``[p]audioset lyrics``) that makes Audio cog prefer (prioritize) tracks with lyrics (:issue:`3519`)
|
||||
- Added global daily (historical) queues (:issue:`3518`)
|
||||
- Added ``[p]audioset countrycode`` that allows to set the country code for spotify searches (:issue:`3528`)
|
||||
- Fixed ``[p]local search`` (:issue:`3528`, :issue:`3501`)
|
||||
- Local folders with special characters should work properly now (:issue:`3528`, :issue:`3467`)
|
||||
- Audio no longer fails to take the last spot in the voice channel with user limit (:issue:`3528`)
|
||||
- ``[p]local play`` no longer enqueues tracks from nested folders (:issue:`3528`)
|
||||
- Fixed ``[p]playlist dedupe`` not removing tracks (:issue:`3518`)
|
||||
- ``[p]disconnect`` now allows to disconnect if both DJ mode and voteskip aren't enabled (:issue:`3502`, :issue:`3485`)
|
||||
- Many UX improvements and fixes, including, among other things:
|
||||
|
||||
- Creating playlists without explicitly passing ``-scope`` no longer causes errors (:issue:`3500`)
|
||||
- ``[p]playlist list`` now shows all accessible playlists if ``--scope`` flag isn't used (:issue:`3518`)
|
||||
- ``[p]remove`` now also accepts a track URL in addition to queue index (:issue:`3201`)
|
||||
- ``[p]playlist upload`` now accepts a playlist file uploaded in the message with a command (:issue:`3251`)
|
||||
- Commands now send friendly error messages for common errors like lost Lavalink connection or bot not connected to voice channel (:issue:`3503`, :issue:`3528`, :issue:`3353`, :issue:`3712`)
|
||||
|
||||
CustomCommands
|
||||
**************
|
||||
|
||||
- ``[p]customcom create`` no longer allows spaces in custom command names (:issue:`3816`)
|
||||
|
||||
Mod
|
||||
***
|
||||
|
||||
- ``[p]userinfo`` now shows default avatar when no avatar is set (:issue:`3819`)
|
||||
|
||||
Modlog
|
||||
******
|
||||
|
||||
- Fixed (again) ``AttributeError`` for cases whose moderator doesn't share the server with the bot (:issue:`3805`, :issue:`3784`, :issue:`3778`)
|
||||
|
||||
Permissions
|
||||
***********
|
||||
|
||||
- Commands for settings ACL using yaml files now properly works on PostgreSQL data backend (:issue:`3829`, :issue:`3796`)
|
||||
|
||||
Warnings
|
||||
********
|
||||
|
||||
- Warnings cog no longer allows to warn bot users (:issue:`3855`, :issue:`3854`)
|
||||
|
||||
|
||||
Developer changelog
|
||||
-------------------
|
||||
|
||||
| **Important:**
|
||||
| If you're using RPC, please see the full annoucement about current state of RPC in main Red server
|
||||
`by clicking here <https://discord.com/channels/133049272517001216/411381123101491200/714560168465137694>`_.
|
||||
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Red now inherits from `discord.ext.commands.AutoShardedBot` for better compatibility with code expecting d.py bot (:issue:`3822`)
|
||||
- Libraries using ``pkg_resources`` (like ``humanize`` or ``google-api-python-client``) that were installed through Downloader should now work properly (:issue:`3843`)
|
||||
- All bot owner IDs can now be found under ``bot.owner_ids`` attribute (:issue:`3793`)
|
||||
|
||||
- Note: If you want to use this on bot startup (e.g. in cog's initialisation), you need to await ``bot.wait_until_red_ready()`` first
|
||||
|
||||
|
||||
Documentation changes
|
||||
---------------------
|
||||
|
||||
- Added information about provisional status of RPC (:issue:`3862`)
|
||||
- Revised install instructions (:issue:`3847`)
|
||||
- Improved navigation in `document about updating Red <update_red>` (:issue:`3856`, :issue:`3849`)
|
||||
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
- Few clarifications and typo fixes in few command help docstrings (:issue:`3817`, :issue:`3823`, :issue:`3837`, :issue:`3851`, :issue:`3861`)
|
||||
- **Downloader** - Downloader no longer removes the repo when it fails to load it (:issue:`3867`)
|
||||
|
||||
|
||||
Redbot 3.3.7 (2020-04-28)
|
||||
=========================
|
||||
|
||||
This is a hotfix release fixing issue with generating messages for new cases in Modlog.
|
||||
|
||||
|
||||
Redbot 3.3.6 (2020-04-27)
|
||||
=========================
|
||||
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
| :ghuser:`aikaterna`, :ghuser:`Drapersniper`, :ghuser:`jack1142`, :ghuser:`Kowlin`, :ghuser:`MiniJennJenn`, :ghuser:`NeuroAssassin`, :ghuser:`PredaaA`, :ghuser:`TrustyJAID`, :ghuser:`yamikaitou`
|
||||
|
||||
End-user changelog
|
||||
------------------
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Converting from and to Postgres driver with ``redbot-setup convert`` have been fixed (:issue:`3714`, :issue:`3115`)
|
||||
- Fixed big delays in commands that happened when the bot was owner-less (or if it only used co-owners feature) and command caller wasn't the owner (:issue:`3782`)
|
||||
- Various optimizations
|
||||
|
||||
- Reduced calls to data backend when loading bot's commands (:issue:`3764`)
|
||||
- Reduced calls to data backend when showing help for cogs/commands (:issue:`3766`)
|
||||
- Improved performance for bots with big amount of guilds (:issue:`3767`)
|
||||
- Mod cog no longer fetches guild's bans every 60 seconds when handling unbanning for tempbans (:issue:`3783`)
|
||||
- Reduced the bot load for messages starting with a prefix when fuzzy search is disabled (:issue:`3718`)
|
||||
- Aliases in Alias cog are now cached for better performance (:issue:`3788`)
|
||||
|
||||
Core Commands
|
||||
*************
|
||||
|
||||
- ``[p]set avatar`` now supports setting avatar using attachment (:issue:`3747`)
|
||||
- Added ``[p]set avatar remove`` subcommand for removing bot's avatar (:issue:`3757`)
|
||||
- Fixed list of ignored channels that is shown in ``[p]ignore``/``[p]unignore`` (:issue:`3746`)
|
||||
|
||||
Audio
|
||||
*****
|
||||
|
||||
- Age-restricted tracks, live streams, and mix playlists from YouTube should work in Audio again (:issue:`3791`)
|
||||
- Soundcloud's sets and playlists with more than 50 tracks should work in Audio again (:issue:`3791`)
|
||||
|
||||
CustomCommands
|
||||
**************
|
||||
|
||||
- Added ``[p]cc raw`` command that gives you the raw response of a custom command for ease of copy pasting (:issue:`3795`)
|
||||
|
||||
Modlog
|
||||
******
|
||||
|
||||
- Fixed ``AttributeError`` for cases whose moderator doesn't share the server with the bot (:issue:`3784`, :issue:`3778`)
|
||||
|
||||
Streams
|
||||
*******
|
||||
|
||||
- Fixed incorrect stream URLs for Twitch channels that have localised display name (:issue:`3773`, :issue:`3772`)
|
||||
|
||||
Trivia
|
||||
******
|
||||
|
||||
- Fixed the error in ``[p]trivia stop`` that happened when there was no ongoing trivia session in the channel (:issue:`3774`)
|
||||
|
||||
Trivia Lists
|
||||
************
|
||||
|
||||
- Updated ``leagueoflegends`` list with new changes to League of Legends (`b8ac70e <https://github.com/Cog-Creators/Red-DiscordBot/commit/b8ac70e59aa1328f246784f14f992d6ffe00d778>`_)
|
||||
|
||||
|
||||
Developer changelog
|
||||
-------------------
|
||||
|
||||
Utility Functions
|
||||
*****************
|
||||
|
||||
- Added `redbot.core.utils.AsyncIter` utility class which allows you to wrap regular iterable into async iterator yielding items and sleeping for ``delay`` seconds every ``steps`` items (:issue:`3767`, :issue:`3776`)
|
||||
- `bold()`, `italics()`, `strikethrough()`, and `underline()` now accept ``escape_formatting`` argument that can be used to disable escaping of markdown formatting in passed text (:issue:`3742`)
|
||||
|
||||
|
||||
Documentation changes
|
||||
---------------------
|
||||
|
||||
- Added `document about updating Red <update_red>` (:issue:`3790`)
|
||||
- ``pyenv`` instructions will now update ``pyenv`` if it's already installed (:issue:`3740`)
|
||||
- Updated Python version in ``pyenv`` instructions (:issue:`3740`)
|
||||
- Updated install docs to include Ubuntu 20.04 (:issue:`3792`)
|
||||
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
- **Config** - JSON driver will now properly have only one lock per cog name (:issue:`3780`)
|
||||
- **Core Commands** - ``[p]debuginfo`` now shows used storage type (:issue:`3794`)
|
||||
- **Trivia** - Corrected spelling of Compact Disc in ``games`` list (:issue:`3759`, :issue:`3758`)
|
||||
|
||||
|
||||
Redbot 3.3.5 (2020-04-09)
|
||||
=========================
|
||||
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
| :ghuser:`jack1142`, :ghuser:`Kowlin`
|
||||
|
||||
End-user changelog
|
||||
------------------
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- "Outdated" field no longer shows in ``[p]info`` when Red is up-to-date (:issue:`3730`)
|
||||
|
||||
Alias
|
||||
*****
|
||||
|
||||
- Fixed regression in ``[p]alias add`` that caused it to reject commands containing arguments (:issue:`3734`)
|
||||
|
||||
|
||||
Redbot 3.3.4 (2020-04-05)
|
||||
=========================
|
||||
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
| :ghuser:`jack1142`, :ghuser:`kennnyshiwa`
|
||||
|
||||
End-user changelog
|
||||
------------------
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Fixed checks related to bank's global state that were used in commands in Bank, Economy and Trivia cogs (:issue:`3707`)
|
||||
|
||||
Alias
|
||||
*****
|
||||
|
||||
- ``[p]alias add`` now sends an error when command user tries to alias doesn't exist (:issue:`3710`, :issue:`3545`)
|
||||
|
||||
Developer changelog
|
||||
-------------------
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Bump dependencies, including update to discord.py 1.3.3 (:issue:`3723`)
|
||||
|
||||
Utility Functions
|
||||
*****************
|
||||
|
||||
- `redbot.core.utils.common_filters.filter_invites` now filters ``discord.io/discord.li`` invites links (:issue:`3717`)
|
||||
- Fixed false-positives in `redbot.core.utils.common_filters.filter_invites` (:issue:`3717`)
|
||||
|
||||
Documentation changes
|
||||
---------------------
|
||||
|
||||
- Versions of pre-requirements are now included in Windows install guide (:issue:`3708`)
|
||||
|
||||
|
||||
Redbot 3.3.3 (2020-03-28)
|
||||
=========================
|
||||
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
| :ghuser:`AnonGuy`, :ghuser:`Dav-Git`, :ghuser:`FancyJesse`, :ghuser:`Ianardo-DiCaprio`, :ghuser:`jack1142`, :ghuser:`kennnyshiwa`, :ghuser:`Kowlin`, :ghuser:`NeuroAssassin`, :ghuser:`PredaaA`, :ghuser:`Stonedestroyer`, :ghuser:`TrustyJAID`
|
||||
|
||||
End-user changelog
|
||||
------------------
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Delete delay for command messages has been moved from Mod cog to Core (:issue:`3638`, :issue:`3636`)
|
||||
- Fixed various bugs with blacklist and whitelist (:issue:`3643`, :issue:`3642`)
|
||||
- Added ``[p]set regionalformat`` command that allows users to set regional formatting that is different from bot's locale (:issue:`3677`, :issue:`3588`)
|
||||
- ``[p]set locale`` allows any valid locale now, not just locales for which Red has translations (:issue:`3676`, :issue:`3596`)
|
||||
- Permissions for commands in Bank, Economy and Trivia cogs can now be overridden by Permissions cog (:issue:`3672`, :issue:`3233`)
|
||||
- Outages of ``pypi.org`` no longer prevent the bot from starting (:issue:`3663`)
|
||||
- Fixed formatting of help strings in fuzzy search results (:issue:`3673`, :issue:`3507`)
|
||||
- Fixed few deprecation warnings related to menus and uvloop (:issue:`3644`, :issue:`3700`)
|
||||
|
||||
Core Commands
|
||||
*************
|
||||
|
||||
- ``[p]set game`` no longer errors when trying to clear the status (:issue:`3630`, :issue:`3628`)
|
||||
- All owner notifcations in Core now use proper prefixes in messages (:issue:`3632`)
|
||||
- Added ``[p]set playing`` and ``[p]set streaming`` aliases for respectively ``[p]set game`` and ``[p]set stream`` (:issue:`3646`, :issue:`3590`)
|
||||
|
||||
ModLog
|
||||
******
|
||||
|
||||
- Modlog's cases now keep last known username to prevent losing that information from case's message on edit (:issue:`3674`, :issue:`3443`)
|
||||
|
||||
CustomCom
|
||||
*********
|
||||
|
||||
- Added ``[p]cc search`` command that allows users to search through created custom commands (:issue:`2573`)
|
||||
|
||||
Cleanup
|
||||
*******
|
||||
|
||||
- Added ``[p]cleanup spam`` command that deletes duplicate messages from the last X messages and keeps only one copy (:issue:`3688`)
|
||||
- Removed regex support in ``[p]cleanup self`` (:issue:`3704`)
|
||||
|
||||
Downloader
|
||||
**********
|
||||
|
||||
- ``[p]cog checkforupdates`` now includes information about cogs that can't be installed due to Red/Python version requirements (:issue:`3678`, :issue:`3448`)
|
||||
|
||||
General
|
||||
*******
|
||||
|
||||
- Added more detailed mode to ``[p]serverinfo`` command that can be accessed with ``[p]serverinfo 1`` (:issue:`2382`, :issue:`3659`)
|
||||
|
||||
Image
|
||||
*****
|
||||
|
||||
- Users can now specify how many images should be returned in ``[p]imgur search`` and ``[p]imgur subreddit`` using ``[count]`` argument (:issue:`3667`, :issue:`3044`)
|
||||
- ``[p]imgur search`` and ``[p]imgur subreddit`` now return one image by default (:issue:`3667`, :issue:`3044`)
|
||||
|
||||
Mod
|
||||
***
|
||||
|
||||
- ``[p]userinfo`` now shows user's activities (:issue:`3669`)
|
||||
- ``[p]userinfo`` now shows status icon near the username (:issue:`3669`)
|
||||
- Muting no longer fails if user leaves while applying overwrite (:issue:`3627`)
|
||||
- Fixed error that happened when Mod cog was loaded for the first time during bot startup (:issue:`3632`, :issue:`3626`)
|
||||
|
||||
Permissions
|
||||
***********
|
||||
|
||||
- Commands for setting default rules now error when user tries to deny access to command designated as being always available (:issue:`3504`, :issue:`3465`)
|
||||
|
||||
Streams
|
||||
*******
|
||||
|
||||
- Fixed an error that happened when no game was set on Twitch stream (:issue:`3631`)
|
||||
- Preview picture for YouTube stream alerts is now bigger (:issue:`3689`, :issue:`3685`)
|
||||
- YouTube channels with a livestream that doesn't have any current viewer are now properly showing as streaming (:issue:`3690`)
|
||||
- Failures in Twitch API authentication are now logged (:issue:`3657`)
|
||||
|
||||
Trivia
|
||||
******
|
||||
|
||||
- Added ``[p]triviaset custom upload/delete/list`` commands for managing custom trivia lists from Discord (:issue:`3420`, :issue:`3307`)
|
||||
- Trivia sessions no longer error on payout when winner's balance would exceed max balance (:issue:`3666`, :issue:`3584`)
|
||||
|
||||
Warnings
|
||||
********
|
||||
|
||||
- Sending warnings to warned user can now be disabled with ``[p]warnset toggledm`` command (:issue:`2929`, :issue:`2800`)
|
||||
- Added ``[p]warnset warnchannel`` command that allows to set a channel where warnings should be sent to instead of the channel command was called in (:issue:`2929`, :issue:`2800`)
|
||||
- Added ``[p]warnset togglechannel`` command that allows to disable sending warn message in guild channel (:issue:`2929`, :issue:`2800`)
|
||||
- ``[p]warn`` now tells the moderator when bot wasn't able to send the warning to the user (:issue:`3653`, :issue:`3633`)
|
||||
|
||||
|
||||
Developer changelog
|
||||
-------------------
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Deprecation warnings issued by Red now use correct stack level so that the cog developers can find the cause of them (:issue:`3644`)
|
||||
|
||||
Dev Cog
|
||||
*******
|
||||
|
||||
- Add ``__name__`` to environment's globals (:issue:`3649`, :issue:`3648`)
|
||||
|
||||
|
||||
Documentation changes
|
||||
---------------------
|
||||
|
||||
- Fixed install instructions for Mac in `install_linux_mac` (:issue:`3675`, :issue:`3436`)
|
||||
- Windows install instructions now use ``choco upgrade`` commands instead of ``choco install`` to ensure up-to-date packages (:issue:`3684`)
|
||||
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
- **Core Bot** - Command errors (i.e. command on cooldown, dm-only and guild-only commands, etc) can now be translated (:issue:`3665`, :issue:`2988`)
|
||||
- **Core Bot** - ``redbot-setup`` now prints link to Getting started guide at the end of the setup (:issue:`3027`)
|
||||
- **Core Bot** - Whitelist and blacklist commands now properly require passing at least one user (or role in case of local whitelist/blacklist) (:issue:`3652`, :issue:`3645`)
|
||||
- **Downloader** - Fix misleading error appearing when repo name is already taken in ``[p]repo add`` (:issue:`3695`)
|
||||
- **Downloader** - Improved error messages for unexpected errors in ``[p]repo add`` (:issue:`3656`)
|
||||
- **Downloader** - Prevent encoding errors from crashing ``[p]cog update`` (:issue:`3639`, :issue:`3637`)
|
||||
- **Trivia** - Non-finite numbers can no longer be passed to ``[p]triviaset timelimit``, ``[p]triviaset stopafter`` and ``[p]triviaset payout`` (:issue:`3668`, :issue:`3583`)
|
||||
- **Utility Functions** - `redbot.core.utils.menus.menu()` now checks permissions *before* trying to clear reactions (:issue:`3589`, :issue:`3145`)
|
||||
|
||||
|
||||
Redbot 3.3.2 (2020-02-28)
|
||||
=========================
|
||||
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
| :ghuser:`aikaterna`, :ghuser:`chasehult`, :ghuser:`Dav-Git`, :ghuser:`DiscordLiz`, :ghuser:`Drapersniper`, :ghuser:`fixator10`, :ghuser:`Flame442`, :ghuser:`Hedlund01`, :ghuser:`jack1142`, :ghuser:`Kowlin`, :ghuser:`mikeshardmind`, :ghuser:`PredaaA`, :ghuser:`Stonedestroyer`, :ghuser:`trundleroo`, :ghuser:`TrustyJAID`, :ghuser:`zephyrkul`
|
||||
|
||||
End-user changelog
|
||||
------------------
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Ignored guilds/channels and whitelist/blacklist are now cached for performance (:issue:`3472`)
|
||||
- Ignored guilds/channels have been moved from Mod cog to Core (:issue:`3472`)
|
||||
- ``[p]ignore channel`` command can now also ignore channel categories (:issue:`3472`)
|
||||
|
||||
Core Commands
|
||||
*************
|
||||
|
||||
- Core cogs will now send bot mention prefix properly in places where discord doesn't render mentions (:issue:`3579`, :issue:`3591`, :issue:`3499`)
|
||||
- Fix a bug with ``[p]blacklist add`` that made it impossible to blacklist users that bot doesn't share a server with (:issue:`3472`, :issue:`3220`)
|
||||
- Improve user experience of ``[p]set game/listening/watching/`` commands (:issue:`3562`)
|
||||
- Add ``[p]licenceinfo`` alias for ``[p]licenseinfo`` command to conform with non-American English (:issue:`3460`)
|
||||
|
||||
Admin
|
||||
*****
|
||||
|
||||
- ``[p]announce`` will now only send error message if an actual errors occurs (:issue:`3514`, :issue:`3513`)
|
||||
|
||||
Alias
|
||||
*****
|
||||
|
||||
- ``[p]alias help`` will now properly work in non-English locales (:issue:`3546`)
|
||||
|
||||
Audio
|
||||
*****
|
||||
|
||||
- Users should be able to play age-restricted tracks from YouTube again (:issue:`3620`)
|
||||
|
||||
Economy
|
||||
*******
|
||||
|
||||
- Next payday time will now be adjusted for users when payday time is changed (:issue:`3496`, :issue:`3438`)
|
||||
|
||||
Downloader
|
||||
**********
|
||||
|
||||
- Downloader will no longer fail because of invalid ``info.json`` files (:issue:`3533`, :issue:`3456`)
|
||||
- Add better logging of errors when Downloader fails to add a repo (:issue:`3558`)
|
||||
|
||||
Image
|
||||
*****
|
||||
|
||||
- Fix load error for users that updated Red from version lower than 3.1 to version 3.2 or newer (:issue:`3617`)
|
||||
|
||||
Mod
|
||||
***
|
||||
|
||||
- ``[p]hackban`` and ``[p]unban`` commands support user mentions now (:issue:`3524`)
|
||||
- Ignored guilds/channels have been moved from Mod cog to Core (:issue:`3472`)
|
||||
|
||||
Streams
|
||||
*******
|
||||
|
||||
- Fix stream alerts for Twitch (:issue:`3487`)
|
||||
- Significantly reduce the quota usage for YouTube stream alerts (:issue:`3237`)
|
||||
- Add ``[p]streamset timer`` command which can be used to control how often the cog checks for live streams (:issue:`3237`)
|
||||
|
||||
Trivia
|
||||
******
|
||||
|
||||
- Add better handling for errors in trivia session (:issue:`3606`)
|
||||
|
||||
Trivia Lists
|
||||
************
|
||||
|
||||
- Remove empty answers in trivia lists (:issue:`3581`)
|
||||
|
||||
Warnings
|
||||
********
|
||||
|
||||
- Users can now pass a reason to ``[p]unwarn`` command (:issue:`3490`, :issue:`3093`)
|
||||
|
||||
|
||||
Developer changelog
|
||||
-------------------
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Updated all our dependencies - we're using discord.py 1.3.2 now (:issue:`3609`)
|
||||
- Add traceback logging to task exception handling (:issue:`3517`)
|
||||
- Developers can now create a command from an async function wrapped in `functools.partial` (:issue:`3542`)
|
||||
- Bot will now show deprecation warnings in logs (:issue:`3527`, :issue:`3615`)
|
||||
- Subcommands of command group with ``invoke_without_command=True`` will again inherit this group's checks (:issue:`3614`)
|
||||
|
||||
Config
|
||||
******
|
||||
|
||||
- Fix Config's singletons (:issue:`3137`, :issue:`3136`)
|
||||
|
||||
Utility Functions
|
||||
*****************
|
||||
|
||||
- Add clearer error when page is of a wrong type in `redbot.core.utils.menus.menu()` (:issue:`3571`)
|
||||
|
||||
Dev Cog
|
||||
*******
|
||||
|
||||
- Allow for top-level `await`, `async for` and `async with` in ``[p]debug`` and ``[p]repl`` commands (:issue:`3508`)
|
||||
|
||||
Downloader
|
||||
**********
|
||||
|
||||
- Downloader will now replace ``[p]`` with clean prefix same as it does in help command (:issue:`3592`)
|
||||
- Add schema validation to ``info.json`` file processing - it should now be easier to notice any issues with those files (:issue:`3533`, :issue:`3442`)
|
||||
|
||||
|
||||
Documentation changes
|
||||
---------------------
|
||||
|
||||
- Add guidelines for Cog Creators in `guide_cog_creation` document (:issue:`3568`)
|
||||
- Restructure virtual environment instructions to improve user experience (:issue:`3495`, :issue:`3411`, :issue:`3412`)
|
||||
- Getting started guide now explain use of quotes for arguments with spaces (:issue:`3555`, :issue:`3111`)
|
||||
- ``latest`` version of docs now displays a warning about possible differences from current stable release (:issue:`3570`)
|
||||
- Make systemd guide clearer on obtaining username and python path (:issue:`3537`, :issue:`3462`)
|
||||
- Indicate instructions for different venv types in systemd guide better (:issue:`3538`)
|
||||
- Service file in `autostart_systemd` now also waits for network connection to be ready (:issue:`3549`)
|
||||
- Hide alias of ``randomize_colour`` in docs (:issue:`3491`)
|
||||
- Add separate headers for each event predicate class for better navigation (:issue:`3595`, :issue:`3164`)
|
||||
- Improve wording of explanation for ``required_cogs`` key in `guide_publish_cogs` (:issue:`3520`)
|
||||
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
- Use more reliant way of checking if command is bot owner only in ``[p]warnaction`` (Warnings cog) (:issue:`3516`, :issue:`3515`)
|
||||
- Update PyPI domain in ``[p]info`` and update checker (:issue:`3607`)
|
||||
- Stop using deprecated code in core (:issue:`3610`)
|
||||
|
||||
|
||||
Redbot 3.3.1 (2020-02-05)
|
||||
=========================
|
||||
|
||||
|
||||
Core Bot
|
||||
--------
|
||||
|
||||
- Add a cli flag for setting a max size of message cache
|
||||
- Allow to edit prefix from command line using ``redbot --edit``.
|
||||
- Some functions have been changed to no longer use deprecated asyncio functions
|
||||
|
||||
Core Commands
|
||||
-------------
|
||||
|
||||
- The short help text for dm has been made more useful
|
||||
- dm no longer allows owners to have the bot attempt to DM itself
|
||||
|
||||
Utils
|
||||
-----
|
||||
|
||||
- Passing the event loop explicitly in utils is deprecated (Removal in 3.4)
|
||||
|
||||
Mod Cog
|
||||
-------
|
||||
|
||||
- Hackban now works properly without being provided a number of days
|
||||
|
||||
Documentation Changes
|
||||
---------------------
|
||||
|
||||
- Add ``-e`` flag to ``journalctl`` command in systemd guide so that it takes the user to the end of logs automatically.
|
||||
- Added section to install docs for CentOS 8
|
||||
- Improve usage of apt update in docs
|
||||
|
||||
Redbot 3.3.0 (2020-01-26)
|
||||
=========================
|
||||
|
||||
Core Bot
|
||||
--------
|
||||
|
||||
- The bot's description is now configurable.
|
||||
- We now use discord.py 1.3.1, this comes with added teams support.
|
||||
- The commands module has been slightly restructured to provide more useful data to developers.
|
||||
- Help is now self consistent in the extra formatting used.
|
||||
|
||||
Core Commands
|
||||
-------------
|
||||
|
||||
- Slowmode should no longer error on nonsensical time quantities.
|
||||
- Embed use can be configured per channel as well.
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
- We've made some small fixes to inaccurate instructions about installing with pyenv.
|
||||
- Notes about deprecating in 3.3 have been altered to 3.4 to match the intended timeframe.
|
||||
|
||||
Admin
|
||||
-----
|
||||
|
||||
- Gives feedback when adding or removing a role doesn't make sense.
|
||||
|
||||
Audio
|
||||
-----
|
||||
|
||||
- Playlist finding is more intuitive.
|
||||
- disconnect and repeat commands no longer interfere with eachother.
|
||||
|
||||
CustomCom
|
||||
---------
|
||||
|
||||
- No longer errors when exiting an interactive menu.
|
||||
|
||||
Cleanup
|
||||
-------
|
||||
|
||||
- A rare edge case involving messages which are deleted during cleanup and are the only message was fixed.
|
||||
|
||||
Downloader
|
||||
----------
|
||||
|
||||
- Some user facing messages were improved.
|
||||
- Downloader's initialization can no longer time out at startup.
|
||||
|
||||
General
|
||||
-------
|
||||
|
||||
- Roll command will no longer attempt to roll obscenely large amounts.
|
||||
|
||||
Mod
|
||||
---
|
||||
|
||||
- You can set a default amount of days to clean up when banning.
|
||||
- Ban and hackban now use that default.
|
||||
- Users can now optionally be DMed their ban reason.
|
||||
|
||||
Permissions
|
||||
-----------
|
||||
|
||||
- Now has stronger enforcement of prioritizing botwide settings.
|
||||
@@ -1,474 +0,0 @@
|
||||
.. 3.4.x Changelogs
|
||||
|
||||
Redbot 3.4.3 (2020-11-16)
|
||||
=========================
|
||||
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
| :ghuser:`aikaterna`, :ghuser:`bobloy`, :ghuser:`Flame442`, :ghuser:`jack1142`, :ghuser:`KianBral`, :ghuser:`maxbooiii`, :ghuser:`phenom4n4n`, :ghuser:`Predeactor`, :ghuser:`retke`
|
||||
|
||||
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.3 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.1.4_1132>`__.
|
||||
|
||||
End-user changelog
|
||||
------------------
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Added ``[p]set competing`` command that allows users to set the bot's competing status (:issue:`4607`, :issue:`4609`)
|
||||
|
||||
Audio
|
||||
*****
|
||||
|
||||
- Volume changes on ARM systems running a 64 bit OS will now work again (:issue:`4608`)
|
||||
- Fixed only 100 results being returned on a Youtube playlist (:issue:`4608`)
|
||||
- Fixed YouTube VOD duration being set to unknown (:issue:`3885`, :issue:`4608`)
|
||||
- Fixed some YouTube livestreams getting stuck (:issue:`4608`)
|
||||
- Fixed internal Lavalink manager failing for Java with untypical version formats (:issue:`4608`)
|
||||
- Improved AAC audio handling (:issue:`4608`)
|
||||
- Added support for SoundCloud HLS streams (:issue:`4608`)
|
||||
|
||||
Economy
|
||||
*******
|
||||
|
||||
- The ``[p]leaderboard`` command no longer fails in DMs when a global bank is used (:issue:`4569`)
|
||||
|
||||
Mod
|
||||
***
|
||||
|
||||
- The ban reason is now properly set in the audit log and modlog when using the ``[p]massban`` command (:issue:`4575`)
|
||||
- The ``[p]userinfo`` command now shows the new Competing activity (:issue:`4610`, :issue:`4611`)
|
||||
|
||||
Modlog
|
||||
******
|
||||
|
||||
- The ``[p]case`` and ``[p]casesfor`` commands no longer fail when the bot doesn't have Read Message History permission in the modlog channel (:issue:`4587`, :issue:`4588`)
|
||||
|
||||
Mutes
|
||||
*****
|
||||
|
||||
- Fixed automatic remuting on member join for indefinite mutes (:issue:`4568`)
|
||||
|
||||
Trivia
|
||||
******
|
||||
|
||||
- ``[p]triviaset custom upload`` now ensures that the filename is lowercase when uploading (:issue:`4594`)
|
||||
|
||||
Developer changelog
|
||||
-------------------
|
||||
|
||||
- ``modlog.get_case()`` and methods using it no longer raise when the bot doesn't have Read Message History permission in the modlog channel (:issue:`4587`, :issue:`4588`)
|
||||
|
||||
Documentation changes
|
||||
---------------------
|
||||
|
||||
- Added `guide for Cog Manager UI <cogmanagerui>` (:issue:`4152`)
|
||||
- Added `cog guide for CustomCommands cog <customcommands>` (:issue:`4490`)
|
||||
|
||||
|
||||
Redbot 3.4.2 (2020-10-28)
|
||||
=========================
|
||||
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
| :ghuser:`aikaterna`, :ghuser:`Drapersniper`, :ghuser:`jack1142`, :ghuser:`Kowlin`, :ghuser:`PredaaA`, :ghuser:`Stonedestroyer`
|
||||
|
||||
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.2 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.1.4_1128>`__.
|
||||
|
||||
End-user changelog
|
||||
------------------
|
||||
|
||||
- **Core Bot** - Added info about the metadata file to ``redbot --debuginfo`` (:issue:`4557`)
|
||||
- **Audio** - Fixed the ``[p]local search`` command (:issue:`4553`)
|
||||
- **Audio** - Fixed random "Something broke when playing the track." errors for YouTube tracks (:issue:`4559`)
|
||||
- **Audio** - Commands in ``[p]llset`` group can now be used in DMs (:issue:`4562`)
|
||||
- **Mod** - Fixed ``[p]massban`` not working for banning members that are in the server (:issue:`4556`, :issue:`4555`)
|
||||
- **Streams** - Added error messages when exceeding the YouTube quota in the Streams cog (:issue:`4552`)
|
||||
- **Streams** - Improved logging for unexpected errors in the Streams cog (:issue:`4552`)
|
||||
|
||||
Documentation changes
|
||||
---------------------
|
||||
|
||||
- Added `cog guide for Cleanup cog <cleanup>` (:issue:`4488`)
|
||||
- Removed multi-line commands from `install_linux_mac` to avoid confusing readers (:issue:`4550`)
|
||||
|
||||
|
||||
Redbot 3.4.1 (2020-10-27)
|
||||
=========================
|
||||
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
| :ghuser:`absj30`, :ghuser:`aikaterna`, :ghuser:`bobloy`, :ghuser:`chloecormier`, :ghuser:`Dav-Git`, :ghuser:`Drapersniper`, :ghuser:`fixator10`, :ghuser:`Flame442`, :ghuser:`flaree`, :ghuser:`Generaleoley`, :ghuser:`hisztendahl`, :ghuser:`jack1142`, :ghuser:`KaiGucci`, :ghuser:`Kowlin`, :ghuser:`maxbooiii`, :ghuser:`MeatyChunks`, :ghuser:`NeuroAssassin`, :ghuser:`nfitzen`, :ghuser:`palmtree5`, :ghuser:`phenom4n4n`, :ghuser:`PredaaA`, :ghuser:`Predeactor`, :ghuser:`PythonTryHard`, :ghuser:`SharkyTheKing`, :ghuser:`Stonedestroyer`, :ghuser:`thisisjvgrace`, :ghuser:`TrustyJAID`, :ghuser:`TurnrDev`, :ghuser:`Vexed01`, :ghuser:`Vuks69`, :ghuser:`xBlynd`, :ghuser:`zephyrkul`
|
||||
|
||||
Read before updating
|
||||
--------------------
|
||||
|
||||
1. This release fixes a security issue in Mod cog. See `Security changelog below <important-341-2>` for more information.
|
||||
2. This Red update bumps discord.py to version 1.5.1, which explicitly requests Discord intents. Red requires all Privileged Intents to be enabled. More information can be found at :ref:`enabling-privileged-intents`.
|
||||
3. Mutes functionality has been moved from the Mod cog to a new separate cog (Mutes) featuring timed and role-based mutes. If you were using it (or want to start now), you can load the new cog with ``[p]load mutes``. You can see the full `Mutes changelog below <important-341-1>`.
|
||||
4. Information for Audio users that are using an external Lavalink instance (if you don't know what that is, you should skip this point):
|
||||
|
||||
We've updated our `application.yml file <https://github.com/Cog-Creators/Red-DiscordBot/blob/3.4.1/redbot/cogs/audio/data/application.yml>`__ and you should update your instance's ``application.yml`` appropriately.
|
||||
Please ensure that the WS port in Audio's settings (``[p]llset wsport``) is set to the port from the ``application.yml``.
|
||||
|
||||
End-user changelog
|
||||
------------------
|
||||
|
||||
.. _important-341-2:
|
||||
|
||||
Security
|
||||
********
|
||||
|
||||
**NOTE:** If you can't update immediately, we recommend globally disabling the affected command until you can.
|
||||
|
||||
- **Mod** - Fixed unauthorized privilege escalation exploit in ``[p]massban`` (also called ``[p]hackban``) command. Full security advisory `can be found on our GitHub <https://github.com/Cog-Creators/Red-DiscordBot/security/advisories/GHSA-mp9m-g7qj-6vqr>`__.
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Fixed an incorrect error being reported on ``[p]set name`` when the passed name was longer than 32 characters (:issue:`4364`, :issue:`4363`)
|
||||
- Fixed ``[p]set nickname`` erroring when the passed name was longer than 32 characters (:issue:`4364`, :issue:`4363`)
|
||||
- Fixed an ungraceful error being raised when running ``[p]traceback`` with closed DMs (:issue:`4329`)
|
||||
- Fixed errors that could arise from invalid URLs in ``[p]set avatar`` (:issue:`4437`)
|
||||
- Fixed an error being raised with ``[p]set nickname`` when no nickname was provided (:issue:`4451`)
|
||||
- Fixed and clarified errors being raised with ``[p]set username`` (:issue:`4463`)
|
||||
- Fixed an ungraceful error being raised when the output of ``[p]unload`` is larger than 2k characters (:issue:`4469`)
|
||||
- Fixed an ungraceful error being raised when running ``[p]choose`` with empty options (:issue:`4499`)
|
||||
- Fixed an ungraceful error being raised when a bot left a guild while a menu was open (:issue:`3902`)
|
||||
- Fixed info missing on the non-embed version of ``[p]debuginfo`` (:issue:`4524`)
|
||||
- Added ``[p]set api list`` to list all currently set API services, without tokens (:issue:`4370`)
|
||||
- Added ``[p]set api remove`` to remove API services, including tokens (:issue:`4370`)
|
||||
- Added ``[p]helpset usetick``, toggling command message being ticked when help is sent to DM (:issue:`4467`, :issue:`4075`)
|
||||
- Added a default color field to ``[p]set showsettings`` (:issue:`4498`, :issue:`4497`)
|
||||
- Added the datapath and metadata file to ``[p]debuginfo`` (:issue:`4524`)
|
||||
- Added a list of disabled intents to ``[p]debuginfo`` (:issue:`4423`)
|
||||
- Bumped discord.py dependency to version 1.5.1 (:issue:`4423`)
|
||||
- Locales and regional formats can now be set in individual guilds using ``[p]set locale`` and ``[p]set regionalformat`` (:issue:`3896`, :issue:`1970`)
|
||||
|
||||
- Global locale and regional format setters have been renamed to ``[p]set globallocale`` and ``[p]set globalregionalformat``
|
||||
|
||||
Audio
|
||||
*****
|
||||
|
||||
- Scattered grammar and typo fixes (:issue:`4446`)
|
||||
- Fixed Bandcamp playback (:issue:`4504`)
|
||||
- Fixed YouTube playlist playback (:issue:`4504`)
|
||||
- Fixed YouTube searching issues (:issue:`4504`)
|
||||
- Fixed YouTube age restricted track playback (:issue:`4504`)
|
||||
- Fixed the Audio cog not being translated when setting locale (:issue:`4492`, :issue:`4495`)
|
||||
- Fixed tracks getting stuck at 0:00 after long player sessions (:issue:`4529`)
|
||||
- Removed lavalink logs from being added to backup (:issue:`4453`, :issue:`4452`)
|
||||
- Removed stream durations from being in queue duration (:issue:`4513`)
|
||||
- Added the Global Audio API, to cut down on Youtube 429 errors and allow Spotify playback past user's quota. (:issue:`4446`)
|
||||
- Added persistent queues, allowing for queues to be restored on a bot restart or cog reload (:issue:`4446`)
|
||||
- Added ``[p]audioset restart``, allowing for Lavalink connection to be restarted (:issue:`4446`)
|
||||
- Added ``[p]audioset autodeafen``, allowing for bot to auto-deafen itself when entering voice channel (:issue:`4446`)
|
||||
- Added ``[p]audioset mycountrycode``, allowing Spotify search locale per user (:issue:`4446`)
|
||||
- Added ``[p]llsetup java``, allowing for a custom Java executable path (:issue:`4446`)
|
||||
- Added ``[p]llset info`` to show Lavalink settings (:issue:`4527`)
|
||||
- Added ``[p]audioset logs`` to download Lavalink logs if the Lavalink server is set to internal (:issue:`4527`)
|
||||
|
||||
Cleanup
|
||||
*******
|
||||
|
||||
- Allowed ``[p]cleanup self`` to work in DMs for all users (:issue:`4481`)
|
||||
|
||||
Custom Commands
|
||||
***************
|
||||
|
||||
- Fixed an ungraceful error being thrown on ``[p]cc edit`` (:issue:`4325`)
|
||||
|
||||
Dev
|
||||
***
|
||||
|
||||
- Added ``[p]repl pause`` to pause/resume the REPL session in the current channel (:issue:`4366`)
|
||||
|
||||
Economy
|
||||
*******
|
||||
|
||||
- Added an embed option for ``[p]leaderboard`` (:issue:`4184`, :issue:`4104`)
|
||||
|
||||
General
|
||||
*******
|
||||
|
||||
- Fixed issues with text not being properly URL encoded (:issue:`4024`)
|
||||
- Fixed an ungraceful error occurring when a title is longer than 256 characters in ``[p]urban`` (:issue:`4474`)
|
||||
- Changed "boosters" to "boosts" in ``[p]serverinfo`` to clarify what the number represents (:issue:`4507`)
|
||||
|
||||
Mod
|
||||
***
|
||||
|
||||
- Added ``[p]modset mentionspam strict`` allowing for duplicated mentions to count towards the mention spam cap (:issue:`4359`)
|
||||
- Added an option to ban users not in the guild to ``[p]ban`` (:issue:`4422`, :issue:`4419`)
|
||||
- Added a default tempban duration for ``[p]tempban`` (:issue:`4473`, :issue:`3992`)
|
||||
- Fixed nicknames not being properly stored and logged (:issue:`4131`)
|
||||
- Fixed plural typos in ``[p]userinfo`` (:issue:`4397`, :issue:`4379`)
|
||||
- Renamed ``[p]hackban`` to ``[p]massban``, keeping ``[p]hackban`` as an alias, allowing for multiple users to be banned at once (:issue:`4422`, :issue:`4419`)
|
||||
- Moved mutes to a separate, individual cog (:issue:`3634`)
|
||||
|
||||
.. _important-341-1:
|
||||
|
||||
Mutes
|
||||
*****
|
||||
|
||||
- Added ``[p]muteset forcerole`` to make mutes role based, instead of permission based (:issue:`3634`)
|
||||
- Added an optional time argument to all mutes, to specify when the user should be unmuted (:issue:`3634`)
|
||||
- Changed ``[p]mute`` to only handle serverwide muting, ``[p]mute voice`` and ``[p]mute channel`` have been moved to separate commands called ``[p]mutechannel`` and ``[p]mutevoice`` (:issue:`3634`)
|
||||
- Mute commands can now take multiple user arguments, to mute multiple users at a time (:issue:`3634`)
|
||||
|
||||
Modlog
|
||||
******
|
||||
|
||||
- Fixed an error being raised when running ``[p]casesfor`` and ``[p]case`` (:issue:`4415`)
|
||||
- Long reasons in Modlog are now properly shortened in message content (:issue:`4541`)
|
||||
|
||||
Trivia Lists
|
||||
************
|
||||
|
||||
- Fixed incorrect order of Machamp and Machoke questions (:issue:`4424`)
|
||||
- Added new MLB trivia list (:issue:`4455`)
|
||||
- Added new Who's That Pokémon - Gen. IV trivia list (:issue:`4434`)
|
||||
- Added new Hockey trivia list (:issue:`4384`)
|
||||
|
||||
Warnings
|
||||
********
|
||||
|
||||
- Fixed users being able to warn users above them in hierarchy (:issue:`4100`)
|
||||
- Added bool arguments to toggle commands to improve consistency (:issue:`4409`)
|
||||
|
||||
Developer changelog
|
||||
-------------------
|
||||
|
||||
| **Important:**
|
||||
| 1. Red now allows users to set locale per guild, which requires 3rd-party cogs to set contextual locale manually in code ran outside of command's context. See the `Core Bot changelog below <important-dev-341-1>` for more information.
|
||||
|
||||
.. _important-dev-341-1:
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Added API for setting contextual locales (:issue:`3896`, :issue:`1970`)
|
||||
|
||||
- New function added: `redbot.core.i18n.set_contextual_locales_from_guild()`
|
||||
- Contextual locale is automatically set for commands and only needs to be done manually for things like event listeners; see `guidelines-for-cog-creators` for more information
|
||||
|
||||
- Added `bot.remove_shared_api_services() <RedBase.remove_shared_api_services()>` to remove all keys and tokens associated with an API service (:issue:`4370`)
|
||||
- Added an option to return all tokens for an API service if ``service_name`` is not specified in `bot.get_shared_api_tokens() <RedBase.get_shared_api_tokens()>` (:issue:`4370`)
|
||||
- Added `bot.get_or_fetch_user() <RedBase.get_or_fetch_user()>` and `bot.get_or_fetch_member() <RedBase.get_or_fetch_member()>` methods (:issue:`4403`, :issue:`4402`)
|
||||
- Moved ``redbot.core.checks.bot_in_a_guild()`` to `redbot.core.commands.bot_in_a_guild()` (old name has been left as an alias) (:issue:`4515`, :issue:`4510`)
|
||||
|
||||
Bank
|
||||
****
|
||||
|
||||
- Bank API methods now consistently throw TypeError if a non-integer amount is supplied (:issue:`4376`)
|
||||
|
||||
Mod
|
||||
***
|
||||
|
||||
- Deprecated ``redbot.core.utils.mod.is_allowed_by_hierarchy`` (:issue:`4435`)
|
||||
|
||||
Modlog
|
||||
******
|
||||
|
||||
- Added an option to accept a ``discord.Object`` in case creation (:issue:`4326`)
|
||||
- Added ``last_known_username`` parameter to `modlog.create_case()` function (:issue:`4326`)
|
||||
- Fixed an error being raised with a deleted channel in `Case.message_content()` (:issue:`4415`)
|
||||
|
||||
Utility
|
||||
*******
|
||||
|
||||
- Added `redbot.core.utils.get_end_user_data_statement()` and `redbot.core.utils.get_end_user_data_statement_or_raise()` to attempt to fetch a cog's End User Data Statement (:issue:`4404`)
|
||||
- Added `redbot.core.utils.chat_formatting.quote()` to quote text in a message (:issue:`4425`)
|
||||
|
||||
Documentation changes
|
||||
---------------------
|
||||
|
||||
Config
|
||||
******
|
||||
|
||||
- Added custom group documentation and tutorial (:issue:`4416`, :issue:`2896`)
|
||||
|
||||
Modlog
|
||||
******
|
||||
|
||||
- Clarified that naive ``datetime`` objects will be treated as local times for parameters ``created_at`` and ``until`` in `modlog.create_case()` (:issue:`4389`)
|
||||
|
||||
Other
|
||||
*****
|
||||
|
||||
- Added guide to creating a Bot Application in Discord Developer Portal, with enabling intents (:issue:`4502`)
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
- Added JSON schema files for ``info.json`` files (:issue:`4375`)
|
||||
- Added ``[all]`` and ``[dev]`` bundled install extras (:issue:`4443`)
|
||||
- Replaced the link to the approved repository list on CogBoard and references to ``cogs.red`` with a link to new Red Index (:issue:`4439`)
|
||||
- Improved documentation about arguments in command syntax (:issue:`4058`)
|
||||
- Replaced a few instances of Red with the bot name in command docstrings (:issue:`4470`)
|
||||
- Fixed grammar in places scattered throughout bot (:issue:`4500`)
|
||||
- Properly define supported Python versions to be lower than 3.9 (:issue:`4538`)
|
||||
|
||||
|
||||
Redbot 3.4.0 (2020-08-17)
|
||||
=========================
|
||||
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
| :ghuser:`Dav-Git`, :ghuser:`DevilXD`, :ghuser:`douglas-cpp`, :ghuser:`Drapersniper`, :ghuser:`flaree`, :ghuser:`jack1142`, :ghuser:`kablekompany`, :ghuser:`Kowlin`, :ghuser:`maxbooiii`, :ghuser:`MeatyChunks`, :ghuser:`mikeshardmind`, :ghuser:`NeuroAssassin`, :ghuser:`PredaaA`, :ghuser:`Predeactor`, :ghuser:`retke`, :ghuser:`SharkyTheKing`, :ghuser:`thisisjvgrace`, :ghuser:`Tinonb`, :ghuser:`TrustyJAID`, :ghuser:`Twentysix26`, :ghuser:`Vexed01`, :ghuser:`zephyrkul`
|
||||
|
|
||||
| **Read before updating**:
|
||||
| 1. Red 3.4 comes with support for data deletion requests. Bot owners should read `red_core_data_statement` to ensure they know what information about their users is stored by the bot.
|
||||
| 2. Debian Stretch, Fedora 30 and lower, and OpenSUSE Leap 15.0 and lower are no longer supported as they have already reached end of life.
|
||||
| 3. There's been a change in behavior of ``[p]tempban``. Look at `Mod changelog <important-340-1>` for full details.
|
||||
| 4. There's been a change in behavior of announcements in Admin cog. Look at `Admin changelog <important-340-2>` for full details.
|
||||
| 5. Red 3.4 comes with breaking changes for cog developers. Look at `Developer changelog <important-340-3>` for full details.
|
||||
|
||||
End-user changelog
|
||||
------------------
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Added per-guild cog disabling (:issue:`4043`, :issue:`3945`)
|
||||
|
||||
- Bot owners can set the default state for a cog using ``[p]command defaultdisablecog`` and ``[p]command defaultenablecog`` commands
|
||||
- Guild owners can enable/disable cogs for their guild using ``[p]command disablecog`` and ``[p]command enablecog`` commands
|
||||
- Cogs disabled in the guild can be listed with ``[p]command listdisabledcogs``
|
||||
|
||||
- Added support for data deletion requests; see `red_core_data_statement` for more information (:issue:`4045`)
|
||||
- Red now logs clearer error if it can't find package to load in any cog path during bot startup (:issue:`4079`)
|
||||
- ``[p]licenseinfo`` now has a 3 minute cooldown to prevent a single user from spamming channel by using it (:issue:`4110`)
|
||||
- Added ``[p]helpset showsettings`` command (:issue:`4013`, :issue:`4022`)
|
||||
- Updated Red's emoji usage to ensure consistent rendering accross different devices (:issue:`4106`, :issue:`4105`, :issue:`4127`)
|
||||
- Whitelist and blacklist are now called allowlist and blocklist. Old names have been left as aliases (:issue:`4138`)
|
||||
|
||||
.. _important-340-2:
|
||||
|
||||
Admin
|
||||
*****
|
||||
|
||||
- ``[p]announce`` will now only send announcements to guilds that have explicitly configured text channel to send announcements to using ``[p]announceset channel`` command (:issue:`4088`, :issue:`4089`)
|
||||
|
||||
Downloader
|
||||
**********
|
||||
|
||||
- ``[p]cog info`` command now shows end user data statement made by the cog creator (:issue:`4169`)
|
||||
- ``[p]cog update`` command will now notify the user if cog's end user data statement has changed since last update (:issue:`4169`)
|
||||
|
||||
.. _important-340-1:
|
||||
|
||||
Mod
|
||||
***
|
||||
|
||||
- ``[p]tempban`` now respects default days setting (``[p]modset defaultdays``) (:issue:`3993`)
|
||||
- Users can now set mention spam triggers which will warn or kick the user. See ``[p]modset mentionspam`` for more information (:issue:`3786`, :issue:`4038`)
|
||||
- ``[p]mute voice`` and ``[p]unmute voice`` now take action instantly if bot has Move Members permission (:issue:`4064`)
|
||||
- Added typing to ``[p](un)mute guild`` to indicate that mute is being processed (:issue:`4066`, :issue:`4172`)
|
||||
|
||||
ModLog
|
||||
******
|
||||
|
||||
- Added timestamp to text version of ``[p]casesfor`` and ``[p]case`` commands (:issue:`4118`, :issue:`4137`)
|
||||
|
||||
Streams
|
||||
*******
|
||||
|
||||
- Stream alerts will no longer make roles temporarily mentionable if bot has "Mention @everyone, @here, and All Roles" permission in the channel (:issue:`4182`)
|
||||
- Mixer service has been closed and for that reason we've removed support for it from the cog (:issue:`4072`)
|
||||
- Hitbox commands have been renamed to smashcast (:issue:`4161`)
|
||||
- Improve error messages for invalid channel names/IDs (:issue:`4147`, :issue:`4148`)
|
||||
|
||||
Trivia Lists
|
||||
************
|
||||
|
||||
- Added ``whosthatpokemon2`` trivia containing Pokémons from 2nd generation (:issue:`4102`)
|
||||
- Added ``whosthatpokemon3`` trivia containing Pokémons from 3rd generation (:issue:`4141`)
|
||||
|
||||
.. _important-340-3:
|
||||
|
||||
Developer changelog
|
||||
-------------------
|
||||
|
||||
| **Important:**
|
||||
| 1. Red now offers cog disabling API, which should be respected by 3rd-party cogs in guild-related actions happening outside of command's context. See the `Core Bot changelog below <important-dev-340-1>` for more information.
|
||||
| 2. Red now provides data request API, which should be supported by all 3rd-party cogs. See the changelog entries in the `Core Bot changelog below <important-dev-340-1>` for more information.
|
||||
|
||||
Breaking changes
|
||||
****************
|
||||
|
||||
- By default, none of the ``.send()`` methods mention roles or ``@everyone/@here`` (:issue:`3845`)
|
||||
|
||||
- see `discord.AllowedMentions` and ``allowed_mentions`` kwarg of ``.send()`` methods, if your cog requires to mention roles or ``@everyone/@here``
|
||||
|
||||
- `Context.maybe_send_embed()` now supresses all mentions, including user mentions (:issue:`4192`)
|
||||
- The default value of the ``filter`` keyword argument has been changed to ``None`` (:issue:`3845`)
|
||||
- Cog package names (i.e. name of the folder the cog is in and the name used when loading the cog) now have to be `valid Python identifiers <https://docs.python.org/3/reference/lexical_analysis.html#identifiers>`__ (:issue:`3605`, :issue:`3679`)
|
||||
- Method/attribute names starting with ``red_`` or being in the form of ``__red_*__`` are now reserved. See `version_guarantees` for more information (:issue:`4085`)
|
||||
- `humanize_list()` no longer raises `IndexError` for empty sequences (:issue:`2982`)
|
||||
- Removed things past deprecation time: (:issue:`4163`)
|
||||
|
||||
- ``redbot.core.commands.APIToken``
|
||||
- ``loop`` kwarg from `bounded_gather_iter()`, `bounded_gather()`, and `start_adding_reactions()`
|
||||
|
||||
.. _important-dev-340-1:
|
||||
|
||||
Core Bot
|
||||
********
|
||||
|
||||
- Added cog disabling API (:issue:`4043`, :issue:`3945`)
|
||||
|
||||
- New methods added: `bot.cog_disabled_in_guild() <RedBase.cog_disabled_in_guild()>`, `bot.cog_disabled_in_guild_raw() <RedBase.cog_disabled_in_guild_raw()>`
|
||||
- Cog disabling is automatically applied for commands and only needs to be done manually for things like event listeners; see `guidelines-for-cog-creators` for more information
|
||||
|
||||
- Added data request API (:issue:`4045`, :issue:`4169`)
|
||||
|
||||
- New special methods added to `commands.Cog`: `red_get_data_for_user()` (documented provisionally), `red_delete_data_for_user()`
|
||||
- New special module level variable added: ``__red_end_user_data_statement__``
|
||||
- These methods and variables should be added by all cogs according to their documentation; see `guidelines-for-cog-creators` for more information
|
||||
- New ``info.json`` key added: ``end_user_data_statement``; see `Info.json format documentation <info-json-format>` for more information
|
||||
|
||||
- Added `bot.message_eligible_as_command() <RedBase.message_eligible_as_command()>` utility method which can be used to determine if a message may be responded to as a command (:issue:`4077`)
|
||||
- Added a provisional API for replacing the help formatter. See `documentation <framework-commands-help>` for more details (:issue:`4011`)
|
||||
- `bot.ignored_channel_or_guild() <RedBase.ignored_channel_or_guild()>` now accepts `discord.Message` objects (:issue:`4077`)
|
||||
- `commands.NoParseOptional <NoParseOptional>` is no longer provisional and is now fully supported part of API (:issue:`4142`)
|
||||
- Red no longer fails to run subcommands of a command group allowed or denied by permission hook (:issue:`3956`)
|
||||
- Autohelp in group commands is now sent *after* invoking the group, which allows before invoke hooks to prevent autohelp from getting triggered (:issue:`4129`)
|
||||
- RPC functionality no longer makes Red hang for a minute on shutdown (:issue:`4134`, :issue:`4143`)
|
||||
|
||||
Vendored packages
|
||||
*****************
|
||||
|
||||
- Updated ``discord.ext.menus`` vendor (:issue:`4167`)
|
||||
|
||||
Utility Functions
|
||||
*****************
|
||||
|
||||
- `humanize_list()` now accepts ``locale`` and ``style`` keyword arguments. See its documentation for more information (:issue:`2982`)
|
||||
- `humanize_list()` is now properly localized (:issue:`2906`, :issue:`2982`)
|
||||
- `humanize_list()` now accepts empty sequences (:issue:`2982`)
|
||||
|
||||
|
||||
Documentation changes
|
||||
---------------------
|
||||
|
||||
- Removed install instructions for Debian Stretch (:issue:`4099`)
|
||||
- Added admin user guide (:issue:`3081`)
|
||||
- Added alias user guide (:issue:`3084`)
|
||||
- Added bank user guide (:issue:`4149`)
|
||||
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
- Updated features list in ``[p]serverinfo`` with the latest changes from Discord (:issue:`4116`)
|
||||
- Simple version of ``[p]serverinfo`` now shows info about more detailed ``[p]serverinfo 1`` (:issue:`4121`)
|
||||
- ``[p]set nickname``, ``[p]set serverprefix``, ``[p]streamalert``, and ``[p]streamset`` commands now can be run by users with permissions related to the actions they're making (:issue:`4109`)
|
||||
- `bordered()` now uses ``+`` for corners if keyword argument ``ascii_border`` is set to `True` (:issue:`4097`)
|
||||
- Fixed timestamp storage in few places in Red (:issue:`4017`)
|
||||
@@ -1,110 +0,0 @@
|
||||
.. CustomCommands Cog Reference
|
||||
.. _cog_customcom:
|
||||
|
||||
============================
|
||||
CustomCommands Cog Reference
|
||||
============================
|
||||
|
||||
------------
|
||||
How it works
|
||||
------------
|
||||
|
||||
CustomCommands allows you to create simple commands for your bot without requiring you to code your own cog for Red.
|
||||
|
||||
If the command you attempt to create shares a name with an already loaded command, you cannot overwrite it with this cog.
|
||||
|
||||
---------
|
||||
Cooldowns
|
||||
---------
|
||||
|
||||
You can set cooldowns for your custom commands. If a command is on cooldown, it will not be triggered.
|
||||
|
||||
You can set cooldowns per member or per channel, or set a cooldown guild-wide. You can also set multiple types of cooldown on a single custom command. All cooldowns must pass before the command will trigger.
|
||||
|
||||
------------------
|
||||
Context Parameters
|
||||
------------------
|
||||
|
||||
You can enhance your custom command's response by leaving spaces for the bot to substitute.
|
||||
|
||||
+-----------+----------------------------------------+
|
||||
| Argument | Substitute |
|
||||
+===========+========================================+
|
||||
| {message} | The message the bot is responding to. |
|
||||
+-----------+----------------------------------------+
|
||||
| {author} | The user who called the command. |
|
||||
+-----------+----------------------------------------+
|
||||
| {channel} | The channel the command was called in. |
|
||||
+-----------+----------------------------------------+
|
||||
| {server} | The server the command was called in. |
|
||||
+-----------+----------------------------------------+
|
||||
| {guild} | Same as with {server}. |
|
||||
+-----------+----------------------------------------+
|
||||
|
||||
You can further refine the response with dot notation. For example, {author.mention} will mention the user who called the command.
|
||||
|
||||
------------------
|
||||
Command Parameters
|
||||
------------------
|
||||
|
||||
You can further enhance your custom command's response by leaving spaces for the user to substitute.
|
||||
|
||||
To do this, simply put {#} in the response, replacing # with any number starting with 0. Each number will be replaced with what the user gave the command, in order.
|
||||
|
||||
You can refine the response with colon notation. For example, {0:Member} will accept members of the server, and {0:int} will accept a number. If no colon notation is provided, the argument will be returned unchanged.
|
||||
|
||||
+-----------------+--------------------------------+
|
||||
| Argument | Substitute |
|
||||
+=================+================================+
|
||||
| {#:Member} | A member of your server. |
|
||||
+-----------------+--------------------------------+
|
||||
| {#:TextChannel} | A text channel in your server. |
|
||||
+-----------------+--------------------------------+
|
||||
| {#:Role} | A role in your server. |
|
||||
+-----------------+--------------------------------+
|
||||
| {#:int} | A whole number. |
|
||||
+-----------------+--------------------------------+
|
||||
| {#:float} | A decimal number. |
|
||||
+-----------------+--------------------------------+
|
||||
| {#:bool} | True or False. |
|
||||
+-----------------+--------------------------------+
|
||||
|
||||
You can specify more than the above with colon notation, but those are the most common.
|
||||
|
||||
As with context parameters, you can use dot notation to further refine the response. For example, {0.mention:Member} will mention the Member specified.
|
||||
|
||||
----------------
|
||||
Example commands
|
||||
----------------
|
||||
|
||||
Showing your own avatar
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]customcom add simple avatar {author.avatar_url}
|
||||
[p]avatar
|
||||
https://cdn.discordapp.com/avatars/133801473317404673/be4c4a4fe47cb3e74c31a0504e7a295e.webp?size=1024
|
||||
|
||||
Repeating the user
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]customcom add simple say {0}
|
||||
[p]say Pete and Repeat
|
||||
Pete and Repeat
|
||||
|
||||
Greeting the specified member
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]customcom add simple greet Hello, {0.mention:Member}!
|
||||
[p]greet Twentysix
|
||||
Hello, @Twentysix!
|
||||
|
||||
Comparing two text channel's categories
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]customcom add simple comparecategory {0.category:TextChannel} | {1.category:TextChannel}
|
||||
[p]comparecategory #support #general
|
||||
Red | Community
|
||||
@@ -1,435 +0,0 @@
|
||||
.. _admin:
|
||||
|
||||
=====
|
||||
Admin
|
||||
=====
|
||||
|
||||
This is the cog guide for the admin cog. You will
|
||||
find detailed docs about usage and commands.
|
||||
|
||||
``[p]`` is considered as your prefix.
|
||||
|
||||
.. note:: To use this cog, load it by typing this::
|
||||
|
||||
[p]load admin
|
||||
|
||||
.. _admin-usage:
|
||||
|
||||
-----
|
||||
Usage
|
||||
-----
|
||||
|
||||
This cog will provide tools for server admins and bot owners.
|
||||
|
||||
It can add or remove a role to a member, edit one or make some available
|
||||
for members so they can self-assign them as they wish.
|
||||
|
||||
It also provides tools for the bot owner such as server locking (once enabled,
|
||||
the bot will instantly leave new servers she joins) and announcements, which
|
||||
will send something in all the servers of the bot.
|
||||
|
||||
.. _admin-commands:
|
||||
|
||||
--------
|
||||
Commands
|
||||
--------
|
||||
|
||||
Here's a list of all commands available for this cog.
|
||||
|
||||
.. _admin-command-selfrole:
|
||||
|
||||
^^^^^^^^
|
||||
selfrole
|
||||
^^^^^^^^
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]selfrole
|
||||
|
||||
**Description**
|
||||
|
||||
Add or remove roles to yourself. Those roles must have been configured as user
|
||||
settable by admins using the :ref:`selfroleset command
|
||||
<admin-command-selfroleset>`.
|
||||
|
||||
.. _admin-command-selfrole-add:
|
||||
|
||||
""""""""""""
|
||||
selfrole add
|
||||
""""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]selfrole add <selfrole>
|
||||
|
||||
**Description**
|
||||
|
||||
Add a role to yourself. It must have been configured as user settable
|
||||
by admins using the :ref:`selfroleset command <admin-command-selfroleset>`.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<selfrole>``: The role you want to attribute to yourself. |role-input|
|
||||
|
||||
.. _admin-command-selfrole-remove:
|
||||
|
||||
"""""""""""""""
|
||||
selfrole remove
|
||||
"""""""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]selfrole remove <selfrole>
|
||||
|
||||
**Description**
|
||||
|
||||
Remove a role from yourself. It must have been configured as user settable
|
||||
by admins using the :ref:`selfroleset command <admin-command-selfroleset>`.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<selfrole>``: The role you want to remove from yourself. |role-input|
|
||||
|
||||
|
||||
.. _admin-command-selfrole-list:
|
||||
|
||||
"""""""""""""
|
||||
selfrole list
|
||||
"""""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]selfrole list
|
||||
|
||||
**Description**
|
||||
|
||||
List all of the available roles you can assign to yourself.
|
||||
|
||||
.. _admin-command-selfroleset:
|
||||
|
||||
^^^^^^^^^^^
|
||||
selfroleset
|
||||
^^^^^^^^^^^
|
||||
|
||||
.. note:: |admin-lock| This is also usable by the members with the
|
||||
``Manage roles`` permission.
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]selfroleset
|
||||
|
||||
**Description**
|
||||
|
||||
Define the list of user settable roles. Those roles will be available to any
|
||||
member using the :ref:`selfrole command <admin-command-selfrole>`.
|
||||
|
||||
.. _admin-command-selfroleset-add:
|
||||
|
||||
"""""""""""""""
|
||||
selfroleset add
|
||||
"""""""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]selfroleset add <role>
|
||||
|
||||
**Description**
|
||||
|
||||
Add a role to the list of selfroles.
|
||||
|
||||
.. warning:: Members will be able to assign themselves the role.
|
||||
Make sure it doesn't give extra perms or anything that can break
|
||||
your server's security.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<role>``: The role to add to the list. |role-input|
|
||||
|
||||
.. _admin-command-selfroleset-remove:
|
||||
|
||||
""""""""""""""""""
|
||||
selfroleset remove
|
||||
""""""""""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]selfroleset remove <role>
|
||||
|
||||
**Description**
|
||||
|
||||
Removes a role from the list of selfroles.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<role>``: The role to remove from the list. |role-input|
|
||||
|
||||
.. _admin-command-addrole:
|
||||
|
||||
^^^^^^^
|
||||
addrole
|
||||
^^^^^^^
|
||||
|
||||
.. note:: |admin-lock| This is also usable by the members with the ``Manage
|
||||
roles`` permission.
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]addrole <rolename> [user]
|
||||
|
||||
**Description**
|
||||
|
||||
Adds a role to a member. If ``user`` is not given, it will be considered
|
||||
as yourself, the command author.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<role>``: The role to add to the member. |role-input-quotes|
|
||||
|
||||
* ``[user]``: The member you want to add the role to. Defaults to the
|
||||
command author. |member-input|
|
||||
|
||||
.. _admin-command-removerole:
|
||||
|
||||
^^^^^^^^^^
|
||||
removerole
|
||||
^^^^^^^^^^
|
||||
|
||||
.. note:: |admin-lock| This is also usable by the members with the
|
||||
``Manage roles`` permission.
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]removerole <rolename> [user]
|
||||
|
||||
**Description**
|
||||
|
||||
Removes a role from a member. If ``user`` is not given, it will be considered
|
||||
as yourself, the command author.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<role>``: The role to remove. |role-input-quotes|
|
||||
|
||||
* ``[user]``: The member to remove the role from. |member-input| Defaults
|
||||
to the command author.
|
||||
|
||||
.. _admin-command-editrole:
|
||||
|
||||
^^^^^^^^
|
||||
editrole
|
||||
^^^^^^^^
|
||||
|
||||
.. note:: |admin-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]editrole
|
||||
|
||||
**Description**
|
||||
|
||||
Edits the settings of a role.
|
||||
|
||||
.. _admin-command-editrole-name:
|
||||
|
||||
"""""""""""""
|
||||
editrole name
|
||||
"""""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]editrole name <role> <name>
|
||||
|
||||
**Description**
|
||||
|
||||
Edits the name of a role.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<role>``: The role name to edit. |role-input-quotes|
|
||||
|
||||
* ``<name>``: The new role name. If it has spaces, you must use quotes.
|
||||
|
||||
.. _admin-command-editrole-color:
|
||||
|
||||
""""""""""""""
|
||||
editrole color
|
||||
""""""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]editrole color <role> <color>
|
||||
|
||||
**Description**
|
||||
|
||||
Edits the color of a role.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<role>``: The role name to edit. |role-input-quotes|
|
||||
|
||||
* ``<color>``: The new color to assign. |color-input|
|
||||
|
||||
**Examples**
|
||||
|
||||
* ``[p]editrole color "My role" #ff0000``
|
||||
|
||||
* ``[p]editrole color "My role" dark_blue``
|
||||
|
||||
.. _admin-command-announce:
|
||||
|
||||
^^^^^^^^
|
||||
announce
|
||||
^^^^^^^^
|
||||
|
||||
.. note:: |owner-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]announce <message>
|
||||
|
||||
**Description**
|
||||
|
||||
Announce your message to all of the servers the bot is in.
|
||||
|
||||
The bot will announce the message in the guild's announcements channel.
|
||||
If this channel is not set, the message won't be announced.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<message>``: The message to send.
|
||||
|
||||
.. _admin-command-announce-cancel:
|
||||
|
||||
"""""""""""""""
|
||||
announce cancel
|
||||
"""""""""""""""
|
||||
|
||||
.. note:: |owner-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]announce cancel
|
||||
|
||||
**Description**
|
||||
|
||||
Cancels an active announcement.
|
||||
|
||||
.. _admin-command-announceset:
|
||||
|
||||
^^^^^^^^^^^
|
||||
announceset
|
||||
^^^^^^^^^^^
|
||||
|
||||
.. note:: |guildowner-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]announceset
|
||||
|
||||
**Description**
|
||||
|
||||
Change how announcements are received in this guild.
|
||||
|
||||
.. _admin-command-announceset-channel:
|
||||
|
||||
"""""""""""""""""""
|
||||
announceset channel
|
||||
"""""""""""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]announceset channel [channel]
|
||||
|
||||
**Description**
|
||||
|
||||
Sets the channel where the bot owner announcements will be sent.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``[channel]``: The channel that will be used for bot announcements.
|
||||
|channel-input| Defaults to where you typed the command.
|
||||
|
||||
.. _admin-command-announceset-clearchannel:
|
||||
|
||||
""""""""""""""""""""""""
|
||||
announceset clearchannel
|
||||
""""""""""""""""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]announceset clearchannel
|
||||
|
||||
**Description**
|
||||
|
||||
Disables announcements on your server. To enable them again, you will have to
|
||||
re-enter your announcements channel with the :ref:`announceset channel
|
||||
<admin-command-announceset-channel>` command.
|
||||
|
||||
.. _admin-command-serverlock:
|
||||
|
||||
^^^^^^^^^^
|
||||
serverlock
|
||||
^^^^^^^^^^
|
||||
|
||||
.. note:: |owner-lock| This is also usable by the members with the
|
||||
``Administrator`` permission.
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]serverlock
|
||||
|
||||
**Description**
|
||||
|
||||
Lock a bot to its current servers only.
|
||||
|
||||
This means that, once you enable this, if someone invites the bot to a new
|
||||
server, the bot will automatically leave the server.
|
||||
|
||||
.. tip:: Another way to prevent your bot from being invited on more servers is
|
||||
making it private directly from the developer portal.
|
||||
|
||||
Once a bot is private, it can only be invited by its owner (or team
|
||||
owners). Other users will get an error on Discord's webpage explaining that
|
||||
the bot is private.
|
||||
|
||||
To do this, go to the `Discord developer portal
|
||||
<https://discord.com/developers>`_, select your application, click "Bot" in
|
||||
the sidebar, then untick "Public bot".
|
||||
|
||||
.. image:: ../.resources/admin/public_bot.png
|
||||
@@ -1,277 +0,0 @@
|
||||
.. _alias:
|
||||
|
||||
=====
|
||||
Alias
|
||||
=====
|
||||
|
||||
This is the cog guide for the alias cog. You will
|
||||
find detailed docs about the usage and the commands.
|
||||
|
||||
``[p]`` is considered as your prefix.
|
||||
|
||||
.. note:: To use this cog, load it by typing this::
|
||||
|
||||
[p]load alias
|
||||
|
||||
.. _alias-usage:
|
||||
|
||||
-----
|
||||
Usage
|
||||
-----
|
||||
|
||||
This cog is used to create shortcuts for commands.
|
||||
|
||||
Here's an example:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
[p]play
|
||||
# with an alias, you can call the command above with a shortcut like this:
|
||||
[p]p
|
||||
# "p" is now a shortcut for "play"
|
||||
|
||||
In this example, we made an alias named ``p`` that will
|
||||
invoke the ``play`` command. If you use ``[p]play`` or ``[p]p``, the result will
|
||||
be the same.
|
||||
|
||||
----
|
||||
|
||||
Here's another example
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
[p]cleanup messages
|
||||
# now we're creating another alias that will group both the command and the subcommand into this:
|
||||
[p]clear
|
||||
# "clear" is now a shortcut for "cleanup messages"
|
||||
|
||||
In this second example, we made an alias called ``clear`` that will
|
||||
invoke the ``cleanup messages`` subcommand. Now if you use ``[p]cleanup
|
||||
message`` or ``[p]clear``, the result will be the same.
|
||||
|
||||
----
|
||||
|
||||
This is the basic usage, where you can define an alias for the first part of
|
||||
the command and give the second part when invoking the command. A more advanced
|
||||
usage of aliases is the usage of arguments.
|
||||
|
||||
Let's suppose you want to make an alias to ban someone, delete 7 days of
|
||||
messages and set the reason to "Spam bot.", that cannot be done with a classic
|
||||
alias since the required member argument is the first one. If you create the
|
||||
alias "spamban" using arguments like this ``ban {0} 7 Spam bot.``, ``{0}`` will
|
||||
be replaced by the first argument of your alias:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
# we created the following alias named "spamban"
|
||||
[p]spamban Slime#3160
|
||||
# this alias will execute the following command:
|
||||
[p]ban Slime#3160 7 Spam bot.
|
||||
|
||||
For a more detailed explaination, read :ref:`this <alias-command-alias-add>`.
|
||||
|
||||
.. _alias-commands:
|
||||
|
||||
--------
|
||||
Commands
|
||||
--------
|
||||
|
||||
.. _alias-command-alias:
|
||||
|
||||
^^^^^
|
||||
alias
|
||||
^^^^^
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]alias
|
||||
|
||||
**Description**
|
||||
|
||||
This is the main command used for setting up the cog.
|
||||
It will be used for all other commands.
|
||||
|
||||
.. _alias-command-alias-add:
|
||||
|
||||
"""""""""
|
||||
alias add
|
||||
"""""""""
|
||||
|
||||
.. note:: |mod-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]alias add <alias_name> <command>
|
||||
|
||||
**Description**
|
||||
|
||||
Creates an alias. It will be used like this ``[p]alias_name <arguments>``
|
||||
and will be equal to this ``[p]command <arguments>``.
|
||||
|
||||
Let's develop the examples given :ref:`earlier <alias-usage>` a bit more,
|
||||
the left part of the command is the alias (blue), and the right part is the
|
||||
parameters members have to give for the command (orange).
|
||||
|
||||
.. image:: ../.resources/alias/example-1.png
|
||||
|
||||
One more thing you can do with aliases is using arguments, a bit like
|
||||
CustomCommands. Let's suppose you want an alias that bans x member and deletes
|
||||
7 days of messages. Without aliases, the command would look like this:
|
||||
|
||||
``[p]ban NotSoTrustyJAID#0001 7 My random reason``
|
||||
|
||||
A classic alias wouldn't work because the member argument is the first one,
|
||||
and you can only shorten the left part before the required argument.
|
||||
|
||||
An alias with arguments can fix that, you can define the alias on the whole
|
||||
command and replace the required argument by ``{0}``, which will be replaced
|
||||
by the first parameter given when invoking the alias.
|
||||
|
||||
Back to our example, let's make an alias named ``bigban`` which will be
|
||||
assigned to this expression: ``ban {0} 7``
|
||||
|
||||
.. image:: ../.resources/alias/example-2.png
|
||||
|
||||
You can see in blue the "static" part of the alias, what is contained and
|
||||
doesn't need to be given, the orange part is the arguments given at the end of
|
||||
the command, just like a classic alias, and the green part is the positional
|
||||
argument we defined: the first argument of the alias will be the green part.
|
||||
|
||||
You can add as many arguments as you want, they can start at ``{0}`` or ``{1}``
|
||||
and must be in order: ``{1}`` will be the first argument, ``{2}`` will be the
|
||||
second one...
|
||||
|
||||
.. attention:: The numbers must be in order, you cannot use ``{0}`` and ``{2}``
|
||||
without using ``{1}``.
|
||||
|
||||
Here are more examples:
|
||||
|
||||
* * Full command: ``[p]cleanup messages 75 True``
|
||||
* Alias: ``[p]alias add fullclear cleanup messages {0} True``
|
||||
* Invoked alias: ``[p]fullclear 75``
|
||||
|
||||
*The* ``True`` *at the end tells the bot to also clear pinned messages.*
|
||||
|
||||
* * Full command: ``[p]repo add SinbadCogs
|
||||
https://github.com/mikeshardmind/SinbadCogs v3``
|
||||
|
||||
* Alias: ``[p]alias add newrepo repo add {2} https://github.com/{1}/{2}``
|
||||
* Invoked with alias: ``[p]newrepo mikeshardmind SinbadCogs v3``
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<alias_name>``: The new command name.
|
||||
|
||||
* ``<command>``: The command to execute when ``[p]alias_name`` is invoked.
|
||||
|
||||
.. _alias-command-alias-delete:
|
||||
|
||||
""""""""""""
|
||||
alias delete
|
||||
""""""""""""
|
||||
|
||||
.. note:: |mod-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]alias [delete|remove|del] <alias_name>
|
||||
|
||||
**Description**
|
||||
|
||||
Removes an alias from the list. Check the list with
|
||||
the :ref:`alias list <alias-command-alias-list>` command.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<alias_name>``: The alias' name to delete.
|
||||
|
||||
.. _alias-command-alias-list:
|
||||
|
||||
""""""""""
|
||||
alias list
|
||||
""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]alias list
|
||||
|
||||
**Description**
|
||||
|
||||
Shows all of the existing aliases on the current server.
|
||||
|
||||
.. _alias-command-alias-show:
|
||||
|
||||
""""""""""
|
||||
alias show
|
||||
""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]alias show <alias_name>
|
||||
|
||||
**Description**
|
||||
|
||||
Shows the command associated to the alias.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<alias_name>``: The alias you want information from.
|
||||
|
||||
.. _alias-command-alias-help:
|
||||
|
||||
""""""""""
|
||||
alias help
|
||||
""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]alias help <alias_name>
|
||||
|
||||
**Description**
|
||||
|
||||
Shows help message for an alias.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<alias_name>``: Alias you want to get help from.
|
||||
|
||||
.. _alias-command-alias-global:
|
||||
|
||||
""""""""""""
|
||||
alias global
|
||||
""""""""""""
|
||||
|
||||
.. note:: |owner-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]alias global
|
||||
|
||||
**Description**
|
||||
|
||||
Another group command which contains the :ref:`add
|
||||
<alias-command-alias-add>`, :ref:`del
|
||||
<alias-command-alias-delete>` and :ref:`list
|
||||
<alias-command-alias-list>` commands.
|
||||
|
||||
They work the same, except the created aliases will be
|
||||
global instead of being only server-wide.
|
||||
|
||||
Please refer to these docs for the commands, they work with the
|
||||
same arguments. For example, if you want to add a global alias,
|
||||
instead of doing ``[p]alias add <arguments>``, do ``[p]alias
|
||||
global add <arguments>``.
|
||||
@@ -1,186 +0,0 @@
|
||||
.. _bank:
|
||||
|
||||
====
|
||||
Bank
|
||||
====
|
||||
|
||||
This is the cog guide for the bank cog. You will
|
||||
find detailed docs about usage and commands.
|
||||
|
||||
``[p]`` is considered as your prefix.
|
||||
|
||||
.. note:: To use this cog, load it by typing this::
|
||||
|
||||
[p]load bank
|
||||
|
||||
.. _bank-usage:
|
||||
|
||||
-----
|
||||
Usage
|
||||
-----
|
||||
|
||||
This cog manages the bank. It won't be used often by
|
||||
users but this is what makes any interaction with the
|
||||
money possible.
|
||||
|
||||
You will be able to switch between a global and a server-
|
||||
wide bank and choose the bank/currency name.
|
||||
|
||||
.. _bank-commands:
|
||||
|
||||
--------
|
||||
Commands
|
||||
--------
|
||||
|
||||
.. _bank-command-bankset:
|
||||
|
||||
^^^^^^^
|
||||
bankset
|
||||
^^^^^^^
|
||||
|
||||
.. note:: |guildowner-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]bankset
|
||||
|
||||
**Description**
|
||||
|
||||
Base command for configuring bank settings.
|
||||
|
||||
.. _bank-command-bankset-toggleglobal:
|
||||
|
||||
""""""""""""""""""""
|
||||
bankset toggleglobal
|
||||
""""""""""""""""""""
|
||||
|
||||
.. note:: |owner-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]bankset toggleglobal [confirm=False]
|
||||
|
||||
**Description**
|
||||
|
||||
Makes the bank global instead of server-wide. If it
|
||||
is already global, the command will switch it back
|
||||
to the server-wide bank.
|
||||
|
||||
.. warning:: Using this command will reset **all** accounts.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``[confirm=False]``: Put ``yes`` to confirm.
|
||||
|
||||
.. _bank-command-bankset-creditsname:
|
||||
|
||||
"""""""""""""""""""
|
||||
bankset creditsname
|
||||
"""""""""""""""""""
|
||||
|
||||
.. note:: |owner-lock| However, if the bank is server-wide, the
|
||||
server owner or an administrator can use this command.
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]bankset creditsname <name>
|
||||
|
||||
**Description**
|
||||
|
||||
Change the credits name of the bank. It is ``credits`` by default.
|
||||
|
||||
For example, if you switch it to ``dollars``, the payday
|
||||
command will show this:
|
||||
|
||||
.. TODO reference the payday command
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
Here, take some dollars. Enjoy! (+120 dollars!)
|
||||
|
||||
You currently have 220 dollars.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<name>``: The new credits name.
|
||||
|
||||
.. _bank-command-bankset-bankname:
|
||||
|
||||
""""""""""""""""
|
||||
bankset bankname
|
||||
""""""""""""""""
|
||||
|
||||
.. note:: |owner-lock| However, if the bank is server-wide, the
|
||||
server owner or an administrator can use this command.
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]bankset bankname <name>
|
||||
|
||||
**Description**
|
||||
|
||||
Set bank's name.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<name>``: The new bank's name.
|
||||
|
||||
.. _bank-command-bankset-maxbal:
|
||||
|
||||
""""""""""""""
|
||||
bankset maxbal
|
||||
""""""""""""""
|
||||
|
||||
.. note:: |owner-lock| However, if the bank is server-wide, the
|
||||
server owner or an administrator can use this command.
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]bankset maxbal <amount>
|
||||
|
||||
**Description**
|
||||
|
||||
Defines the maximum amount of money a user can have with the bot.
|
||||
|
||||
If an user reaches this limit, he will be unable to gain more money.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<amount>``: The maximum amount of money for users.
|
||||
|
||||
.. _bank-command-bankset-showsettings:
|
||||
|
||||
""""""""""""""""""""
|
||||
bankset showsettings
|
||||
""""""""""""""""""""
|
||||
|
||||
.. note:: |owner-lock| However, if the bank is server-wide, the
|
||||
server owner or an administrator can use this command.
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]bankset showsettings
|
||||
|
||||
**Description**
|
||||
|
||||
Shows the current settings of your bank.
|
||||
|
||||
This will display the following information:
|
||||
|
||||
* Name of the bank
|
||||
* Scope of the bank (global or per server)
|
||||
* Currency name
|
||||
* Default balance
|
||||
* Maximum allowed balance
|
||||
@@ -1,296 +0,0 @@
|
||||
.. _cleanup:
|
||||
|
||||
=======
|
||||
Cleanup
|
||||
=======
|
||||
|
||||
This is the cog guide for the cleanup cog. You will
|
||||
find detailed docs about usage and commands.
|
||||
|
||||
``[p]`` is considered as your prefix.
|
||||
|
||||
.. note:: To use this cog, load it by typing this::
|
||||
|
||||
[p]load cleanup
|
||||
|
||||
.. _cleanup-usage:
|
||||
|
||||
-----
|
||||
Usage
|
||||
-----
|
||||
|
||||
This cog contains commands used for "cleaning up" (deleting) messages.
|
||||
|
||||
This is designed as a moderator tool and offers many convenient use cases.
|
||||
All cleanup commands only apply to the channel the command is executed in.
|
||||
|
||||
Messages older than two weeks cannot be mass deleted.
|
||||
This is a limitation of the API.
|
||||
|
||||
|
||||
.. _cleanup-commands:
|
||||
|
||||
--------
|
||||
Commands
|
||||
--------
|
||||
|
||||
.. _cleanup-command-cleanup:
|
||||
|
||||
^^^^^^^
|
||||
cleanup
|
||||
^^^^^^^
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]cleanup
|
||||
|
||||
**Description**
|
||||
|
||||
Base command for deleting messages.
|
||||
|
||||
.. _cleanup-command-cleanup-after:
|
||||
|
||||
"""""""""""""
|
||||
cleanup after
|
||||
"""""""""""""
|
||||
|
||||
.. note:: |mod-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]cleanup after <message_id> [delete_pinned=False]
|
||||
|
||||
**Description**
|
||||
|
||||
Delete all messages after a specified message.
|
||||
|
||||
To get a message id, enable developer mode in Discord's
|
||||
settings, 'appearance' tab. Then right click a message
|
||||
and copy its id.
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<message_id>`` The id of the message to cleanup after. This message won't be deleted.
|
||||
- ``<delete_pinned>`` Whether to delete pinned messages or not. Defaults to False
|
||||
|
||||
.. _cleanup-command-cleanup-before:
|
||||
|
||||
""""""""""""""
|
||||
cleanup before
|
||||
""""""""""""""
|
||||
|
||||
.. note:: |mod-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]cleanup before <message_id> <number> [delete_pinned=False]
|
||||
|
||||
**Description**
|
||||
|
||||
Deletes X messages before the specified message.
|
||||
|
||||
To get a message id, enable developer mode in Discord's
|
||||
settings, 'appearance' tab. Then right click a message
|
||||
and copy its id.
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<message_id>`` The id of the message to cleanup before. This message won't be deleted.
|
||||
- ``<number>`` The max number of messages to cleanup. Must be a positive integer.
|
||||
- ``<delete_pinned>`` Whether to delete pinned messages or not. Defaults to False
|
||||
|
||||
.. _cleanup-command-cleanup-between:
|
||||
|
||||
"""""""""""""""
|
||||
cleanup between
|
||||
"""""""""""""""
|
||||
|
||||
.. note:: |mod-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]cleanup between <one> <two> [delete_pinned=False]
|
||||
|
||||
**Description**
|
||||
|
||||
Delete the messages between Message One and Message Two, providing the messages IDs.
|
||||
|
||||
The first message ID should be the older message and the second one the newer.
|
||||
|
||||
Example:
|
||||
- ``[p]cleanup between 123456789123456789 987654321987654321``
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<one>`` The id of the message to cleanup after. This message won't be deleted.
|
||||
- ``<two>`` The id of the message to cleanup before. This message won't be deleted.
|
||||
- ``<delete_pinned>`` Whether to delete pinned messages or not. Defaults to False
|
||||
|
||||
.. _cleanup-command-cleanup-bot:
|
||||
|
||||
"""""""""""
|
||||
cleanup bot
|
||||
"""""""""""
|
||||
|
||||
.. note:: |mod-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]cleanup bot <number> [delete_pinned=False]
|
||||
|
||||
**Description**
|
||||
|
||||
Clean up command messages and messages from the bot.
|
||||
|
||||
Can only cleanup custom commands and alias commands if those cogs are loaded.
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<number>`` The max number of messages to cleanup. Must be a positive integer.
|
||||
- ``<delete_pinned>`` Whether to delete pinned messages or not. Defaults to False
|
||||
|
||||
.. _cleanup-command-cleanup-messages:
|
||||
|
||||
""""""""""""""""
|
||||
cleanup messages
|
||||
""""""""""""""""
|
||||
|
||||
.. note:: |mod-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]cleanup messages <number> [delete_pinned=False]
|
||||
|
||||
**Description**
|
||||
|
||||
Delete the last X messages.
|
||||
|
||||
Example:
|
||||
- ``[p]cleanup messages 26``
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<number>`` The max number of messages to cleanup. Must be a positive integer.
|
||||
- ``<delete_pinned>`` Whether to delete pinned messages or not. Defaults to False
|
||||
|
||||
.. _cleanup-command-cleanup-self:
|
||||
|
||||
""""""""""""
|
||||
cleanup self
|
||||
""""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]cleanup self <number> [match_pattern] [delete_pinned=False]
|
||||
|
||||
**Description**
|
||||
|
||||
Clean up messages owned by the bot.
|
||||
|
||||
By default, all messages are cleaned. If a second argument is specified,
|
||||
it is used for pattern matching - only messages containing the given text will be deleted.
|
||||
|
||||
Examples:
|
||||
- ``[p]cleanup self 6``
|
||||
- ``[p]cleanup self 10 Pong``
|
||||
- ``[p]cleanup self 7 "" True``
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<number>`` The max number of messages to cleanup. Must be a positive integer.
|
||||
- ``<match_pattern>`` The text that messages must contain to be deleted. Use "" to skip this.
|
||||
- ``<delete_pinned>`` Whether to delete pinned messages or not. Defaults to False
|
||||
|
||||
.. _cleanup-command-cleanup-spam:
|
||||
|
||||
""""""""""""
|
||||
cleanup spam
|
||||
""""""""""""
|
||||
|
||||
.. note:: |mod-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]cleanup spam [number=50]
|
||||
|
||||
**Description**
|
||||
|
||||
Deletes duplicate messages in the channel from the last X messages and keeps only one copy.
|
||||
|
||||
Defaults to 50.
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<number>`` The number of messages to check for duplicates. Must be a positive integer.
|
||||
|
||||
.. _cleanup-command-cleanup-text:
|
||||
|
||||
""""""""""""
|
||||
cleanup text
|
||||
""""""""""""
|
||||
|
||||
.. note:: |mod-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]cleanup text <text> <number> [delete_pinned=False]
|
||||
|
||||
**Description**
|
||||
|
||||
Delete the last X messages matching the specified text.
|
||||
|
||||
Example:
|
||||
- ``[p]cleanup text "test" 5``
|
||||
|
||||
Remember to use double quotes.
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<number>`` The max number of messages to cleanup. Must be a positive integer.
|
||||
- ``<delete_pinned>`` Whether to delete pinned messages or not. Defaults to False
|
||||
|
||||
.. _cleanup-command-cleanup-user:
|
||||
|
||||
""""""""""""
|
||||
cleanup user
|
||||
""""""""""""
|
||||
|
||||
.. note:: |mod-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]cleanup user <user> <number> [delete_pinned=False]
|
||||
|
||||
**Description**
|
||||
|
||||
Delete the last X messages from a specified user.
|
||||
|
||||
Examples:
|
||||
- ``[p]cleanup user @Twentysix 2``
|
||||
- ``[p]cleanup user Red 6``
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<user>`` The user whose messages are to be cleaned up.
|
||||
- ``<number>`` The max number of messages to cleanup. Must be a positive integer.
|
||||
- ``<delete_pinned>`` Whether to delete pinned messages or not. Defaults to False
|
||||
@@ -1,249 +0,0 @@
|
||||
.. _cogmanagerui:
|
||||
|
||||
==============
|
||||
Cog Manager UI
|
||||
==============
|
||||
|
||||
This is the cog guide for the core cog. You will
|
||||
find detailed docs about usage and commands.
|
||||
|
||||
``[p]`` is considered as your prefix.
|
||||
|
||||
.. note:: This cog is not like the other cogs. It is loaded by default, not
|
||||
included in the cogs paths and it cannot be unloaded. It contains needed
|
||||
commands for cog management.
|
||||
|
||||
.. _cogmanaerui-usage:
|
||||
|
||||
-----
|
||||
Usage
|
||||
-----
|
||||
|
||||
This cog allows you to manage your cogs and where you can install them. Unlike
|
||||
V2, which had a ``cogs`` folder where everything was installed, you can
|
||||
install V3 cogs everywhere, and also make them cross-compatible with other
|
||||
instances!
|
||||
|
||||
If you want to install your cogs using a Github repo (usually what you will
|
||||
always be looking for), you need to use the downloader cog. However, if you
|
||||
have the files of a cog or want to code one, this cog is what you should be
|
||||
looking for.
|
||||
|
||||
The most basic command is :ref:`paths <cogmanagerui-command-paths>`, which
|
||||
will list you all of the currently set paths.
|
||||
|
||||
You can add a path by using the :ref:`addpath <cogmanagerui-command-addpath>`
|
||||
command. All cogs in that path will be available for the bot and listed in
|
||||
the :ref:`cogs <cogmanagerui-command-cogs>`. You can then load
|
||||
or unload them.
|
||||
|
||||
.. TODO add ref to load and unload commands
|
||||
|
||||
.. _cogmanagerui-usage-installation:
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
How to install a local package without using downloader
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Let's suppose you made a cog request on the `cog board <https://cogboard.red>`_
|
||||
and now you want to add your own cog to Red. You should have a folder that
|
||||
looks like this:
|
||||
|
||||
.. image:: ../.resources/cog_manager_ui/custom-cog-example.png
|
||||
|
||||
You will first need to add a cog path to your instance. For that, use the
|
||||
:ref:`addpath <cogmanagerui-command-addpath>` command with a new directory.
|
||||
|
||||
Create a folder somewhere (should stay accessible) and copy its path. A path
|
||||
looks like this:
|
||||
|
||||
* Windows: ``C:\Users\username\Documents\MyCogs``
|
||||
* macOS: ``/Users/username/Documents/MyCogs``
|
||||
* Linux: ``/home/username/Documents/MyCogs``
|
||||
|
||||
You can now use the command we talked about before: type ``[p]addpath
|
||||
<your_path>``.
|
||||
|
||||
.. attention:: A path shouldn't have spaces in it. If it does, add quotation
|
||||
marks around the path, or a backslash before the space.
|
||||
|
||||
In that ``MyCogs`` folder, you can drop your cog folder. You should now have
|
||||
something that looks like this:
|
||||
|
||||
.. image:: ../.resources/cog_manager_ui/cog-path.png
|
||||
|
||||
Now if you type ``[p]cogs``, your new cog should be listed, and you will be
|
||||
able to load it!
|
||||
|
||||
.. _cogmanagerui-commands:
|
||||
|
||||
--------
|
||||
Commands
|
||||
--------
|
||||
|
||||
.. note:: The whole cog is locked to the
|
||||
:ref:`bot owner <getting-started-permissions>`. If you are not the owner
|
||||
of the instance, you can ignore this.
|
||||
|
||||
.. _cogmanagerui-command-cogs:
|
||||
|
||||
^^^^
|
||||
cogs
|
||||
^^^^
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]cogs
|
||||
|
||||
**Description**
|
||||
|
||||
Returns a list of loaded and unloaded cogs on the bot.
|
||||
|
||||
Cogs are unloaded by default. This is where you can find your cogs if you
|
||||
installed some recently.
|
||||
|
||||
All of the cogs located inside a cog path will be listed here. You can see a
|
||||
list of the paths with the :ref:`paths <cogmanagerui-command-paths>` command.
|
||||
|
||||
.. _cogmanagerui-command-paths:
|
||||
|
||||
^^^^^
|
||||
paths
|
||||
^^^^^
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]paths
|
||||
|
||||
**Description**
|
||||
|
||||
Lists the registered cog paths, with the install path for the downloader and
|
||||
the core path for the core cogs.
|
||||
|
||||
.. TODO add ref to downloader
|
||||
|
||||
You can use the :ref:`reorderpath <cogmanagerui-command-reorderpath>` command
|
||||
to reorder the listed paths.
|
||||
|
||||
.. tip:: The number before a cog path can be used for the
|
||||
:ref:`removepath <cogmanagerui-command-removepath>` command.
|
||||
|
||||
.. _cogmanagerui-command-addpath:
|
||||
|
||||
^^^^^^^
|
||||
addpath
|
||||
^^^^^^^
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]addpath <path>
|
||||
|
||||
**Description**
|
||||
|
||||
Adds a path to the list of available cog paths. This means that all valid cogs
|
||||
under the path will be added to the list of available cogs, listed in
|
||||
:ref:`cogs <cogmanagerui-command-cogs>`.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<path>``: A path that should look like this and point to a folder:
|
||||
|
||||
* Windows: ``C:\Users\username\Documents\MyCogs``
|
||||
* macOS: ``/Users/username/Documents/MyCogs``
|
||||
* Linux: ``/home/username/Documents/MyCogs``
|
||||
|
||||
Try to avoid paths with spaces. If there are spaces, add a backslash before
|
||||
the space on Linux. Add quotation marks around the path if needed.
|
||||
|
||||
.. _cogmanagerui-command-removepath:
|
||||
|
||||
^^^^^^^^^^
|
||||
removepath
|
||||
^^^^^^^^^^
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]removepath <path_number>
|
||||
|
||||
**Description**
|
||||
|
||||
Removes a path from the list of available paths. Its cogs won't be accessible
|
||||
anymore.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<path_number>``: The number of the path to remove. You can get it with
|
||||
the :ref:`paths <cogmanagerui>` command.
|
||||
|
||||
.. _cogmanagerui-command-reorderpath:
|
||||
|
||||
^^^^^^^^^^^
|
||||
reorderpath
|
||||
^^^^^^^^^^^
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]reorderpath <from\_> <to>
|
||||
|
||||
**Description**
|
||||
|
||||
Reorders the paths listed with the :ref:`paths <cogmanagerui-command-paths>`
|
||||
command. The goal of this command is to allow the discovery of different cogs.
|
||||
If there are multiple packages with the same names, the one that is inside the
|
||||
highest folder in the list will be kept and the other ones will be ignored.
|
||||
|
||||
For example, let's suppose this is the output of
|
||||
:ref:`paths <cogmanagerui-command-paths>`:
|
||||
|
||||
1. ``/usr/local/lib/python3.7/site-packages/redbot/cogs``
|
||||
2. ``/home/laggron/custom_cogs``
|
||||
3. ``/mnt/not_suspicious_usb_drive/not_suspicious_cogs``
|
||||
|
||||
The folders 2 and 3 both have a package named ``leveler`` while being different
|
||||
cogs, and you want to load the one located in the 3rd folder. To do that, you
|
||||
have to put the 3rd path higher than the 2nd path, let's swap them! Type
|
||||
``[p]reorderpath 2 3`` and the output of
|
||||
:ref:`paths <cogmanagerui-command-paths>` will then be the following:
|
||||
|
||||
1. ``/usr/local/lib/python3.7/site-packages/redbot/cogs``
|
||||
2. ``/mnt/not_suspicious_usb_drive/not_suspicious_cogs``
|
||||
3. ``/home/laggron/custom_cogs``
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``<from_>``: The index of the path you want to move.
|
||||
* ``<to>``: The location where you want to insert the path.
|
||||
|
||||
.. _cogmanagerui-command-installpath:
|
||||
|
||||
^^^^^^^^^^^
|
||||
installpath
|
||||
^^^^^^^^^^^
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]installpath [path]
|
||||
|
||||
**Description**
|
||||
|
||||
Shows the install path, or sets a new one. If you want to set a new path, the
|
||||
same rules as for :ref:`addpath <cogmanagerui-command-addpath>` applies.
|
||||
|
||||
.. warning:: If you edit the install path, the cogs won't be transfered.
|
||||
|
||||
**Arguments**
|
||||
|
||||
* ``[path]``: The absolute path to set. If omitted, the current path will
|
||||
be returned instead.
|
||||
@@ -1,294 +0,0 @@
|
||||
.. _customcommands:
|
||||
|
||||
==============
|
||||
CustomCommands
|
||||
==============
|
||||
|
||||
This is the cog guide for the customcommands cog. You will
|
||||
find detailed docs about usage and commands.
|
||||
|
||||
``[p]`` is considered as your prefix.
|
||||
|
||||
.. note:: To use this cog, load it by typing this::
|
||||
|
||||
[p]load customcom
|
||||
|
||||
.. _customcommands-usage:
|
||||
|
||||
-----
|
||||
Usage
|
||||
-----
|
||||
|
||||
This cog contains commands for creating and managing custom commands that display text.
|
||||
|
||||
These are useful for storing information members might need, like FAQ answers or invite links.
|
||||
Custom commands can be used by anyone by default, so be careful with pings.
|
||||
Commands can only be lowercase, and will not respond to any uppercase letters.
|
||||
|
||||
|
||||
.. _customcommands-commands:
|
||||
|
||||
--------
|
||||
Commands
|
||||
--------
|
||||
|
||||
.. _customcommands-command-customcom:
|
||||
|
||||
^^^^^^^^^
|
||||
customcom
|
||||
^^^^^^^^^
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]customcom
|
||||
|
||||
.. tip:: Alias: ``cc``
|
||||
|
||||
**Description**
|
||||
|
||||
Base command for Custom Commands management.
|
||||
|
||||
.. _customcommands-command-customcom-cooldown:
|
||||
|
||||
""""""""""""""""""
|
||||
customcom cooldown
|
||||
""""""""""""""""""
|
||||
|
||||
.. note:: |mod-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]customcom cooldown <command> [cooldown] [per=member]
|
||||
|
||||
**Description**
|
||||
|
||||
Set, edit, or view the cooldown for a custom command.
|
||||
|
||||
You may set cooldowns per member, channel, or guild. Multiple
|
||||
cooldowns may be set. All cooldowns must be cooled to call the
|
||||
custom command.
|
||||
|
||||
Examples:
|
||||
- ``[p]customcom cooldown pingrole``
|
||||
- ``[p]customcom cooldown yourcommand 30``
|
||||
- ``[p]cc cooldown mycommand 30 guild``
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<command>`` The custom command to check or set the cooldown.
|
||||
- ``<cooldown>`` The number of seconds to wait before allowing the command to be invoked again. If omitted, will instead return the current cooldown settings.
|
||||
- ``<per>`` The group to apply the cooldown on. Defaults to per member. Valid choices are server, guild, user, and member.
|
||||
|
||||
.. _customcommands-command-customcom-create:
|
||||
|
||||
""""""""""""""""
|
||||
customcom create
|
||||
""""""""""""""""
|
||||
|
||||
.. note:: |mod-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]customcom create <command> <text>
|
||||
|
||||
.. tip:: Alias: ``customcom add``
|
||||
|
||||
**Description**
|
||||
|
||||
Create custom commands.
|
||||
|
||||
If a type is not specified, a simple CC will be created.
|
||||
CCs can be enhanced with arguments, see the guide
|
||||
:ref:`here <cog_customcom>`.
|
||||
|
||||
.. _customcommands-command-customcom-create-random:
|
||||
|
||||
"""""""""""""""""""""""
|
||||
customcom create random
|
||||
"""""""""""""""""""""""
|
||||
|
||||
.. note:: |mod-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]customcom create random <command>
|
||||
|
||||
**Description**
|
||||
|
||||
Create a CC where it will randomly choose a response!
|
||||
|
||||
Note: This command is interactive.
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<command>`` The command executed to return the text. Cast to lowercase.
|
||||
|
||||
.. _customcommands-command-customcom-create-simple:
|
||||
|
||||
"""""""""""""""""""""""
|
||||
customcom create simple
|
||||
"""""""""""""""""""""""
|
||||
|
||||
.. note:: |mod-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]customcom create simple <command> <text>
|
||||
|
||||
**Description**
|
||||
|
||||
Add a simple custom command.
|
||||
|
||||
Example:
|
||||
- ``[p]customcom create simple yourcommand Text you want``
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<command>`` The command executed to return the text. Cast to lowercase.
|
||||
- ``<text>`` The text to return when executing the command. See guide for enhanced usage.
|
||||
|
||||
.. _customcommands-command-customcom-delete:
|
||||
|
||||
""""""""""""""""
|
||||
customcom delete
|
||||
""""""""""""""""
|
||||
|
||||
.. note:: |mod-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]customcom delete <command>
|
||||
|
||||
.. tip:: Aliases: ``customcom del``, ``customcom remove``
|
||||
|
||||
**Description**
|
||||
|
||||
Delete a custom command.
|
||||
|
||||
Example:
|
||||
- ``[p]customcom delete yourcommand``
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<command>`` The custom command to delete.
|
||||
|
||||
.. _customcommands-command-customcom-edit:
|
||||
|
||||
""""""""""""""
|
||||
customcom edit
|
||||
""""""""""""""
|
||||
|
||||
.. note:: |mod-lock|
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]customcom edit <command> [text]
|
||||
|
||||
**Description**
|
||||
|
||||
Edit a custom command.
|
||||
|
||||
Example:
|
||||
- ``[p]customcom edit yourcommand Text you want``
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<command>`` The custom command to edit.
|
||||
- ``<text>`` The new text to return when executing the command.
|
||||
|
||||
.. _customcommands-command-customcom-list:
|
||||
|
||||
""""""""""""""
|
||||
customcom list
|
||||
""""""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]customcom list
|
||||
|
||||
**Description**
|
||||
|
||||
List all available custom commands.
|
||||
|
||||
The list displays a preview of each command's response, with
|
||||
markdown escaped and newlines replaced with spaces.
|
||||
|
||||
.. _customcommands-command-customcom-raw:
|
||||
|
||||
"""""""""""""
|
||||
customcom raw
|
||||
"""""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]customcom raw <command>
|
||||
|
||||
**Description**
|
||||
|
||||
Get the raw response of a custom command, to get the proper markdown.
|
||||
|
||||
This is helpful for copy and pasting.
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<command>`` The custom command to get the raw response of.
|
||||
|
||||
.. _customcommands-command-customcom-search:
|
||||
|
||||
""""""""""""""""
|
||||
customcom search
|
||||
""""""""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]customcom search <query>
|
||||
|
||||
**Description**
|
||||
|
||||
Searches through custom commands, according to the query.
|
||||
|
||||
Uses fuzzywuzzy searching to find close matches.
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<query>`` The query to search for. Can be multiple words.
|
||||
|
||||
.. _customcommands-command-customcom-show:
|
||||
|
||||
""""""""""""""
|
||||
customcom show
|
||||
""""""""""""""
|
||||
|
||||
**Syntax**
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]customcom show <command_name>
|
||||
|
||||
**Description**
|
||||
|
||||
Shows a custom command's responses and its settings.
|
||||
|
||||
**Arguments:**
|
||||
|
||||
- ``<command>`` The custom command to show.
|
||||
@@ -1,97 +0,0 @@
|
||||
.. Permissions Cog Reference
|
||||
|
||||
=========================
|
||||
Permissions Cog Reference
|
||||
=========================
|
||||
|
||||
------------
|
||||
How it works
|
||||
------------
|
||||
|
||||
When loaded, the permissions cog will allow you to define extra custom rules for who can use a
|
||||
command.
|
||||
|
||||
If no applicable rules are found, the command will behave normally.
|
||||
|
||||
Rules can also be added to cogs, which will affect all commands from that cog. The cog name can be
|
||||
found from the help menu.
|
||||
|
||||
-------------
|
||||
Rule priority
|
||||
-------------
|
||||
|
||||
Rules set for subcommands will take precedence over rules set for the parent commands, which
|
||||
lastly take precedence over rules set for the cog. So for example, if a user is denied the Core
|
||||
cog, but allowed the ``[p]set token`` command, the user will not be able to use any command in the
|
||||
Core cog except for ``[p]set token``.
|
||||
|
||||
In terms of scope, global rules will be checked first, then server rules.
|
||||
|
||||
For each of those, the first rule pertaining to one of the following models will be used:
|
||||
|
||||
1. User
|
||||
2. Voice channel
|
||||
3. Text channel
|
||||
4. Channel category
|
||||
5. Roles, highest to lowest
|
||||
6. Server (can only be in global rules)
|
||||
7. Default rules
|
||||
|
||||
In private messages, only global rules about a user will be checked.
|
||||
|
||||
-------------------------
|
||||
Setting Rules From a File
|
||||
-------------------------
|
||||
|
||||
The permissions cog can also set, display or update rules with a YAML file with the
|
||||
``[p]permissions yaml`` command. Models must be represented by ID. Rules must be ``true`` for
|
||||
allow, or ``false`` for deny. Here is an example:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
COG:
|
||||
Admin:
|
||||
78631113035100160: true
|
||||
96733288462286848: false
|
||||
Audio:
|
||||
133049272517001216: true
|
||||
default: false
|
||||
COMMAND:
|
||||
cleanup bot:
|
||||
78631113035100160: true
|
||||
default: false
|
||||
ping:
|
||||
96733288462286848: false
|
||||
default: true
|
||||
|
||||
----------------------
|
||||
Example configurations
|
||||
----------------------
|
||||
|
||||
Locking the ``[p]play`` command to approved server(s) as a bot owner:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]permissions setdefaultglobalrule deny play
|
||||
[p]permissions addglobalrule allow play [server ID or name]
|
||||
|
||||
Locking the ``[p]play`` command to specific voice channel(s) as a serverowner or admin:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]permissions setdefaultserverrule deny play
|
||||
[p]permissions setdefaultserverrule deny "playlist start"
|
||||
[p]permissions addserverrule allow play [voice channel ID or name]
|
||||
[p]permissions addserverrule allow "playlist start" [voice channel ID or name]
|
||||
|
||||
Allowing extra roles to use ``[p]cleanup``:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]permissions addserverrule allow cleanup [role ID]
|
||||
|
||||
Preventing ``[p]cleanup`` from being used in channels where message history is important:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]permissions addserverrule deny cleanup [channel ID or mention]
|
||||
@@ -1,236 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Red - Discord Bot documentation build configuration file, created by
|
||||
# sphinx-quickstart on Thu Aug 10 23:18:25 2017.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its
|
||||
# containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, os.path.abspath(".."))
|
||||
|
||||
os.environ["BUILDING_DOCS"] = "1"
|
||||
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#
|
||||
# needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
"sphinx.ext.autodoc",
|
||||
"sphinx.ext.extlinks",
|
||||
"sphinx.ext.intersphinx",
|
||||
"sphinx.ext.viewcode",
|
||||
"sphinx.ext.napoleon",
|
||||
"sphinx.ext.doctest",
|
||||
"sphinxcontrib_trio",
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ["_templates"]
|
||||
|
||||
# The suffix(es) of source filenames.
|
||||
# You can specify multiple suffix as a list of string:
|
||||
#
|
||||
# source_suffix = ['.rst', '.md']
|
||||
source_suffix = ".rst"
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = "index"
|
||||
|
||||
# General information about the project.
|
||||
project = "Red - Discord Bot"
|
||||
copyright = "2018-2020, Cog Creators"
|
||||
author = "Cog Creators"
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
from redbot.core import __version__
|
||||
from discord import __version__ as dpy_version
|
||||
|
||||
# The short X.Y version.
|
||||
version = __version__
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = __version__
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = None
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This patterns also effect to html_static_path and html_extra_path
|
||||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = "sphinx"
|
||||
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = False
|
||||
|
||||
# Role which is assigned when you make a simple reference within backticks
|
||||
default_role = "any"
|
||||
|
||||
# Includes substitutions for all files
|
||||
with open("prolog.txt", "r") as file:
|
||||
rst_prolog = file.read()
|
||||
|
||||
# Adds d.py version to available substitutions in all files
|
||||
rst_prolog += f"\n.. |DPY_VERSION| replace:: {dpy_version}"
|
||||
|
||||
# -- Options for HTML output ----------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
html_theme = "sphinx_rtd_theme"
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#
|
||||
# html_theme_options = {}
|
||||
|
||||
html_context = {
|
||||
# Enable the "Edit in GitHub link within the header of each page.
|
||||
"display_github": True,
|
||||
"github_user": "Cog-Creators",
|
||||
"github_repo": "Red-DiscordBot",
|
||||
"github_version": "V3/develop/docs/",
|
||||
}
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
# html_static_path = ['_static']
|
||||
|
||||
# Custom sidebar templates, must be a dictionary that maps document names
|
||||
# to template names.
|
||||
#
|
||||
# This is required for the alabaster theme
|
||||
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
|
||||
html_sidebars = {
|
||||
"**": [
|
||||
"about.html",
|
||||
"navigation.html",
|
||||
"relations.html", # needs 'show_related': True theme option to display
|
||||
"searchbox.html",
|
||||
"donate.html",
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
# -- Options for HTMLHelp output ------------------------------------------
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = "Red-DiscordBotdoc"
|
||||
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#
|
||||
# 'papersize': 'letterpaper',
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#
|
||||
# 'pointsize': '10pt',
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#
|
||||
# 'preamble': '',
|
||||
# Latex figure (float) alignment
|
||||
#
|
||||
# 'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
(master_doc, "Red-DiscordBot.tex", "Red - Discord Bot Documentation", "Cog Creators", "manual")
|
||||
]
|
||||
|
||||
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [(master_doc, "red-discordbot", "Red - Discord Bot Documentation", [author], 1)]
|
||||
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
(
|
||||
master_doc,
|
||||
"Red-DiscordBot",
|
||||
"Red - Discord Bot Documentation",
|
||||
author,
|
||||
"Red-DiscordBot",
|
||||
"One line description of project.",
|
||||
"Miscellaneous",
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
# -- Options for linkcheck builder ----------------------------------------
|
||||
|
||||
# A list of regular expressions that match URIs that should not be
|
||||
# checked when doing a linkcheck build.
|
||||
linkcheck_ignore = [r"https://java.com*", r"https://chocolatey.org*"]
|
||||
linkcheck_retries = 3
|
||||
|
||||
|
||||
# -- Options for extensions -----------------------------------------------
|
||||
|
||||
# Intersphinx
|
||||
intersphinx_mapping = {
|
||||
"python": ("https://docs.python.org/3", None),
|
||||
"dpy": (f"https://discordpy.readthedocs.io/en/v{dpy_version}/", None),
|
||||
"motor": ("https://motor.readthedocs.io/en/stable/", None),
|
||||
"babel": ("http://babel.pocoo.org/en/stable/", None),
|
||||
}
|
||||
|
||||
# Extlinks
|
||||
# This allows to create links to d.py docs with
|
||||
# :dpy_docs:`link text <site_name.html>`
|
||||
extlinks = {
|
||||
"dpy_docs": (f"https://discordpy.readthedocs.io/en/v{dpy_version}/%s", None),
|
||||
"issue": ("https://github.com/Cog-Creators/Red-DiscordBot/issues/%s", "#"),
|
||||
"ghuser": ("https://github.com/%s", "@"),
|
||||
}
|
||||
|
||||
# Doctest
|
||||
# If this string is non-empty, all blocks with ``>>>`` in them will be
|
||||
# tested, not just the ones explicitly marked with ``.. doctest::``
|
||||
doctest_test_doctest_blocks = ""
|
||||
|
||||
# Autodoc options
|
||||
autodoc_default_options = {"show-inheritance": True}
|
||||
autodoc_typehints = "none"
|
||||
@@ -1,77 +0,0 @@
|
||||
.. V3 Shared API Key Reference
|
||||
|
||||
===============
|
||||
Shared API Keys
|
||||
===============
|
||||
|
||||
Red has a central API key storage utilising the core bots config. This allows cog creators to add a single location to store API keys for their cogs which may be shared between other cogs.
|
||||
|
||||
There needs to be some consistency between cog creators when using shared API keys between cogs. To help make this easier service should be all **lowercase** and the key names should match the naming convention of the API being accessed.
|
||||
|
||||
Example:
|
||||
|
||||
Twitch has a client ID and client secret so a user should be asked to input
|
||||
|
||||
``[p]set api twitch client_id,1234ksdjf client_secret,1234aldlfkd``
|
||||
|
||||
and when accessed in the code it should be done by
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
await self.bot.get_shared_api_tokens("twitch")
|
||||
|
||||
Each service has its own dict of key, value pairs for each required key type. If there's only one key required then a name for the key is still required for storing and accessing.
|
||||
|
||||
Example:
|
||||
|
||||
``[p]set api youtube api_key,1234ksdjf``
|
||||
|
||||
and when accessed in the code it should be done by
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
await self.bot.get_shared_api_tokens("youtube")
|
||||
|
||||
|
||||
***********
|
||||
Basic Usage
|
||||
***********
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class MyCog:
|
||||
@commands.command()
|
||||
async def youtube(self, ctx, user: str):
|
||||
youtube_keys = await self.bot.get_shared_api_tokens("youtube")
|
||||
if youtube_keys.get("api_key") is None:
|
||||
return await ctx.send("The YouTube API key has not been set.")
|
||||
# Use the API key to access content as you normally would
|
||||
|
||||
|
||||
***************
|
||||
Event Reference
|
||||
***************
|
||||
|
||||
.. function:: on_red_api_tokens_update(service_name, api_tokens)
|
||||
|
||||
Dispatched when service's api keys are updated.
|
||||
|
||||
:param service_name: Name of the service.
|
||||
:type service_name: :class:`str`
|
||||
:param api_tokens: New Mapping of token names to tokens. This contains api tokens that weren't changed too.
|
||||
:type api_tokens: Mapping[:class:`str`, :class:`str`]
|
||||
|
||||
|
||||
*********************
|
||||
Additional References
|
||||
*********************
|
||||
|
||||
.. py:currentmodule:: redbot.core.bot
|
||||
|
||||
.. automethod:: Red.get_shared_api_tokens
|
||||
|
||||
.. automethod:: Red.set_shared_api_tokens
|
||||
|
||||
.. automethod:: Red.remove_shared_api_tokens
|
||||
|
||||
.. automethod:: Red.remove_shared_api_services
|
||||
@@ -1,47 +0,0 @@
|
||||
.. V3 Bank
|
||||
|
||||
.. role:: python(code)
|
||||
:language: python
|
||||
|
||||
====
|
||||
Bank
|
||||
====
|
||||
|
||||
Bank has now been separated from Economy for V3. New to bank is support for
|
||||
having a global bank.
|
||||
|
||||
***********
|
||||
Basic Usage
|
||||
***********
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from redbot.core import bank, commands
|
||||
import discord
|
||||
|
||||
class MyCog(commands.Cog):
|
||||
@commands.command()
|
||||
async def balance(self, ctx, user: discord.Member = None):
|
||||
if user is None:
|
||||
user = ctx.author
|
||||
bal = await bank.get_balance(user)
|
||||
currency = await bank.get_currency_name(ctx.guild)
|
||||
await ctx.send(
|
||||
"{}'s balance is {} {}".format(
|
||||
user.display_name, bal, currency
|
||||
)
|
||||
)
|
||||
|
||||
*************
|
||||
API Reference
|
||||
*************
|
||||
|
||||
Bank
|
||||
======
|
||||
|
||||
.. automodule:: redbot.core.bank
|
||||
:members:
|
||||
:exclude-members: cost
|
||||
|
||||
.. autofunction:: cost
|
||||
:decorator:
|
||||
@@ -1,23 +0,0 @@
|
||||
.. bot module docs
|
||||
|
||||
===
|
||||
Bot
|
||||
===
|
||||
|
||||
.. automodule:: redbot.core.bot
|
||||
|
||||
RedBase
|
||||
^^^^^^^
|
||||
|
||||
.. autoclass:: RedBase
|
||||
:members:
|
||||
:exclude-members: get_context
|
||||
|
||||
.. automethod:: register_rpc_handler
|
||||
.. automethod:: unregister_rpc_handler
|
||||
|
||||
Red
|
||||
^^^
|
||||
|
||||
.. autoclass:: Red
|
||||
:members:
|
||||
@@ -1,11 +0,0 @@
|
||||
.. _checks:
|
||||
|
||||
========================
|
||||
Command Check Decorators
|
||||
========================
|
||||
|
||||
The following are all decorators for commands, which add restrictions to where and when they can be
|
||||
run.
|
||||
|
||||
.. automodule:: redbot.core.commands
|
||||
:members: permissions_check, bot_has_permissions, bot_in_a_guild, has_permissions, has_guild_permissions, is_owner, guildowner, guildowner_or_permissions, admin, admin_or_permissions, mod, mod_or_permissions
|
||||
@@ -1,8 +0,0 @@
|
||||
.. cog manager docs
|
||||
|
||||
===========
|
||||
Cog Manager
|
||||
===========
|
||||
|
||||
.. automodule:: redbot.core.cog_manager
|
||||
:members:
|
||||
@@ -1,63 +0,0 @@
|
||||
.. red commands module documentation
|
||||
|
||||
================
|
||||
Commands Package
|
||||
================
|
||||
|
||||
This package acts almost identically to :doc:`discord.ext.commands <dpy:ext/commands/api>`; i.e.
|
||||
all of the attributes from discord.py's are also in ours.
|
||||
Some of these attributes, however, have been slightly modified, while others have been added to
|
||||
extend functionalities used throughout the bot, as outlined below.
|
||||
|
||||
.. autofunction:: redbot.core.commands.command
|
||||
|
||||
.. autofunction:: redbot.core.commands.group
|
||||
|
||||
.. autoclass:: redbot.core.commands.Cog
|
||||
|
||||
.. automethod:: format_help_for_context
|
||||
|
||||
.. automethod:: red_get_data_for_user
|
||||
|
||||
.. automethod:: red_delete_data_for_user
|
||||
|
||||
.. autoclass:: redbot.core.commands.Command
|
||||
:members:
|
||||
:inherited-members: format_help_for_context
|
||||
|
||||
.. autoclass:: redbot.core.commands.Group
|
||||
:members:
|
||||
|
||||
.. autoclass:: redbot.core.commands.Context
|
||||
:members:
|
||||
|
||||
.. autoclass:: redbot.core.commands.GuildContext
|
||||
|
||||
.. autoclass:: redbot.core.commands.DMContext
|
||||
|
||||
.. automodule:: redbot.core.commands.requires
|
||||
:members: PrivilegeLevel, PermState, Requires
|
||||
|
||||
.. automodule:: redbot.core.commands.converter
|
||||
:members:
|
||||
:exclude-members: UserInputOptional, convert
|
||||
:no-undoc-members:
|
||||
|
||||
.. autodata:: UserInputOptional
|
||||
:annotation:
|
||||
|
||||
.. _framework-commands-help:
|
||||
|
||||
******************
|
||||
Help Functionality
|
||||
******************
|
||||
|
||||
.. warning::
|
||||
|
||||
The content in this section is provisional and may change
|
||||
without prior notice or warning. Updates to this will be communicated
|
||||
on `this issue <https://github.com/Cog-Creators/Red-DiscordBot/issues/4084>`_
|
||||
|
||||
|
||||
.. automodule:: redbot.core.commands.help
|
||||
:members:
|
||||
@@ -1,569 +0,0 @@
|
||||
.. config shite
|
||||
|
||||
.. role:: python(code)
|
||||
:language: python
|
||||
|
||||
======
|
||||
Config
|
||||
======
|
||||
|
||||
Config was introduced in V3 as a way to make data storage easier and safer for all developers regardless of skill level.
|
||||
It will take some getting used to as the syntax is entirely different from what Red has used before, but we believe
|
||||
Config will be extremely beneficial to both cog developers and end users in the long run.
|
||||
|
||||
.. note:: While config is great for storing data safely, there are some caveats to writing performant code which uses it.
|
||||
Make sure to read the section on best practices for more of these details.
|
||||
|
||||
***********
|
||||
Basic Usage
|
||||
***********
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from redbot.core import Config
|
||||
from redbot.core import commands
|
||||
|
||||
class MyCog(commands.Cog):
|
||||
def __init__(self):
|
||||
self.config = Config.get_conf(self, identifier=1234567890)
|
||||
|
||||
self.config.register_global(
|
||||
foo=True
|
||||
)
|
||||
|
||||
@commands.command()
|
||||
async def return_some_data(self, ctx):
|
||||
await ctx.send(await self.config.foo())
|
||||
|
||||
********
|
||||
Tutorial
|
||||
********
|
||||
|
||||
.. py:currentmodule:: redbot.core.config
|
||||
|
||||
This tutorial will walk you through how to use Config.
|
||||
|
||||
First, you need to import Config:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from redbot.core import Config
|
||||
|
||||
Then, in the class's :code:`__init__` function, you need to get a config instance:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class MyCog(commands.Cog):
|
||||
def __init__(self):
|
||||
self.config = Config.get_conf(self, identifier=1234567890)
|
||||
|
||||
The ``identifier`` in :py:meth:`Config.get_conf` is used to keep your cog's data separate
|
||||
from that of another cog, and thus should be unique to your cog. For example: if we
|
||||
have two cogs named :code:`MyCog` and their identifier is different, each will have
|
||||
its own data without overwriting the other's data. Note that it is also possible
|
||||
to force registration of a data key before allowing you to get and set data for
|
||||
that key by adding :code:`force_registration=True` after identifier (that defaults
|
||||
to :code:`False` though)
|
||||
|
||||
After we've gotten that, we need to register default values:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class MyCog(commands.Cog):
|
||||
def __init__(self):
|
||||
self.config = Config.get_conf(self, identifier=1234567890)
|
||||
default_global = {
|
||||
"foobar": True,
|
||||
"foo": {
|
||||
"bar": True,
|
||||
"baz": False
|
||||
}
|
||||
}
|
||||
default_guild = {
|
||||
"blah": [],
|
||||
"baz": 1234567890
|
||||
}
|
||||
self.config.register_global(**default_global)
|
||||
self.config.register_guild(**default_guild)
|
||||
|
||||
As seen in the example above, we can set up our defaults in dicts and then use those in
|
||||
the appropriate :code:`register` function. As seen above, there's :py:meth:`Config.register_global`
|
||||
and :py:meth:`Config.register_guild`, but there's also :py:meth:`Config.register_member`,
|
||||
:py:meth:`Config.register_role`, :py:meth:`Config.register_user`, and :py:meth:`Config.register_channel`.
|
||||
Note that :code:`member` stores based on guild id AND the user's id.
|
||||
|
||||
Once we have our defaults registered and we have the object, we can now use those values
|
||||
in various ways:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@commands.command()
|
||||
@checks.admin_or_permissions(manage_guild=True)
|
||||
async def setbaz(self, ctx, new_value):
|
||||
await self.config.guild(ctx.guild).baz.set(new_value)
|
||||
await ctx.send("Value of baz has been changed!")
|
||||
|
||||
@commands.command()
|
||||
@checks.is_owner()
|
||||
async def setfoobar(self, ctx, new_value):
|
||||
await self.config.foobar.set(new_value)
|
||||
|
||||
@commands.command()
|
||||
async def checkbaz(self, ctx):
|
||||
baz_val = await self.config.guild(ctx.guild).baz()
|
||||
await ctx.send("The value of baz is {}".format("True" if baz_val else "False"))
|
||||
|
||||
Notice a few things in the above examples:
|
||||
|
||||
1. Global doesn't have anything in between :code:`self.config` and the variable.
|
||||
|
||||
2. Both the getters and setters need to be awaited because they're coroutines.
|
||||
|
||||
3. If you're getting the value, the syntax is::
|
||||
|
||||
self.config.<insert scope here, or nothing if global>.variable_name()
|
||||
|
||||
4. If setting, it's::
|
||||
|
||||
self.config.<insert scope here, or nothing if global>.variable_name.set(new_value)
|
||||
|
||||
It is also possible to use :code:`async with` syntax to get and set config
|
||||
values. When entering the statement, the config value is retreived, and on exit,
|
||||
it is saved. This puts a safeguard on any code within the :code:`async with`
|
||||
block such that if it breaks from the block in any way (whether it be from
|
||||
:code:`return`, :code:`break`, :code:`continue` or an exception), the value will
|
||||
still be saved.
|
||||
|
||||
.. important::
|
||||
|
||||
Only mutable config values can be used in the :code:`async with` statement
|
||||
(namely lists or dicts), and they must be modified *in place* for their
|
||||
changes to be saved.
|
||||
|
||||
Here is an example of the :code:`async with` syntax:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@commands.command()
|
||||
async def addblah(self, ctx, new_blah):
|
||||
guild_group = self.config.guild(ctx.guild)
|
||||
async with guild_group.blah() as blah:
|
||||
blah.append(new_blah)
|
||||
await ctx.send("The new blah value has been added!")
|
||||
|
||||
|
||||
.. important::
|
||||
|
||||
Please note that while you have nothing between ``config`` and the variable name for global
|
||||
data, you also have the following commands to get data specific to each category.
|
||||
|
||||
* :py:meth:`Config.guild` for guild data which takes an object of type :py:class:`discord.Guild`.
|
||||
* :py:meth:`Config.member` which takes :py:class:`discord.Member`.
|
||||
* :py:meth:`Config.user` which takes :py:class:`discord.User`.
|
||||
* :py:meth:`Config.role` which takes :py:class:`discord.Role`.
|
||||
* :py:meth:`Config.channel` which takes :py:class:`discord.TextChannel`.
|
||||
|
||||
If you need to wipe data from the config, you want to look at :py:meth:`Group.clear`, or :py:meth:`Config.clear_all`
|
||||
and similar methods, such as :py:meth:`Config.clear_all_guilds`.
|
||||
|
||||
Which one you should use depends on what you want to do.
|
||||
|
||||
If you're looking to clear data for a single guild/member/channel/role/user,
|
||||
you want to use :py:meth:`Group.clear` as that will clear the data only for the
|
||||
specified thing.
|
||||
|
||||
If using :py:meth:`Config.clear_all`, it will reset all data everywhere.
|
||||
|
||||
There are other methods provided to reset data from a particular scope. For
|
||||
example, :py:meth:`Config.clear_all_guilds` resets all guild data. For member
|
||||
data, you can clear on both a per-guild and guild-independent basis, see
|
||||
:py:meth:`Config.clear_all_members` for more info.
|
||||
|
||||
**************
|
||||
Advanced Usage
|
||||
**************
|
||||
|
||||
Config makes it extremely easy to organize data that can easily fit into one of the standard categories (global,
|
||||
guild, user etc.) but there may come a time when your data does not work with the existing categories. There are now
|
||||
features within Config to enable developers to work with data how they wish.
|
||||
|
||||
This usage guide will cover the following features:
|
||||
|
||||
- :py:meth:`Config.init_custom`
|
||||
- :py:meth:`Config.register_custom`
|
||||
- :py:meth:`Config.custom`
|
||||
- :py:meth:`Group.get_raw`
|
||||
- :py:meth:`Group.set_raw`
|
||||
- :py:meth:`Group.clear_raw`
|
||||
|
||||
|
||||
Custom Groups
|
||||
^^^^^^^^^^^^^
|
||||
While Config has built-in groups for the common discord objects,
|
||||
sometimes you need a combination of these or your own defined grouping.
|
||||
Config handles this by allowing you to define custom groups.
|
||||
|
||||
Let's start by showing how :py:meth:`Config.custom` can be equivalent to :py:meth:`Config.guild` by modifying the above
|
||||
Tutorial example.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from redbot.core import Config, commands
|
||||
|
||||
|
||||
class MyCog(commands.Cog):
|
||||
def __init__(self):
|
||||
self.config = Config.get_conf(self, identifier=1234567890)
|
||||
default_guild = {
|
||||
"blah": [],
|
||||
"baz": 1234567890
|
||||
}
|
||||
|
||||
# self.config.register_guild(**default_guild)
|
||||
|
||||
self.config.init_custom("CustomGuildGroup", 1)
|
||||
self.config.register_custom("CustomGuildGroup", **default_guild)
|
||||
|
||||
In the above, we registered the custom group named "CustomGuildGroup" to contain the same defaults
|
||||
that :code:`self.config.guild` normally would. First, we initialized the group "CustomGuildGroup" to
|
||||
accept one identifier by calling :py:meth:`Config.init_custom` with the argument :code:`1`. Then we used
|
||||
:py:meth:`Config.register_custom` to register the default values.
|
||||
|
||||
.. important::
|
||||
|
||||
:py:meth:`Config.init_custom` **must** be called prior to using a custom group.
|
||||
|
||||
|
||||
Now let's use this custom group:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@commands.command()
|
||||
async def setbaz(self, ctx, new_value):
|
||||
# await self.config.guild(ctx.guild).baz.set(new_value)
|
||||
|
||||
await self.config.custom("CustomGuildGroup", ctx.guild.id).baz.set(new_value)
|
||||
await ctx.send("Value of baz has been changed!")
|
||||
|
||||
@commands.command()
|
||||
async def checkbaz(self, ctx):
|
||||
# baz_val = await self.config.guild(ctx.guild).baz()
|
||||
|
||||
baz_val = await self.config.custom("CustomGuildGroup", ctx.guild.id).baz()
|
||||
await ctx.send("The value of baz is {}".format("True" if baz_val else "False"))
|
||||
|
||||
Here we used :py:meth:`Config.custom` to access our custom group much like we would have used :py:meth:`Config.guild`.
|
||||
Since it's a custom group, we need to use :code:`id` attribute of guild to get a unique identifier.
|
||||
|
||||
Now let's see an example that uses multiple identifiers:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from redbot.core import Config, commands, checks
|
||||
|
||||
|
||||
class ChannelAccesss(commands.Cog):
|
||||
def __init__(self):
|
||||
self.config = Config.get_conf(self, identifier=1234567890)
|
||||
default_access = {
|
||||
"allowed": False
|
||||
}
|
||||
|
||||
self.config.init_custom("ChannelAccess", 2)
|
||||
self.config.register_custom("ChannelAccess", **default_access)
|
||||
|
||||
@commands.command()
|
||||
@checks.is_owner()
|
||||
async def grantaccess(self, ctx, channel: discord.TextChannel, member: discord.Member):
|
||||
await self.config.custom("ChannelAccess", channel.id, member.id).allowed.set(True)
|
||||
await ctx.send("Member has been granted access to that channel")
|
||||
|
||||
@commands.command()
|
||||
async def checkaccess(self, ctx, channel: discord.TextChannel):
|
||||
allowed = await self.config.custom("ChannelAccess", channel.id, ctx.author.id).allowed()
|
||||
await ctx.send("Your access to this channel is {}".format("Allowed" if allowed else "Denied"))
|
||||
|
||||
In the above example, we defined the custom group "ChannelAccess" to accept two identifiers
|
||||
using :py:meth:`Config.init_custom`. Then, we were able to set the default value for any member's
|
||||
access to any channel to `False` until the bot owner grants them access.
|
||||
|
||||
.. important::
|
||||
|
||||
The ordering of the identifiers matter. :code:`custom("ChannelAccess", channel.id, member.id)` is NOT the same
|
||||
as :code:`custom("ChannelAccess", member.id, channel.id)`
|
||||
|
||||
Raw Group Access
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
For this example let's suppose that we're creating a cog that allows users to buy and own multiple pets using
|
||||
the built-in Economy credits::
|
||||
|
||||
from redbot.core import bank
|
||||
from redbot.core import Config, commands
|
||||
|
||||
|
||||
class Pets(commands.Cog):
|
||||
def __init__(self):
|
||||
self.config = Config.get_conf(self, 1234567890)
|
||||
|
||||
# Here we'll assign some default costs for the pets
|
||||
self.config.register_global(
|
||||
dog=100,
|
||||
cat=100,
|
||||
bird=50
|
||||
)
|
||||
self.config.register_user(
|
||||
pets={}
|
||||
)
|
||||
|
||||
And now that the cog is set up we'll need to create some commands that allow users to purchase these pets::
|
||||
|
||||
# continued
|
||||
@commands.command()
|
||||
async def get_pet(self, ctx, pet_type: str, pet_name: str):
|
||||
"""
|
||||
Purchase a pet.
|
||||
|
||||
Pet type must be one of: dog, cat, bird
|
||||
"""
|
||||
# Now we need to determine what the cost of the pet is and
|
||||
# if the user has enough credits to purchase it.
|
||||
|
||||
# We will need to use "get_raw"
|
||||
try:
|
||||
cost = await self.config.get_raw(pet_type)
|
||||
except KeyError:
|
||||
# KeyError is thrown whenever the data you try to access does not
|
||||
# exist in the registered defaults or in the saved data.
|
||||
await ctx.send("Bad pet type, try again.")
|
||||
return
|
||||
|
||||
After we've determined the cost of the pet we need to check if the user has enough credits and then we'll need to
|
||||
assign a new pet to the user. This is very easily done using the V3 bank API and :py:meth:`Group.set_raw`::
|
||||
|
||||
# continued
|
||||
if await bank.can_spend(ctx.author, cost):
|
||||
await self.config.user(ctx.author).pets.set_raw(
|
||||
pet_name, value={'cost': cost, 'hunger': 0}
|
||||
)
|
||||
|
||||
# this is equivalent to doing the following
|
||||
|
||||
pets = await self.config.user(ctx.author).pets()
|
||||
pets[pet_name] = {'cost': cost, 'hunger': 0}
|
||||
await self.config.user(ctx.author).pets.set(pets)
|
||||
|
||||
Since the pets can get hungry we're gonna need a command that let's pet owners check how hungry their pets are::
|
||||
|
||||
# continued
|
||||
@commands.command()
|
||||
async def hunger(self, ctx, pet_name: str):
|
||||
try:
|
||||
hunger = await self.config.user(ctx.author).pets.get_raw(pet_name, 'hunger')
|
||||
except KeyError:
|
||||
# Remember, this is thrown if something in the provided identifiers
|
||||
# is not found in the saved data or the defaults.
|
||||
await ctx.send("You don't own that pet!")
|
||||
return
|
||||
|
||||
await ctx.send("Your pet has {}/100 hunger".format(hunger))
|
||||
|
||||
We're responsible pet owners here, so we've also got to have a way to feed our pets::
|
||||
|
||||
# continued
|
||||
@commands.command()
|
||||
async def feed(self, ctx, pet_name: str, food: int):
|
||||
# This is a bit more complicated because we need to check if the pet is
|
||||
# owned first.
|
||||
try:
|
||||
pet = await self.config.user(ctx.author).pets.get_raw(pet_name)
|
||||
except KeyError:
|
||||
# If the given pet name doesn't exist in our data
|
||||
await ctx.send("You don't own that pet!")
|
||||
return
|
||||
|
||||
hunger = pet.get("hunger")
|
||||
|
||||
# Determine the new hunger and make sure it doesn't go negative
|
||||
new_hunger = max(hunger - food, 0)
|
||||
|
||||
await self.config.user(ctx.author).pets.set_raw(
|
||||
pet_name, 'hunger', value=new_hunger
|
||||
)
|
||||
|
||||
# We could accomplish the same thing a slightly different way
|
||||
await self.config.user(ctx.author).pets.get_attr(pet_name).hunger.set(new_hunger)
|
||||
|
||||
await ctx.send("Your pet is now at {}/100 hunger!".format(new_hunger)
|
||||
|
||||
Of course, if we're less than responsible pet owners, there are consequences::
|
||||
|
||||
#continued
|
||||
@commands.command()
|
||||
async def adopt(self, ctx, pet_name: str, *, member: discord.Member):
|
||||
try:
|
||||
pet = await self.config.user(member).pets.get_raw(pet_name)
|
||||
except KeyError:
|
||||
await ctx.send("That person doesn't own that pet!")
|
||||
return
|
||||
|
||||
hunger = pet.get("hunger")
|
||||
if hunger < 80:
|
||||
await ctx.send("That pet is too well taken care of to be adopted.")
|
||||
return
|
||||
|
||||
await self.config.user(member).pets.clear_raw(pet_name)
|
||||
|
||||
# this is equivalent to doing the following
|
||||
|
||||
pets = await self.config.user(member).pets()
|
||||
del pets[pet_name]
|
||||
await self.config.user(member).pets.set(pets)
|
||||
|
||||
await self.config.user(ctx.author).pets.set_raw(pet_name, value=pet)
|
||||
await ctx.send(
|
||||
"Your request to adopt this pet has been granted due to "
|
||||
"how poorly it was taken care of."
|
||||
)
|
||||
|
||||
|
||||
*************
|
||||
V2 Data Usage
|
||||
*************
|
||||
There has been much conversation on how to bring V2 data into V3 and, officially, we recommend that cog developers
|
||||
make use of the public interface in Config (using the categories as described in these docs) rather than simply
|
||||
copying and pasting your V2 data into V3. Using Config as recommended will result in a much better experience for
|
||||
you in the long run and will simplify cog creation and maintenance.
|
||||
|
||||
However.
|
||||
|
||||
We realize that many of our cog creators have expressed disinterest in writing converters for V2 to V3 style data.
|
||||
As a result we have opened up config to take standard V2 data and allow cog developers to manipulate it in V3 in
|
||||
much the same way they would in V2. The following examples will demonstrate how to accomplish this.
|
||||
|
||||
.. warning::
|
||||
|
||||
By following this method to use V2 data in V3 you may be at risk of data corruption if your cog is used on a bot
|
||||
with multiple shards. USE AT YOUR OWN RISK.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from redbot.core import Config, commands
|
||||
|
||||
|
||||
class ExampleCog(commands.Cog):
|
||||
def __init__(self):
|
||||
self.config = Config.get_conf(self, 1234567890)
|
||||
self.config.init_custom("V2", 1)
|
||||
self.data = {}
|
||||
|
||||
async def load_data(self):
|
||||
self.data = await self.config.custom("V2", "V2").all()
|
||||
|
||||
async def save_data(self):
|
||||
await self.config.custom("V2", "V2").set(self.data)
|
||||
|
||||
|
||||
async def setup(bot):
|
||||
cog = ExampleCog()
|
||||
await cog.load_data()
|
||||
bot.add_cog(cog)
|
||||
|
||||
************************************
|
||||
Best practices and performance notes
|
||||
************************************
|
||||
|
||||
Config prioritizes being a safe data store without developers needing to
|
||||
know how end users have configured their bot.
|
||||
|
||||
This does come with some performance costs, so keep the following in mind when choosing to
|
||||
develop using config
|
||||
|
||||
* Config use in events should be kept minimal and should only occur
|
||||
after confirming the event needs to interact with config
|
||||
|
||||
* Caching frequently used things, especially things used by events,
|
||||
results in faster and less event loop blocking code.
|
||||
|
||||
* Only use config's context managers when you intend to modify data.
|
||||
|
||||
* While config is a great general use option, it may not always be the right one for you.
|
||||
As a cog developer, even though config doesn't require one,
|
||||
you can choose to require a database or store to something such as an sqlite
|
||||
database stored within your cog's datapath.
|
||||
|
||||
|
||||
*************
|
||||
API Reference
|
||||
*************
|
||||
|
||||
.. important::
|
||||
|
||||
Before we begin with the nitty gritty API Reference, you should know that there are tons of working code examples
|
||||
inside the bot itself! Simply take a peek inside of the :code:`tests/core/test_config.py` file for examples of using
|
||||
Config in all kinds of ways.
|
||||
|
||||
.. important::
|
||||
|
||||
When getting, setting or clearing values in Config, all keys are casted to `str` for you. This
|
||||
includes keys within a `dict` when one is being set, as well as keys in nested dictionaries
|
||||
within that `dict`. For example::
|
||||
|
||||
>>> config = Config.get_conf(self, identifier=999)
|
||||
>>> config.register_global(foo={})
|
||||
>>> await config.foo.set_raw(123, value=True)
|
||||
>>> await config.foo()
|
||||
{'123': True}
|
||||
>>> await config.foo.set({123: True, 456: {789: False}}
|
||||
>>> await config.foo()
|
||||
{'123': True, '456': {'789': False}}
|
||||
|
||||
.. automodule:: redbot.core.config
|
||||
|
||||
Config
|
||||
^^^^^^
|
||||
|
||||
.. autoclass:: Config
|
||||
:members:
|
||||
|
||||
Group
|
||||
^^^^^
|
||||
|
||||
.. autoclass:: Group
|
||||
:members:
|
||||
:special-members:
|
||||
|
||||
Value
|
||||
^^^^^
|
||||
|
||||
.. autoclass:: Value
|
||||
:members:
|
||||
:special-members: __call__
|
||||
|
||||
|
||||
****************
|
||||
Driver Reference
|
||||
****************
|
||||
|
||||
.. autofunction:: redbot.core.drivers.get_driver
|
||||
|
||||
.. autoclass:: redbot.core.drivers.BackendType
|
||||
:members:
|
||||
|
||||
.. autoclass:: redbot.core.drivers.ConfigCategory
|
||||
:members:
|
||||
|
||||
Base Driver
|
||||
^^^^^^^^^^^
|
||||
.. autoclass:: redbot.core.drivers.BaseDriver
|
||||
:members:
|
||||
|
||||
JSON Driver
|
||||
^^^^^^^^^^^
|
||||
.. autoclass:: redbot.core.drivers.JsonDriver
|
||||
:members:
|
||||
|
||||
Postgres Driver
|
||||
^^^^^^^^^^^^^^^
|
||||
.. autoclass:: redbot.core.drivers.PostgresDriver
|
||||
:members:
|
||||
@@ -1,11 +0,0 @@
|
||||
.. data manager docs
|
||||
|
||||
============
|
||||
Data Manager
|
||||
============
|
||||
|
||||
Data manager is a module that handles all the information necessary to bootstrap
|
||||
the bot into a state where more abstract data management systems can take over.
|
||||
|
||||
.. automodule:: redbot.core.data_manager
|
||||
:members:
|
||||
@@ -1,12 +0,0 @@
|
||||
.. framework events list
|
||||
|
||||
=============
|
||||
Custom Events
|
||||
=============
|
||||
|
||||
RPC Server
|
||||
^^^^^^^^^^
|
||||
|
||||
.. py:method:: Red.on_shutdown()
|
||||
|
||||
Dispatched when the bot begins it's shutdown procedures.
|
||||
@@ -1,54 +0,0 @@
|
||||
.. i18n framework reference
|
||||
|
||||
.. role:: python(code)
|
||||
:language: python
|
||||
|
||||
==============================
|
||||
Internationalization Framework
|
||||
==============================
|
||||
|
||||
-----------
|
||||
Basic Usage
|
||||
-----------
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from redbot.core import commands
|
||||
from redbot.core.i18n import Translator, cog_i18n
|
||||
|
||||
_ = Translator("ExampleCog", __file__)
|
||||
|
||||
@cog_i18n(_)
|
||||
class ExampleCog:
|
||||
"""description"""
|
||||
|
||||
@commands.command()
|
||||
async def mycom(self, ctx):
|
||||
"""command description"""
|
||||
await ctx.send(_("This is a test command"))
|
||||
|
||||
--------
|
||||
Tutorial
|
||||
--------
|
||||
|
||||
After making your cog, generate a :code:`messages.pot` file
|
||||
|
||||
We recommend using redgettext - a modified version of pygettext for Red.
|
||||
You can install redgettext by running :code:`pip install redgettext` in a command prompt.
|
||||
|
||||
To generate the :code:`messages.pot` file, you will now need to run
|
||||
:code:`python -m redgettext -c [path_to_cog]`
|
||||
This file will contain all strings to be translated, including
|
||||
docstrings.
|
||||
(For advanced usage check :code:`python -m redgettext -h`)
|
||||
|
||||
You can now use a tool like `poedit
|
||||
<https://poedit.net/>`_ to translate the strings in your messages.pot file.
|
||||
|
||||
-------------
|
||||
API Reference
|
||||
-------------
|
||||
|
||||
.. automodule:: redbot.core.i18n
|
||||
:members:
|
||||
:special-members: __call__
|
||||
@@ -1,105 +0,0 @@
|
||||
.. V3 Mod log
|
||||
|
||||
.. role:: python(code)
|
||||
:language: python
|
||||
|
||||
|
||||
=======
|
||||
Mod log
|
||||
=======
|
||||
|
||||
Mod log has now been separated from Mod for V3.
|
||||
|
||||
***********
|
||||
Basic Usage
|
||||
***********
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from redbot.core import commands, modlog
|
||||
import discord
|
||||
|
||||
class MyCog(commands.Cog):
|
||||
@commands.command()
|
||||
@checks.admin_or_permissions(ban_members=True)
|
||||
async def ban(self, ctx, user: discord.Member, reason: str = None):
|
||||
await ctx.guild.ban(user)
|
||||
case = await modlog.create_case(
|
||||
ctx.bot, ctx.guild, ctx.message.created_at, action_type="ban",
|
||||
user=user, moderator=ctx.author, reason=reason
|
||||
)
|
||||
await ctx.send("Done. It was about time.")
|
||||
|
||||
|
||||
**********************
|
||||
Registering Case types
|
||||
**********************
|
||||
|
||||
To register case types, use an asynchronous ``initialize()`` method and call
|
||||
it from your setup function:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# mycog/mycog.py
|
||||
from redbot.core import modlog, commands
|
||||
import discord
|
||||
|
||||
class MyCog(commands.Cog):
|
||||
|
||||
async def initialize(self):
|
||||
await self.register_casetypes()
|
||||
|
||||
@staticmethod
|
||||
async def register_casetypes():
|
||||
# Registering a single casetype
|
||||
ban_case = {
|
||||
"name": "ban",
|
||||
"default_setting": True,
|
||||
"image": "\N{HAMMER}",
|
||||
"case_str": "Ban",
|
||||
}
|
||||
try:
|
||||
await modlog.register_casetype(**ban_case)
|
||||
except RuntimeError:
|
||||
pass
|
||||
|
||||
# Registering multiple casetypes
|
||||
new_types = [
|
||||
{
|
||||
"name": "hackban",
|
||||
"default_setting": True,
|
||||
"image": "\N{BUST IN SILHOUETTE}\N{HAMMER}",
|
||||
"case_str": "Hackban",
|
||||
},
|
||||
{
|
||||
"name": "kick",
|
||||
"default_setting": True,
|
||||
"image": "\N{WOMANS BOOTS}",
|
||||
"case_str": "Kick",
|
||||
}
|
||||
]
|
||||
await modlog.register_casetypes(new_types)
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# mycog/__init__.py
|
||||
from .mycog import MyCog
|
||||
|
||||
async def setup(bot):
|
||||
cog = MyCog()
|
||||
await cog.initialize()
|
||||
bot.add_cog(cog)
|
||||
|
||||
.. important::
|
||||
Image should be the emoji you want to represent your case type with.
|
||||
|
||||
|
||||
*************
|
||||
API Reference
|
||||
*************
|
||||
|
||||
Mod log
|
||||
=======
|
||||
|
||||
.. automodule:: redbot.core.modlog
|
||||
:members:
|
||||
@@ -1,67 +0,0 @@
|
||||
.. rpc docs
|
||||
|
||||
===
|
||||
RPC
|
||||
===
|
||||
|
||||
.. important::
|
||||
|
||||
RPC support is included in Red on a provisional basis. Backwards incompatible changes (up to and including removal of the RPC) may occur if deemed necessary.
|
||||
|
||||
V3 comes default with an internal RPC server that may be used to remotely control the bot in various ways.
|
||||
Cogs must register functions to be exposed to RPC clients.
|
||||
Each of those functions must only take JSON serializable parameters and must return JSON serializable objects.
|
||||
|
||||
To enable the internal RPC server you must start the bot with the ``--rpc`` flag.
|
||||
|
||||
********
|
||||
Examples
|
||||
********
|
||||
|
||||
.. code-block:: Python
|
||||
|
||||
def setup(bot):
|
||||
c = Cog()
|
||||
bot.add_cog(c)
|
||||
bot.register_rpc_handler(c.rpc_method)
|
||||
|
||||
*******************************
|
||||
Interacting with the RPC Server
|
||||
*******************************
|
||||
|
||||
The RPC server opens a websocket bound to port ``6133`` on ``127.0.0.1``.
|
||||
This is not configurable for security reasons as broad access to this server gives anyone complete control over your bot.
|
||||
To access the server you must find a library that implements websocket based JSONRPC in the language of your choice.
|
||||
|
||||
There are a few built-in RPC methods to note:
|
||||
|
||||
* ``GET_METHODS`` - Returns a list of available RPC methods.
|
||||
* ``GET_METHOD_INFO`` - Will return the docstring for an available RPC method. Useful for finding information about the method's parameters and return values.
|
||||
* ``GET_TOPIC`` - Returns a list of available RPC message topics.
|
||||
* ``GET_SUBSCRIPTIONS`` - Returns a list of RPC subscriptions.
|
||||
* ``SUBSCRIBE`` - Subscribes to an available RPC message topic.
|
||||
* ``UNSUBSCRIBE`` - Unsubscribes from an RPC message topic.
|
||||
|
||||
All RPC methods accept a list of parameters.
|
||||
The built-in methods above expect their parameters to be in list format.
|
||||
|
||||
All cog-based methods expect their parameter list to take one argument, a JSON object, in the following format::
|
||||
|
||||
params = [
|
||||
{
|
||||
"args": [], # A list of positional arguments
|
||||
"kwargs": {}, # A dictionary of keyword arguments
|
||||
}
|
||||
]
|
||||
|
||||
# As an example, here's a call to "get_method_info"
|
||||
rpc_call("GET_METHOD_INFO", ["get_methods",])
|
||||
|
||||
# And here's a call to "core__load"
|
||||
rpc_call("CORE__LOAD", {"args": [["general", "economy", "downloader"],], "kwargs": {}})
|
||||
|
||||
*************
|
||||
API Reference
|
||||
*************
|
||||
|
||||
Please see the :class:`redbot.core.bot.RedBase` class for details on the RPC handler register and unregister methods.
|
||||
@@ -1,75 +0,0 @@
|
||||
.. red's core utils documentation
|
||||
|
||||
=================
|
||||
Utility Functions
|
||||
=================
|
||||
|
||||
General Utility
|
||||
===============
|
||||
|
||||
.. automodule:: redbot.core.utils
|
||||
:members: deduplicate_iterables, bounded_gather, bounded_gather_iter, get_end_user_data_statement, get_end_user_data_statement_or_raise
|
||||
|
||||
.. autoclass:: AsyncIter
|
||||
:members:
|
||||
:special-members: __await__
|
||||
:exclude-members: enumerate, filter
|
||||
|
||||
.. automethod:: enumerate
|
||||
:async-for:
|
||||
|
||||
.. automethod:: filter
|
||||
:async-for:
|
||||
|
||||
|
||||
Chat Formatting
|
||||
===============
|
||||
|
||||
.. automodule:: redbot.core.utils.chat_formatting
|
||||
:members:
|
||||
|
||||
Embed Helpers
|
||||
=============
|
||||
|
||||
.. automodule:: redbot.core.utils.embed
|
||||
:members:
|
||||
:exclude-members: randomize_color
|
||||
|
||||
Reaction Menus
|
||||
==============
|
||||
|
||||
.. automodule:: redbot.core.utils.menus
|
||||
:members:
|
||||
|
||||
Event Predicates
|
||||
================
|
||||
|
||||
MessagePredicate
|
||||
****************
|
||||
|
||||
.. autoclass:: redbot.core.utils.predicates.MessagePredicate
|
||||
:members:
|
||||
|
||||
ReactionPredicate
|
||||
*****************
|
||||
|
||||
.. autoclass:: redbot.core.utils.predicates.ReactionPredicate
|
||||
:members:
|
||||
|
||||
Mod Helpers
|
||||
===========
|
||||
|
||||
.. automodule:: redbot.core.utils.mod
|
||||
:members:
|
||||
|
||||
Tunnel
|
||||
======
|
||||
|
||||
.. automodule:: redbot.core.utils.tunnel
|
||||
:members: Tunnel
|
||||
|
||||
Common Filters
|
||||
==============
|
||||
|
||||
.. automodule:: redbot.core.utils.common_filters
|
||||
:members:
|
||||
@@ -1,350 +0,0 @@
|
||||
.. don't forget to set permissions hyperlink
|
||||
+ commands links + guide links
|
||||
|
||||
.. _getting-started:
|
||||
|
||||
===============
|
||||
Getting started
|
||||
===============
|
||||
|
||||
If you recently installed Red, you should read this.
|
||||
This is a quick start guide for a general usage.
|
||||
|
||||
.. note::
|
||||
|
||||
If you haven't installed Red, please do it by following
|
||||
the :ref:`installation guides <main>`.
|
||||
|
||||
Assuming you correctly installed Red, you should have a
|
||||
window like this:
|
||||
|
||||
.. image:: .resources/red-console.png
|
||||
|
||||
.. _gettings-started-invite:
|
||||
|
||||
-------------------------
|
||||
Invite Red to your server
|
||||
-------------------------
|
||||
|
||||
When started, the console will show you ``Invite URL`` (here at
|
||||
the bottom of the screenshot).
|
||||
Paste the link into your browser and select the server you want
|
||||
to invite the bot in, like any other bot.
|
||||
|
||||
.. note:: You need the ``Manage server`` permission to add bots.
|
||||
|
||||
Complete the captcha, it should tell you ``Authorized!`` and you
|
||||
should see your bot in the members list.
|
||||
|
||||
.. attention::
|
||||
If Discord shows ``Bot requires code grant``, please untick this
|
||||
option in your token settings
|
||||
|
||||
.. image:: .resources/code-grant.png
|
||||
|
||||
.. _getting-started-interact:
|
||||
|
||||
-----------------
|
||||
Interact with Red
|
||||
-----------------
|
||||
|
||||
As a chatbot, you interact with Red via the Discord text channels
|
||||
(not from the command prompt). To send commands to the bot, you will have to
|
||||
use the prefix you set before, followed by the command you want to use. For
|
||||
example, if your prefix is ``!``, you will execute your command like this:
|
||||
``!ping``.
|
||||
|
||||
.. note:: Since the prefix can be anything, it'll be referenced as ``[p]``
|
||||
in documentations.
|
||||
|
||||
.. _getting-started-commands:
|
||||
|
||||
~~~~~~~~~~~~
|
||||
The commands
|
||||
~~~~~~~~~~~~
|
||||
|
||||
The command you're going to use the most is help. That command will
|
||||
show you **all of the available commands** of the bot with a small description.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]help
|
||||
|
||||
.. tip:: The message is generated dynamically and users will only see the
|
||||
commands they can use. You can change what commands users can use with the
|
||||
permissions cog.
|
||||
|
||||
You can also pick a command to get its detailed description and the
|
||||
parameters.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]help command
|
||||
|
||||
.. note::
|
||||
Arguments enclosed in ``< >`` are **required** for the command to work.
|
||||
|
||||
Arguments enclosed in ``[ ]`` are **optional** for the command;
|
||||
you can decide whether to use them or not.
|
||||
|
||||
If your argument includes spaces like ``Hello world!``, most of the time
|
||||
you will need to place it in double quotes like this: ``"Hello world!"``.
|
||||
Sometimes (especially for the last argument) these double quotes are not
|
||||
required.
|
||||
|
||||
Arguments followed by ``=value`` means that, if not specified,
|
||||
the argument will be equal to ``value``.
|
||||
|
||||
For example, the command ``[p]cleanup messages`` in the cleanup cog has
|
||||
the syntax ``cleanup messages <number> [delete_pinned=False]``, which means
|
||||
``delete_pinned`` default will be false, unless you specify it as true.
|
||||
|
||||
You can use help to show the **categories** too, generally called cogs.
|
||||
Just do something like this (notice the capitalization):
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]help YourCategory
|
||||
|
||||
Help also shows **command groups**. They are group of commands.
|
||||
To get the description of a subcommand, type this:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]help commandgroup subcommand
|
||||
|
||||
When using subcommands, you also need to specify the command group.
|
||||
As an example, ``cleanup`` has 6 subcommands. If you want
|
||||
to use one, do it like this: ``[p]cleanup messages 10``
|
||||
|
||||
.. _getting-started-cogs:
|
||||
|
||||
----
|
||||
Cogs
|
||||
----
|
||||
|
||||
Red is built with cogs, a fancy term for plugins. They are
|
||||
modules that add functionality to Red. They contain
|
||||
commands to use.
|
||||
|
||||
Red comes with 19 cogs containing the basic features, such
|
||||
as moderation, utility, music, streams...
|
||||
|
||||
You can see your loaded and unloaded cogs with the ``[p]cogs``
|
||||
command. By default, all cogs will be unloaded.
|
||||
|
||||
You can load or unload a cog by using the load or unload command
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]load cogname
|
||||
[p]unload cogname
|
||||
|
||||
.. tip:: You can load and unload multiple cogs at once:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]load cog1 cog2 ...
|
||||
|
||||
You can enable and disable everything you want, which means you can
|
||||
customize Red how you want!
|
||||
|
||||
.. _getting-started-community-cogs:
|
||||
|
||||
~~~~~~~~~~~~~~
|
||||
Community cogs
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
There's an entire `community <https://discord.gg/red>`_ that contributes
|
||||
to Red. Those contributors make additional cogs for you to use. You can
|
||||
download them using the downloader cog.
|
||||
|
||||
You can start using the downloader cog by loading it: ``[p]load downloader``
|
||||
|
||||
You can find cogs by searching on `<https://index.discord.red>`_. Find whatever you want,
|
||||
there are hundreds of cogs available!
|
||||
|
||||
.. note:: An even better way to discover new cogs and repositories is in the works! Stay tuned!
|
||||
|
||||
Cogs come in repositories. A repository is a container of cogs
|
||||
that you can install. Let's suppose you want to install the ``say``
|
||||
cog from the repository ``Laggrons-Dumb-Cogs``. You'll first need
|
||||
to add the repository.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]repo add Laggrons-Dumb-Cogs https://github.com/retke/Laggrons-Dumb-Cogs
|
||||
|
||||
.. note:: You may need to specify a branch. If so, add its name after the link.
|
||||
|
||||
Then you can install the cog
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
[p]cog install Laggrons-Dumb-Cogs say
|
||||
|
||||
Now the cog is installed, but not loaded. You can load it using the ``[p]load``
|
||||
command we talked about before.
|
||||
|
||||
.. _getting-started-permissions:
|
||||
|
||||
-----------
|
||||
Permissions
|
||||
-----------
|
||||
|
||||
Red works with different levels of permissions. Every cog defines
|
||||
the level of permission needed for a command.
|
||||
|
||||
~~~~~~~~~
|
||||
Bot owner
|
||||
~~~~~~~~~
|
||||
|
||||
The bot owner can access all commands on every guild. They can also use
|
||||
exclusive commands that can interact with the global settings
|
||||
or system files.
|
||||
|
||||
*You* are the owner by default.
|
||||
|
||||
~~~~~~~~~~~~
|
||||
Server owner
|
||||
~~~~~~~~~~~~
|
||||
|
||||
The server owner can access all commands on his guild, except the global
|
||||
ones or those who can interact with system files (available for the
|
||||
bot owner).
|
||||
|
||||
~~~~~~~~~~~~~
|
||||
Administrator
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
The administrator is defined by its roles. You can set multiple admin roles
|
||||
with the ``[p]set addadminrole`` and ``[p]set removeadminrole`` commands.
|
||||
|
||||
For example, in the mod cog, an admin can use the ``[p]modset`` command
|
||||
which defines the cog settings.
|
||||
|
||||
~~~~~~~~~
|
||||
Moderator
|
||||
~~~~~~~~~
|
||||
|
||||
A moderator is a step above the average users. You can set multiple moderator
|
||||
roles with the ``[p]set addmodrole`` and ``[p]set removemodrole`` commands.
|
||||
|
||||
For example, in the mod cog (again), a mod will be able to mute, kick and ban;
|
||||
but he won't be able to modify the cog settings with the ``[p]modset`` command.
|
||||
|
||||
.. tip::
|
||||
If you don't like the default permission settings for some commands or
|
||||
if want to restrict a cog or a command to a channel/member, you can use
|
||||
the permissions cog.
|
||||
|
||||
.. _getting-started-hosting:
|
||||
|
||||
-------
|
||||
Hosting
|
||||
-------
|
||||
|
||||
If you are hosting Red on your personal computer, you will soon notice that
|
||||
if you close the window or if you shut down you computer, Red will be offline.
|
||||
She needs an environment to work and respond.
|
||||
|
||||
You can try to host Red somewhere she will always be online, like on a virtual
|
||||
private server (VPS) or on a personal server (e.g. Raspberry Pi).
|
||||
|
||||
If you want to do it, follow these steps.
|
||||
|
||||
.. warning::
|
||||
Before trying to host Red on a Linux environment, you need to know the
|
||||
basics of the Unix commands, such as navigating the system files or use
|
||||
a terminal text editor.
|
||||
|
||||
You should follow `this guide
|
||||
<https://www.digitalocean.com/community/tutorials/an-introduction-to-linux-basics>`_
|
||||
from DigitalOcean which will introduce you to the Linux basics.
|
||||
|
||||
1. **Find a host**
|
||||
|
||||
You need to find a server to host Red. You can rent a VPS (it can be free)
|
||||
on an online service. Please check :ref:`this list <host-list>` for
|
||||
quality VPS providers.
|
||||
|
||||
You can also buy a Raspberry Pi (~$20), which is a micro-computer that will
|
||||
be able to host Red. The model 3 or above is recommended.
|
||||
|
||||
2. **Install Linux**
|
||||
|
||||
Most of the VPS providers have tools for installing Linux automatically. If
|
||||
you're a beginner, we recommend **Ubuntu 20.04 LTS**.
|
||||
|
||||
For Raspberry Pi users, just install `Raspbian
|
||||
<https://www.raspberrypi.org/downloads/raspbian/>`_ on a micro-SD card.
|
||||
|
||||
2.1. **Log in**
|
||||
|
||||
.. note:: This section is for those who have an online server. If you have
|
||||
a local Linux machine, just open the terminal and skip to the next part.
|
||||
|
||||
As we said before, a VPS is controlled through command line. You will have to
|
||||
connect to your VPS through a protocol called SSH.
|
||||
|
||||
.. image:: .resources/instances-ssh-button.png
|
||||
|
||||
On your host page (here, it is Google Cloud), find the SSH button and click on
|
||||
it. You will be connected to your server with command line. You should see
|
||||
something like this.
|
||||
|
||||
.. image:: .resources/ssh-output.png
|
||||
|
||||
.. note:: Don't forget to type the command ``logout`` to close the SSH properly.
|
||||
|
||||
3. **Install and set up Red**
|
||||
|
||||
Just follow one of the Linux installation guide. We provide guides for the
|
||||
most used distributions. Check the :ref:`home page <main>` and search for
|
||||
your distribution.
|
||||
|
||||
4. **Set up an auto-restart**
|
||||
|
||||
Once you got Red running on your server, it will still shut down if you close
|
||||
the window. You can set up an auto-restarting system that will create a
|
||||
side task and handle fatal errors, so you can just leave your server running
|
||||
and enjoy Red!
|
||||
|
||||
For that, just follow :ref:`this guide <systemd-service-guide>`.
|
||||
|
||||
.. _getting-started-userdocs:
|
||||
|
||||
------------------
|
||||
User documentation
|
||||
------------------
|
||||
|
||||
You will soon start using the Red core cogs. A detailed documentation is
|
||||
available for every core cog, under the :ref:`How to use <main>` section.
|
||||
|
||||
The cog guides are formatted the same. They're divided into 3 sections:
|
||||
|
||||
* **Guide**
|
||||
|
||||
This will introduce you to the cog and explain you how it works.
|
||||
|
||||
* **Commands**
|
||||
|
||||
A list of the available commands, with details and arguments.
|
||||
Each command guide will be formatted like this:
|
||||
|
||||
* **Syntax**
|
||||
|
||||
A line that will show how the command must be invoked, with the arguments.
|
||||
|
||||
.. tip:: If the command show something like ``[lavalinkset|llset]``, that means
|
||||
you can invoke the command with ``lavalinkset`` or with ``llset``, this is
|
||||
called an alias.
|
||||
|
||||
* **Description**
|
||||
|
||||
A detailed description of what the command does, with details about how
|
||||
it must be used.
|
||||
|
||||
* **Arguments**
|
||||
|
||||
A list of all arguments needed (or not) for the command, with more details.
|
||||
@@ -1,265 +0,0 @@
|
||||
.. Making cogs for V3
|
||||
|
||||
.. role:: python(code)
|
||||
:language: python
|
||||
|
||||
========================
|
||||
Creating cogs for Red V3
|
||||
========================
|
||||
|
||||
This guide serves as a tutorial on creating cogs for Red V3.
|
||||
It will cover the basics of setting up a package for your
|
||||
cog and the basics of setting up the file structure. We will
|
||||
also point you towards some further resources that may assist
|
||||
you in the process.
|
||||
|
||||
---------------
|
||||
Getting started
|
||||
---------------
|
||||
|
||||
To start off, be sure that you have installed Python 3.8.
|
||||
Next, you need to decide if you want to develop against the Stable or Develop version of Red.
|
||||
Depending on what your goal is should help determine which version you need.
|
||||
|
||||
.. attention::
|
||||
The Develop version may have changes on it which break compatibility with the Stable version and other cogs.
|
||||
If your goal is to support both versions, make sure you build compatibility layers or use separate branches to keep compatibility until the next Red release
|
||||
|
||||
Open a terminal or command prompt and type one of the following
|
||||
Stable Version: :code:`python3.8 -m pip install -U Red-DiscordBot`
|
||||
|
||||
.. note::
|
||||
|
||||
To install the development version, replace ``Red-DiscordBot`` in the above commands with the
|
||||
link below. **The development version of the bot contains experimental changes. It is not
|
||||
intended for normal users.** We will not support anyone using the development version in any
|
||||
support channels. Using the development version may break third party cogs and not all core
|
||||
commands may work. Downgrading to stable after installing the development version may cause
|
||||
data loss, crashes or worse. Please keep this in mind when using the development version
|
||||
while working on cog creation.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=Red-DiscordBot
|
||||
|
||||
|
||||
(Windows users may need to use :code:`py -3.8` or :code:`python` instead of :code:`python3.8`)
|
||||
|
||||
--------------------
|
||||
Setting up a package
|
||||
--------------------
|
||||
|
||||
To set up a package, we would just need to create a new folder.
|
||||
This should be named whatever you want the cog to be named (for
|
||||
the purposes of this example, we'll call this :code:`mycog`).
|
||||
In this folder, create three files: :code:`__init__.py`,
|
||||
:code:`mycog.py`, and :code:`info.json`. Open the folder in
|
||||
a text editor or IDE (examples include `Sublime Text 3 <https://www.sublimetext.com/>`_,
|
||||
`Visual Studio Code <https://code.visualstudio.com/>`_, `Atom <https://atom.io/>`_, and
|
||||
`PyCharm <http://www.jetbrains.com/pycharm/>`_).
|
||||
|
||||
.. attention::
|
||||
While you can intentionally override Red's cogs/extensions, this may break things.
|
||||
We would prefer if people wanted custom behavior
|
||||
for any core cog/extension, an issue and/or PR is made
|
||||
Overriding Permissions specifically is dangerous.
|
||||
|
||||
Subclassing to make changes to Red's cogs/extensions
|
||||
may not be a safe way to stay up to date either,
|
||||
as changes to cogs and their interactions with red
|
||||
are not guaranteed to not be breaking.
|
||||
|
||||
Any cogs doing this are doing so at their own risk,
|
||||
and should also inform users of associated risks.
|
||||
|
||||
--------------
|
||||
Creating a cog
|
||||
--------------
|
||||
|
||||
With your package opened in a text editor or IDE, open :code:`mycog.py`.
|
||||
In that file, place the following code:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from redbot.core import commands
|
||||
|
||||
class Mycog(commands.Cog):
|
||||
"""My custom cog"""
|
||||
|
||||
@commands.command()
|
||||
async def mycom(self, ctx):
|
||||
"""This does stuff!"""
|
||||
# Your code will go here
|
||||
await ctx.send("I can do stuff!")
|
||||
|
||||
Open :code:`__init__.py`. In that file, place the following:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from .mycog import Mycog
|
||||
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(Mycog())
|
||||
|
||||
Make sure that both files are saved.
|
||||
|
||||
----------------
|
||||
Testing your cog
|
||||
----------------
|
||||
|
||||
To test your cog, you will need a running instance of V3.
|
||||
Assuming you installed V3 as outlined above, run :code:`redbot-setup`
|
||||
and provide the requested information. Once that's done, run Red
|
||||
by doing :code:`redbot <instance name> --dev` to start Red.
|
||||
Complete the initial setup by providing a valid token and setting a
|
||||
prefix. Once the bot has started up, use the link provided in the
|
||||
console to add it to a server (note that you must have the
|
||||
:code:`Manage Server` (or :code:`Administrator`) permission to add bots
|
||||
to a server). Once it's been added to a server, find the full path
|
||||
to the directory where your cog package is located. In Discord, do
|
||||
:code:`[p]addpath <path_to_folder_containing_package>`, then do
|
||||
:code:`[p]load mycog`. Once the cog is loaded, do :code:`[p]mycom`
|
||||
The bot should respond with :code:`I can do stuff!`. If it did, you
|
||||
have successfully created a cog!
|
||||
|
||||
.. note:: **Package/Folder layout**
|
||||
|
||||
You must make sure you structure your local path correctly or
|
||||
you get an error about missing the setup function. As cogs are
|
||||
considered packages, they are each contained within separate folders.
|
||||
The folder you need to add using :code:`[p]addpath` is the parent
|
||||
folder of these package folders. Below is an example
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
- D:\
|
||||
-- red-env
|
||||
-- red-data
|
||||
-- red-cogs
|
||||
---- mycog
|
||||
------ __init__.py
|
||||
------ mycog.py
|
||||
---- coolcog
|
||||
------ __init__.py
|
||||
------ coolcog.py
|
||||
|
||||
You would then use :code:`[p]addpath D:\red-cogs` to add the path
|
||||
and then you can use :code:`[p]load mycog` or :code:`[p]load coolcog`
|
||||
to load them
|
||||
|
||||
You can also take a look at `our cookiecutter <https://github.com/Cog-Creators/cog-cookiecutter>`_, for help creating the right structure.
|
||||
|
||||
-------------------
|
||||
Publishing your cog
|
||||
-------------------
|
||||
|
||||
Go to :doc:`/guide_publish_cogs`
|
||||
|
||||
--------------------
|
||||
Additional resources
|
||||
--------------------
|
||||
|
||||
Be sure to check out the :doc:`/guide_migration` for some resources
|
||||
on developing cogs for V3. This will also cover differences between V2 and V3 for
|
||||
those who developed cogs for V2.
|
||||
|
||||
|
||||
.. _guidelines-for-cog-creators:
|
||||
|
||||
---------------------------
|
||||
Guidelines for Cog Creators
|
||||
---------------------------
|
||||
|
||||
The following are a list of guidelines Cog Creators should strive to follow.
|
||||
Not all of these are strict requirements (some are) but are all generally advisable.
|
||||
|
||||
1. Cogs should follow a few naming conventions for consistency.
|
||||
|
||||
- Cog classes should be TitleCased, using alphabetic characters only.
|
||||
- Commands should be lower case, using alphanumeric characters only.
|
||||
- Cog modules should be lower case, using alphabetic characters only.
|
||||
|
||||
2. Cogs and commands should have docstrings suitable for use in help output.
|
||||
|
||||
- This one is slightly flexible if using other methods of setting help.
|
||||
|
||||
3. Don't prevent normal operation of the bot without the user opting into this.
|
||||
|
||||
- This includes as a side effect by blocking the event loop.
|
||||
|
||||
4. If your cog uses logging:
|
||||
|
||||
- The namespace for logging should be: ``red.your_repo_name.cog_name``.
|
||||
- Print statements are not a substitute for proper logging.
|
||||
|
||||
5. If you use asyncio.create_task, your tasks need to:
|
||||
|
||||
- Be cancelled on cog unload.
|
||||
- Handle errors.
|
||||
|
||||
6. Event listeners should exit early if it is an event you don't need.
|
||||
This makes your events less expensive in terms of CPU time. Examples below:
|
||||
|
||||
- Checking that you are in a guild before interacting with config for an antispam command.
|
||||
- Checking that you aren't reacting to a bot message (``not message.author.bot``) early on.
|
||||
|
||||
7. Use .gitignore (or something else) to keep unwanted files out of your cog repo.
|
||||
8. Put a license on your cog repo.
|
||||
|
||||
- By default, in most jurisdictions, without a license that at least offers the code for use,
|
||||
users cannot legally use your code.
|
||||
|
||||
9. Use botwide features when they apply. Some examples of this:
|
||||
|
||||
- ``ctx.embed_color``
|
||||
- ``bot.is_automod_immune``
|
||||
|
||||
10. Use checks to limit command use when the bot needs special permissions.
|
||||
11. Check against user input before doing things. Common things to check:
|
||||
|
||||
- Resulting output is safe.
|
||||
- Values provided make sense. (eg. no negative numbers for payday)
|
||||
- Don't unsafely use user input for things like database input.
|
||||
|
||||
12. Don't abuse bot internals.
|
||||
|
||||
- If you need access to something, ask us or open an issue.
|
||||
- If you're sure the current usage is safe, document why,
|
||||
but we'd prefer you work with us on ensuring you have access to what you need.
|
||||
|
||||
13. Update your cogs for breakage.
|
||||
|
||||
- We announce this in advance.
|
||||
- If you need help, ask.
|
||||
|
||||
14. Check events against `bot.cog_disabled_in_guild() <RedBase.cog_disabled_in_guild()>`
|
||||
|
||||
- Not all events need to be checked, only those that interact with a guild.
|
||||
- Some discretion may apply, for example,
|
||||
a cog which logs command invocation errors could choose to ignore this
|
||||
but a cog which takes actions based on messages should not.
|
||||
|
||||
15. Respect settings when treating non command messages as commands.
|
||||
|
||||
16. Handle user data responsibly
|
||||
|
||||
- Don't do unexpected things with user data.
|
||||
- Don't expose user data to additional audiences without permission.
|
||||
- Don't collect data your cogs don't need.
|
||||
- Don't store data in unexpected locations.
|
||||
Utilize the cog data path, Config, or if you need something more
|
||||
prompt the owner to provide it.
|
||||
|
||||
17. Utilize the data deletion and statement APIs
|
||||
|
||||
- See `redbot.core.commands.Cog.red_delete_data_for_user`
|
||||
- Make a statement about what data your cogs use with the module level
|
||||
variable ``__red_end_user_data_statement__``.
|
||||
This should be a string containing a user friendly explanation of what data
|
||||
your cog stores and why.
|
||||
|
||||
18. Set contextual locales in events and other background tasks that use i18n APIs
|
||||
|
||||
- See `redbot.core.i18n.set_contextual_locales_from_guild()`
|
||||
- Usage of i18n APIs within commands automatically has proper contextual locales set.
|
||||
@@ -1,56 +0,0 @@
|
||||
.. V3 Migration Guide
|
||||
|
||||
.. role:: python(code)
|
||||
:language: python
|
||||
|
||||
==========================
|
||||
Migrating cogs from Red V2
|
||||
==========================
|
||||
|
||||
First, be sure to read :dpy_docs:`discord.py's migration guide <migrating.html>`
|
||||
as that covers all of the changes to discord.py that will affect the migration process
|
||||
|
||||
----------------
|
||||
Red as a package
|
||||
----------------
|
||||
|
||||
V3 makes Red a package that is installed with :code:`pip`. Please
|
||||
keep this in mind when writing cogs as this affects how imports
|
||||
should be done (for example, to import :code:`pagify` in V2, one
|
||||
would do :code:`from .utils.chat_formatting import pagify`; in
|
||||
V3, this becomes :code:`from redbot.core.utils.chat_formatting import pagify`)
|
||||
|
||||
----------------
|
||||
Cogs as packages
|
||||
----------------
|
||||
|
||||
V3 makes cogs into packages. See :doc:`/guide_cog_creation`
|
||||
for more on how to create packages for V3.
|
||||
|
||||
------
|
||||
Config
|
||||
------
|
||||
|
||||
Config is V3's replacement for :code:`dataIO`. Instead of fiddling with
|
||||
creating config directories and config files as was done in V2, V3's
|
||||
Config handles that whilst allowing for easy storage of settings on a
|
||||
per-server/member/user/role/channel or global basis. Be sure to check
|
||||
out :doc:`/framework_config` for the API docs for Config as well as a
|
||||
tutorial on using Config.
|
||||
|
||||
----
|
||||
Bank
|
||||
----
|
||||
|
||||
Bank in V3 has been split out from Economy. V3 introduces the ability
|
||||
to have a global bank as well as the ability to change the bank name
|
||||
and the name of the currency. Be sure to checkout :doc:`/framework_bank`
|
||||
for more on Bank
|
||||
|
||||
-------
|
||||
Mod Log
|
||||
-------
|
||||
|
||||
V3 introduces Mod Log as an API, thus allowing for cogs to add custom case
|
||||
types that will appear in a server's mod log channel. Be sure to checkout
|
||||
:doc:`/framework_modlog` for more on Mod Log`
|
||||
@@ -1,88 +0,0 @@
|
||||
.. Publishing cogs for V3
|
||||
|
||||
Publishing cogs for Red V3
|
||||
==========================
|
||||
|
||||
Users of Red install 3rd-party cogs using Downloader cog. To make your cog available
|
||||
to install for others, you will have to create a git repository
|
||||
and publish it on git repository hosting (for example `GitHub <https://github.com>`_)
|
||||
|
||||
Repository Template
|
||||
-------------------
|
||||
|
||||
We have standardized what a repository's structure should look like to better assist
|
||||
our Downloader system and provide essential information to the Red portal.
|
||||
|
||||
The main repository should contain at a minimum:
|
||||
|
||||
- :ref:`An info.json file <info-json-format>`
|
||||
- One folder for each cog package in the repository
|
||||
|
||||
- refer to :doc:`/guide_cog_creation` for information on how to create a valid cog package
|
||||
- you should also put :ref:`info.json file <info-json-format>` inside each cog folder
|
||||
|
||||
We also recommend adding a license and README file with general information about the repository.
|
||||
|
||||
For a simple example of what this might look like when finished,
|
||||
take a look at `our example template <https://github.com/Cog-Creators/Applications>`_.
|
||||
|
||||
.. _info-json-format:
|
||||
|
||||
Info.json format
|
||||
----------------
|
||||
|
||||
The optional info.json file may exist inside every package folder in the repo,
|
||||
as well as in the root of the repo. The following sections describe the valid
|
||||
keys within an info file (and maybe how the Downloader cog uses them).
|
||||
|
||||
Keys common to both repo and cog info.json (case sensitive)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- ``author`` (list of strings) - list of names of authors of the cog or repo.
|
||||
|
||||
- ``description`` (string) - A long description of the cog or repo. For cogs, this
|
||||
is displayed when a user executes ``[p]cog info``.
|
||||
|
||||
- ``install_msg`` (string) - The message that gets displayed when a cog
|
||||
is installed or a repo is added
|
||||
|
||||
.. tip:: You can use the ``[p]`` key in your string to use the prefix
|
||||
used for installing.
|
||||
|
||||
- ``short`` (string) - A short description of the cog or repo. For cogs, this info
|
||||
is displayed when a user executes ``[p]cog list``
|
||||
|
||||
Keys specific to the cog info.json (case sensitive)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- ``end_user_data_statement`` (string) - A statement explaining what end user data the cog is storing.
|
||||
This is displayed when a user executes ``[p]cog info``. If the statement has changed since last update, user will be informed during the update.
|
||||
|
||||
- ``min_bot_version`` (string) - Min version number of Red in the format ``MAJOR.MINOR.MICRO``
|
||||
|
||||
- ``max_bot_version`` (string) - Max version number of Red in the format ``MAJOR.MINOR.MICRO``,
|
||||
if ``min_bot_version`` is newer than ``max_bot_version``, ``max_bot_version`` will be ignored
|
||||
|
||||
- ``min_python_version`` (list of integers) - Min version number of Python
|
||||
in the format ``[MAJOR, MINOR, PATCH]``
|
||||
|
||||
- ``hidden`` (bool) - Determines if a cog is visible in the cog list for a repo.
|
||||
|
||||
- ``disabled`` (bool) - Determines if a cog is available for install.
|
||||
|
||||
- ``required_cogs`` (dict mapping a cog name to repo URL) - A dict of required cogs that this cog depends on
|
||||
in the format ``{cog_name : repo_url}``.
|
||||
Downloader will not deal with this functionality but it may be useful for other cogs.
|
||||
|
||||
- ``requirements`` (list of strings) - list of required libraries that are
|
||||
passed to pip on cog install. ``SHARED_LIBRARIES`` do NOT go in this
|
||||
list.
|
||||
|
||||
- ``tags`` (list of strings) - A list of strings that are related to the
|
||||
functionality of the cog. Used to aid in searching.
|
||||
|
||||
- ``type`` (string) - Optional, defaults to ``COG``. Must be either ``COG`` or
|
||||
``SHARED_LIBRARY``. If ``SHARED_LIBRARY`` then ``hidden`` will be ``True``.
|
||||
|
||||
.. warning::
|
||||
Shared libraries are deprecated since version 3.2 and are marked for removal in the future.
|
||||
@@ -1,91 +0,0 @@
|
||||
.. source: https://gist.github.com/Twentysix26/cb4401c6e507782aa6698e9e470243ed
|
||||
|
||||
.. _host-list:
|
||||
|
||||
=============
|
||||
VPS providers
|
||||
=============
|
||||
|
||||
.. note::
|
||||
This doc is written for the :ref:`hosting section <getting-started-hosting>`
|
||||
of the :ref:`getting started <getting-started>` guide. Please take a look
|
||||
if you don't know how to host Red on a VPS.
|
||||
|
||||
This is a list of the recommended VPS providers.
|
||||
|
||||
.. warning::
|
||||
Please be aware that a Linux server is controlled through a command line.
|
||||
If you don't know Unix basics, please take a look at `this guide
|
||||
<https://www.digitalocean.com/community/tutorials/an-introduction-to-linux-basics>`_
|
||||
from DigitalOcean which will introduce you to the Linux basics.
|
||||
|
||||
-------------
|
||||
Linux hosting
|
||||
-------------
|
||||
|
||||
+------------------------------------+------------------------------------------------------+
|
||||
|Link |Description |
|
||||
+====================================+======================================================+
|
||||
|`Scaleway |Incredibly cheap but powerful VPSes, owned by |
|
||||
|<https://www.scaleway.com/>`_ |`<https://online.net/>`_, based in Europe. |
|
||||
+------------------------------------+------------------------------------------------------+
|
||||
|`DigitalOcean |US-based cheap VPSes. The gold standard. Locations |
|
||||
|<https://www.digitalocean.com/>`_ |available world wide. |
|
||||
+------------------------------------+------------------------------------------------------+
|
||||
|`OVH <https://www.ovh.co.uk/>`_ |Cheap VPSes, used by many people. French and Canadian |
|
||||
| |locations available. |
|
||||
+------------------------------------+------------------------------------------------------+
|
||||
|`Time4VPS |Cheap VPSes, seemingly based in Lithuania. |
|
||||
|<https://www.time4vps.eu/>`_ | |
|
||||
+------------------------------------+------------------------------------------------------+
|
||||
|`Linode <https://www.linode.com/>`_ |More cheap VPSes! |
|
||||
+------------------------------------+------------------------------------------------------+
|
||||
|`Vultr <https://www.vultr.com/>`_ |US-based, DigitalOcean-like. |
|
||||
+------------------------------------+------------------------------------------------------+
|
||||
|
||||
------
|
||||
Others
|
||||
------
|
||||
|
||||
+-------------------------------------+-----------------------------------------------------+
|
||||
|Link | |
|
||||
+=====================================+=====================================================+
|
||||
|`AWS <https://aws.amazon.com/>`_ |Amazon Web Services. Free for a year (with certain |
|
||||
| |limits), but very pricey after that. |
|
||||
+-------------------------------------+-----------------------------------------------------+
|
||||
|`Google Cloud |Same as AWS, but it's Google. |
|
||||
|<https://cloud.google.com/compute/>`_| |
|
||||
+-------------------------------------+-----------------------------------------------------+
|
||||
|`Microsoft Azure |Same as AWS, but it's Microsoft. |
|
||||
|<https://azure.microsoft.com>`_ | |
|
||||
+-------------------------------------+-----------------------------------------------------+
|
||||
|`Oracle Cloud |Same as AWS, but it's Oracle. |
|
||||
|<https://oracle.com/cloud/>`_ | |
|
||||
+-------------------------------------+-----------------------------------------------------+
|
||||
|`LowEndBox <http://lowendbox.com/>`_ |A curator for lower specced servers. |
|
||||
+-------------------------------------+-----------------------------------------------------+
|
||||
|
||||
------------
|
||||
Self-hosting
|
||||
------------
|
||||
|
||||
You can always self-host on your own hardware.
|
||||
A Raspberry Pi 3 will be more than sufficient for small to medium sized bots.
|
||||
|
||||
For bigger bots, you can build your own server PC for usage, or buy a rack
|
||||
server. Any modern hardware should work 100% fine.
|
||||
|
||||
------------
|
||||
Free hosting
|
||||
------------
|
||||
|
||||
| `Google Cloud Compute Engine <https://cloud.google.com/free/docs/gcp-free-tier>`_,
|
||||
`Oracle Cloud Compute <https://oracle.com/cloud/free/#always-free>`_ and
|
||||
`AWS EC2 <https://aws.amazon.com/free/>`_ have free tier VPSes suitable for small bots.
|
||||
|
||||
| **Note:** AWS EC2's free tier does not last forever - it's a 12 month trial.
|
||||
| Additionally, new Google Cloud customers get a $300 credit which is valid
|
||||
for 12 months.
|
||||
|
||||
Other than that... no. There is no good free VPS hoster, outside of
|
||||
persuading somebody to host for you, which is incredibly unlikely.
|
||||
@@ -1,87 +0,0 @@
|
||||
.. Red - Discord Bot documentation master file, created by
|
||||
sphinx-quickstart on Thu Aug 10 23:18:25 2017.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
.. _main:
|
||||
|
||||
Welcome to Red - Discord Bot's documentation!
|
||||
=============================================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: Installation Guides:
|
||||
|
||||
install_windows
|
||||
install_linux_mac
|
||||
bot_application_guide
|
||||
update_red
|
||||
about_venv
|
||||
autostart_systemd
|
||||
autostart_pm2
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Cog Reference:
|
||||
|
||||
cog_customcom
|
||||
cog_permissions
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: User guides:
|
||||
|
||||
getting_started
|
||||
cog_guides/admin
|
||||
cog_guides/alias
|
||||
cog_guides/bank
|
||||
cog_guides/cleanup
|
||||
cog_guides/cog_manager_ui
|
||||
cog_guides/customcommands
|
||||
red_core_data_statement
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Red Development Framework Reference:
|
||||
|
||||
guide_migration
|
||||
guide_cog_creation
|
||||
guide_publish_cogs
|
||||
framework_apikeys
|
||||
framework_bank
|
||||
framework_bot
|
||||
framework_checks
|
||||
framework_cogmanager
|
||||
framework_commands
|
||||
framework_config
|
||||
framework_datamanager
|
||||
framework_events
|
||||
framework_i18n
|
||||
framework_modlog
|
||||
framework_rpc
|
||||
framework_utils
|
||||
version_guarantees
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Changelogs:
|
||||
|
||||
changelog_3_4_0
|
||||
changelog_3_3_0
|
||||
release_notes_3_2_0
|
||||
changelog_3_2_0
|
||||
changelog_3_1_0
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Others
|
||||
|
||||
host-list
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
@@ -1,516 +0,0 @@
|
||||
.. _linux-mac-install-guide:
|
||||
|
||||
==============================
|
||||
Installing Red on Linux or Mac
|
||||
==============================
|
||||
|
||||
.. warning::
|
||||
|
||||
For safety reasons, DO NOT install Red with a root user. If you are unsure how to create
|
||||
a new user on Linux, see `this guide by DigitalOcean
|
||||
<https://www.digitalocean.com/community/tutorials/how-to-create-a-sudo-user-on-ubuntu-quickstart>`_.
|
||||
|
||||
-------------------------------
|
||||
Installing the pre-requirements
|
||||
-------------------------------
|
||||
|
||||
Please install the pre-requirements using the commands listed for your operating system.
|
||||
|
||||
The pre-requirements are:
|
||||
- Python 3.8.1 or greater; **Python 3.9 is currently not supported!**
|
||||
- Pip 18.1 or greater
|
||||
- Git 2.11+
|
||||
- Java Runtime Environment 11 (for audio support)
|
||||
|
||||
We also recommend installing some basic compiler tools, in case our dependencies don't provide
|
||||
pre-built "wheels" for your architecture.
|
||||
|
||||
|
||||
*****************
|
||||
Operating systems
|
||||
*****************
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
----
|
||||
|
||||
.. _install-arch:
|
||||
|
||||
~~~~~~~~~~
|
||||
Arch Linux
|
||||
~~~~~~~~~~
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo pacman -Syu python python-pip git jre11-openjdk-headless base-devel
|
||||
|
||||
Continue by `creating-venv-linux`.
|
||||
|
||||
----
|
||||
|
||||
.. _install-centos7:
|
||||
.. _install-rhel7:
|
||||
|
||||
~~~~~~~~~~~~~~~~~
|
||||
CentOS and RHEL 7
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
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
|
||||
sudo yum -y install centos-release-scl
|
||||
sudo yum -y install devtoolset-8-gcc devtoolset-8-gcc-c++
|
||||
echo "source scl_source enable devtoolset-8" >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
|
||||
In order to install Git 2.11 or greater, we recommend adding the IUS repository:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo yum -y install https://repo.ius.io/ius-release-el7.rpm
|
||||
sudo yum -y swap git git224
|
||||
|
||||
Complete the rest of the installation by `installing Python 3.8 with pyenv <install-python-pyenv>`.
|
||||
|
||||
----
|
||||
|
||||
.. _install-centos:
|
||||
.. _install-rhel:
|
||||
|
||||
~~~~~~~~~~~~~~~~~
|
||||
CentOS and RHEL 8
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo yum -y install epel-release
|
||||
sudo yum -y update
|
||||
sudo yum -y groupinstall development
|
||||
sudo yum -y install git zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel xz xz-devel tk-devel libffi-devel findutils java-11-openjdk-headless
|
||||
|
||||
Complete the rest of the installation by `installing Python 3.8 with pyenv <install-python-pyenv>`.
|
||||
|
||||
----
|
||||
|
||||
.. _install-debian:
|
||||
.. _install-raspbian:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
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
|
||||
|
||||
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
|
||||
CXX=/usr/bin/g++
|
||||
|
||||
Complete the rest of the installation by `installing Python 3.8 with pyenv <install-python-pyenv>`.
|
||||
|
||||
----
|
||||
|
||||
.. _install-fedora:
|
||||
|
||||
~~~~~~~~~~~~
|
||||
Fedora Linux
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Fedora Linux 31 and above has all required packages available in official repositories. Install
|
||||
them with dnf:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo dnf -y install python38 git java-11-openjdk-headless @development-tools
|
||||
|
||||
Continue by `creating-venv-linux`.
|
||||
|
||||
----
|
||||
|
||||
.. _install-mac:
|
||||
|
||||
~~~
|
||||
Mac
|
||||
~~~
|
||||
|
||||
Install Brew: in Finder or Spotlight, search for and open *Terminal*. In the terminal, paste the
|
||||
following, then press Enter:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
/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
|
||||
|
||||
brew install python@3.8
|
||||
echo 'export PATH="/usr/local/opt/python@3.8/bin:$PATH"' >> ~/.profile
|
||||
source ~/.profile
|
||||
brew install git
|
||||
brew cask install adoptopenjdk/openjdk/adoptopenjdk11
|
||||
|
||||
Continue by `creating-venv-linux`.
|
||||
|
||||
----
|
||||
|
||||
.. _install-opensuse:
|
||||
|
||||
~~~~~~~~
|
||||
openSUSE
|
||||
~~~~~~~~
|
||||
|
||||
openSUSE Leap 15.1+
|
||||
*******************
|
||||
|
||||
We recommend installing a community package to get Python 3.8 on openSUSE Leap 15.1+. This package will
|
||||
be installed to the ``/opt`` directory.
|
||||
|
||||
First, add the Opt-Python community repository:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
source /etc/os-release
|
||||
sudo zypper -n ar -f https://download.opensuse.org/repositories/home:/Rotkraut:/Opt-Python/openSUSE_Leap_${VERSION_ID}/ Opt-Python
|
||||
sudo zypper -n --gpg-auto-import-keys ref
|
||||
|
||||
Now install the pre-requirements with zypper:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo zypper -n install opt-python38 opt-python38-setuptools git-core java-11-openjdk-headless
|
||||
sudo zypper -n install -t pattern devel_basis
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
sudo /opt/python/bin/easy_install-3.8 pip
|
||||
|
||||
Continue by `creating-venv-linux`.
|
||||
|
||||
openSUSE Tumbleweed
|
||||
*******************
|
||||
|
||||
openSUSE Tumbleweed has all required dependencies available in official repositories. Install them
|
||||
with zypper:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo zypper -n install python3-base python3-pip git-core java-11-openjdk-headless
|
||||
sudo zypper -n install -t pattern devel_basis
|
||||
|
||||
Continue by `creating-venv-linux`.
|
||||
|
||||
----
|
||||
|
||||
.. _install-ubuntu-1604:
|
||||
|
||||
~~~~~~~~~~~~~~~~
|
||||
Ubuntu 16.04 LTS
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
We recommend adding the ``openjdk-r`` ppa to install Java 11:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo apt update
|
||||
sudo apt -y install software-properties-common
|
||||
sudo add-apt-repository -yu ppa:openjdk-r/ppa
|
||||
|
||||
We recommend adding the ``git-core`` ppa to install Git 2.11 or greater:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo add-apt-repository -yu ppa:git-core/ppa
|
||||
|
||||
We recommend adding the ``deadsnakes`` ppa to install Python 3.8.1 or greater:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo add-apt-repository -yu ppa:deadsnakes/ppa
|
||||
|
||||
Now install the pre-requirements with apt:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo apt -y install python3.8 python3.8-dev python3.8-venv python3-pip git openjdk-11-jre-headless build-essential
|
||||
|
||||
Continue by `creating-venv-linux`.
|
||||
|
||||
----
|
||||
|
||||
.. _install-ubuntu-1804:
|
||||
|
||||
~~~~~~~~~~~~~~~~
|
||||
Ubuntu 18.04 LTS
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
We recommend adding the ``git-core`` ppa to install Git 2.11 or greater:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo apt update
|
||||
sudo apt -y install software-properties-common
|
||||
sudo add-apt-repository -y ppa:git-core/ppa
|
||||
|
||||
We recommend adding the ``deadsnakes`` ppa to install Python 3.8.1 or greater:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo add-apt-repository -y ppa:deadsnakes/ppa
|
||||
|
||||
Now install the pre-requirements with apt:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo apt -y install python3.8 python3.8-dev python3.8-venv python3-pip git openjdk-11-jre-headless build-essential
|
||||
|
||||
Continue by `creating-venv-linux`.
|
||||
|
||||
----
|
||||
|
||||
.. _install-ubuntu:
|
||||
|
||||
~~~~~~~~~~~~~~~~
|
||||
Ubuntu 20.04 LTS
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
We recommend adding the ``git-core`` ppa to install Git 2.11 or greater:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo apt update
|
||||
sudo apt -y install software-properties-common
|
||||
sudo add-apt-repository -y ppa:git-core/ppa
|
||||
|
||||
Now install the pre-requirements with apt:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo apt -y install python3.8 python3.8-dev python3.8-venv python3-pip git openjdk-11-jre-headless build-essential
|
||||
|
||||
Continue by `creating-venv-linux`.
|
||||
|
||||
----
|
||||
|
||||
.. _install-ubuntu-non-lts:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Ubuntu non-LTS versions
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
We recommend adding the ``git-core`` ppa to install Git 2.11 or greater:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo apt update
|
||||
sudo apt -y install software-properties-common
|
||||
sudo add-apt-repository -yu ppa:git-core/ppa
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
CXX=/usr/bin/g++
|
||||
|
||||
And then complete the rest of the installation by `installing Python 3.8 with pyenv <install-python-pyenv>`.
|
||||
|
||||
----
|
||||
|
||||
.. _install-python-pyenv:
|
||||
|
||||
****************************
|
||||
Installing Python with pyenv
|
||||
****************************
|
||||
|
||||
.. note::
|
||||
|
||||
If you followed one of the sections above, and weren't linked here afterwards, you should skip
|
||||
this section.
|
||||
|
||||
On distributions where Python 3.8 needs to be compiled from source, we recommend the use of pyenv.
|
||||
This simplifies the compilation process and has the added bonus of simplifying setting up Red in a
|
||||
virtual environment.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
command -v pyenv && pyenv update || curl https://pyenv.run | bash
|
||||
|
||||
**After this command, you may see a warning about 'pyenv' not being in the load path. Follow the
|
||||
instructions given to fix that, then close and reopen your shell.**
|
||||
|
||||
Then run the following command:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
CONFIGURE_OPTS=--enable-optimizations pyenv install 3.8.6 -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
|
||||
the ``CONFIGURE_OPTS=--enable-optimizations`` part from the front of the command, which will
|
||||
drastically reduce the install time. However, be aware that this will make Python run about 10%
|
||||
slower.
|
||||
|
||||
After that is finished, run:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
pyenv global 3.8.6
|
||||
|
||||
Pyenv is now installed and your system should be configured to run Python 3.8.
|
||||
|
||||
Continue by `creating-venv-linux`.
|
||||
|
||||
.. _creating-venv-linux:
|
||||
|
||||
------------------------------
|
||||
Creating a Virtual Environment
|
||||
------------------------------
|
||||
|
||||
.. tip::
|
||||
|
||||
If you want to learn more about virtual environments, see page: `about-venvs`
|
||||
|
||||
We require installing Red into a virtual environment. Don't be scared, it's very
|
||||
straightforward.
|
||||
|
||||
You have 2 options:
|
||||
|
||||
* :ref:`using-venv` (quick and easy, involves just two commands)
|
||||
* :ref:`using-pyenv-virtualenv` (only available and recommended when you installed Python with pyenv)
|
||||
|
||||
----
|
||||
|
||||
.. _using-venv:
|
||||
|
||||
**************
|
||||
Using ``venv``
|
||||
**************
|
||||
This is the quickest way to get your virtual environment up and running, as `venv` is shipped with
|
||||
python.
|
||||
|
||||
First, choose a directory where you would like to create your virtual environment. It's a good idea
|
||||
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::
|
||||
|
||||
python3.8 -m venv ~/redenv
|
||||
|
||||
And activate it with the following command::
|
||||
|
||||
source ~/redenv/bin/activate
|
||||
|
||||
.. important::
|
||||
|
||||
You must activate the virtual environment with the above command every time you open a new
|
||||
shell to run, install or update Red.
|
||||
|
||||
Continue by `installing-red-linux-mac`.
|
||||
|
||||
----
|
||||
|
||||
.. _using-pyenv-virtualenv:
|
||||
|
||||
**************************
|
||||
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::
|
||||
|
||||
pyenv version
|
||||
|
||||
Now, create a virtual environment with the following command::
|
||||
|
||||
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::
|
||||
|
||||
pyenv shell <name>
|
||||
|
||||
.. important::
|
||||
|
||||
You must activate the virtual environment with the above command every time you open a new
|
||||
shell to run, install or update Red. You can check out other commands like ``pyenv local`` and
|
||||
``pyenv global`` if you wish to keep the virtualenv activated all the time.
|
||||
|
||||
Continue by `installing-red-linux-mac`.
|
||||
|
||||
.. _pyenv-installer: https://github.com/pyenv/pyenv-installer/blob/master/README.rst
|
||||
|
||||
.. _installing-red-linux-mac:
|
||||
|
||||
--------------
|
||||
Installing Red
|
||||
--------------
|
||||
|
||||
Choose one of the following commands to install Red.
|
||||
|
||||
To install without additional config backend support:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
python -m pip install -U pip setuptools wheel
|
||||
python -m pip install -U Red-DiscordBot
|
||||
|
||||
Or, to install with PostgreSQL support:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
python -m pip install -U pip setuptools wheel
|
||||
python -m pip install -U Red-DiscordBot[postgres]
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
These commands are also used for updating Red
|
||||
|
||||
--------------------------
|
||||
Setting Up and Running Red
|
||||
--------------------------
|
||||
|
||||
After installation, set up your instance with the following command:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
redbot-setup
|
||||
|
||||
This will set the location where data will be stored, as well as your
|
||||
storage backend and the name of the instance (which will be used for
|
||||
running the bot).
|
||||
|
||||
Once done setting up the instance, run the following command to run Red:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
redbot <your instance name>
|
||||
|
||||
It will walk through the initial setup, asking for your token and a prefix.
|
||||
You can find out how to obtain a token with
|
||||
`this guide <bot_application_guide>`.
|
||||
|
||||
.. tip::
|
||||
If it's the first time you're using Red, you should check our `getting-started` guide
|
||||
that will walk you through all essential information on how to interact with Red.
|
||||
@@ -1,179 +0,0 @@
|
||||
.. _windows-install-guide:
|
||||
|
||||
=========================
|
||||
Installing Red on Windows
|
||||
=========================
|
||||
|
||||
-------------------------------
|
||||
Installing the pre-requirements
|
||||
-------------------------------
|
||||
|
||||
Please install the pre-requirements by following instructions from one of the following subsections.
|
||||
|
||||
The pre-requirements are:
|
||||
- Python 3.8.1 or greater; **Python 3.9 is currently not supported!**
|
||||
- Pip 18.1 or greater
|
||||
- Git 2.11+
|
||||
- Java Runtime Environment 11 (for audio support)
|
||||
|
||||
We also recommend installing some basic compiler tools, in case our dependencies don't provide
|
||||
pre-built "wheels" for your architecture.
|
||||
|
||||
.. contents:: Choose a method of installing pre-requirements:
|
||||
:local:
|
||||
|
||||
----
|
||||
|
||||
*********************************************
|
||||
Using PowerShell and Chocolatey (recommended)
|
||||
*********************************************
|
||||
|
||||
To install via PowerShell, search "powershell" in the Windows start menu,
|
||||
right-click on it and then click "Run as administrator".
|
||||
|
||||
Then run each of the following commands:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
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.6
|
||||
|
||||
For Audio support, you should also run the following command before exiting:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
choco upgrade adoptopenjdk11jre -y
|
||||
|
||||
|
||||
From here, exit the prompt then continue onto `creating-venv-windows`.
|
||||
|
||||
----
|
||||
|
||||
********************************
|
||||
Manually installing dependencies
|
||||
********************************
|
||||
|
||||
.. attention:: There are additional configuration steps required which are
|
||||
not documented for installing dependencies manually.
|
||||
These dependencies are only listed seperately here for
|
||||
reference purposes.
|
||||
|
||||
* `MSVC Build tools <https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2019>`_
|
||||
|
||||
* `Python 3.8.1 or greater <https://www.python.org/downloads/>`_; **Python 3.9 is currently not supported!**
|
||||
|
||||
.. attention:: Please make sure that the box to add Python to PATH is CHECKED, otherwise
|
||||
you may run into issues when trying to run Red.
|
||||
|
||||
* `Git 2.11+ <https://git-scm.com/download/win>`_
|
||||
|
||||
.. attention:: Please choose the option to "Git from the command line and also from 3rd-party software" in Git's setup.
|
||||
|
||||
* `Java 11 <https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=hotspot>`_ - needed for Audio
|
||||
|
||||
From here, continue onto `creating-venv-windows`.
|
||||
|
||||
----
|
||||
|
||||
.. _creating-venv-windows:
|
||||
|
||||
------------------------------
|
||||
Creating a Virtual Environment
|
||||
------------------------------
|
||||
|
||||
.. tip::
|
||||
|
||||
If you want to learn more about virtual environments, see page: `about-venvs`.
|
||||
|
||||
We require installing Red into a virtual environment. Don't be scared, it's very
|
||||
straightforward.
|
||||
|
||||
First, choose a directory where you would like to create your virtual environment. It's a good idea
|
||||
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.
|
||||
|
||||
Start with opening a command prompt (open Start, search for "command prompt", then click it).
|
||||
|
||||
.. note::
|
||||
|
||||
You shouldn't run command prompt as administrator when creating your virtual environment, or
|
||||
running Red.
|
||||
|
||||
.. warning::
|
||||
|
||||
These commands will not work in PowerShell - you have to use command prompt as said above.
|
||||
|
||||
Then create your virtual environment with the following command
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
py -3.8 -m venv "%userprofile%\redenv"
|
||||
|
||||
And activate it with the following command
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
"%userprofile%\redenv\Scripts\activate.bat"
|
||||
|
||||
.. important::
|
||||
|
||||
You must activate the virtual environment with the above command every time you open a new
|
||||
Command Prompt to run, install or update Red.
|
||||
|
||||
|
||||
.. _installing-red-windows:
|
||||
|
||||
--------------
|
||||
Installing Red
|
||||
--------------
|
||||
|
||||
.. attention:: You may need to restart your computer after installing dependencies
|
||||
for the PATH changes to take effect.
|
||||
|
||||
Run **one** of the following set of commands, depending on what extras you want installed
|
||||
|
||||
* Normal installation:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
python -m pip install -U pip setuptools wheel
|
||||
python -m pip install -U Red-DiscordBot
|
||||
|
||||
* With PostgreSQL support:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
python -m pip install -U pip setuptools wheel
|
||||
python -m pip install -U Red-DiscordBot[postgres]
|
||||
|
||||
--------------------------
|
||||
Setting Up and Running Red
|
||||
--------------------------
|
||||
|
||||
After installation, set up your instance with the following command:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
redbot-setup
|
||||
|
||||
This will set the location where data will be stored, as well as your
|
||||
storage backend and the name of the instance (which will be used for
|
||||
running the bot).
|
||||
|
||||
Once done setting up the instance, run the following command to run Red:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
redbot <your instance name>
|
||||
|
||||
It will walk through the initial setup, asking for your token and a prefix.
|
||||
You can find out how to obtain a token with
|
||||
`this guide <bot_application_guide>`.
|
||||
|
||||
.. tip::
|
||||
If it's the first time you're using Red, you should check our `getting-started` guide
|
||||
that will walk you through all essential information on how to interact with Red.
|
||||
@@ -1,36 +0,0 @@
|
||||
@ECHO OFF
|
||||
|
||||
pushd %~dp0
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
if "%SPHINXBUILD%" == "" (
|
||||
set SPHINXBUILD=python -msphinx
|
||||
)
|
||||
set SOURCEDIR=.
|
||||
set BUILDDIR=_build
|
||||
set SPHINXPROJ=Red-DiscordBot
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
%SPHINXBUILD% >NUL 2>NUL
|
||||
if errorlevel 9009 (
|
||||
echo.
|
||||
echo.The Sphinx module was not found. Make sure you have Sphinx installed,
|
||||
echo.then set the SPHINXBUILD environment variable to point to the full
|
||||
echo.path of the 'sphinx-build' executable. Alternatively you may add the
|
||||
echo.Sphinx directory to PATH.
|
||||
echo.
|
||||
echo.If you don't have Sphinx installed, grab it from
|
||||
echo.http://sphinx-doc.org/
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
|
||||
goto end
|
||||
|
||||
:help
|
||||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
|
||||
|
||||
:end
|
||||
popd
|
||||
@@ -1,50 +0,0 @@
|
||||
.. This file will be run at the beginning of all files.
|
||||
You can add the subsitutions you need.
|
||||
|
||||
.. this is a .txt so sphinx doesn't error because it's
|
||||
missing in the index
|
||||
|
||||
|
||||
.. These are the comments for permissions locks
|
||||
|
||||
.. |owner-lock| replace:: This command is locked to the
|
||||
:ref:`bot owner <getting-started-permissions>`.
|
||||
|
||||
.. |guildowner-lock| replace:: This command is locked to the
|
||||
:ref:`server owner <getting-started-permissions>`.
|
||||
|
||||
.. |admin-lock| replace:: This command is locked to the
|
||||
:ref:`admin role <getting-started-permissions>`.
|
||||
|
||||
.. |mod-lock| replace:: This command is locked to the
|
||||
:ref:`mod role <getting-started-permissions>`.
|
||||
|
||||
|
||||
.. This is for describing how a format should be formatted
|
||||
|
||||
.. |role-input| replace:: Please give **the exact role name or ID**, or it won't be detected.
|
||||
|
||||
.. |role-input-quotes| replace:: Please give **the exact role name or ID**, or it won't be detected.
|
||||
If the role name has spaces, provide it enclosed in quotes like this: ``"my role with spaces"``
|
||||
|
||||
.. |member-input| replace:: You can either mention the member, provide its ID, its exact name with
|
||||
the tag or not, or its nickname.
|
||||
|
||||
.. |member-input-quotes| replace:: You can either mention the member, provide its ID, its exact
|
||||
name with the tag or not, or its nickname enclosed in quotes if there are spaces.
|
||||
|
||||
.. |user-input| replace:: You can either provide the member's ID or its exact name with the tag or
|
||||
not.
|
||||
|
||||
.. |user-input-quotes| replace:: You can either provide the member's ID or its exact name with the
|
||||
tag or not, enclosed in quotes if there are spaces.
|
||||
|
||||
.. |channel-input| replace:: You can either mention the channel, provide its exact name or its ID.
|
||||
|
||||
.. |vc-input| replace:: You can either provide the voice channel's ID or its exact name.
|
||||
|
||||
.. |vc-input-quotes| replace:: You can either provide the voice channel's ID or its exact name,
|
||||
enclosed in quotes if there are spaces.
|
||||
|
||||
.. |color-input| replace:: You can either provide the hexadecimal code of the color, or one of the
|
||||
colors listed here: :class:`discord.Color`.
|
||||
@@ -1,87 +0,0 @@
|
||||
.. Red Core Data Statement
|
||||
|
||||
=====================
|
||||
Red and End User Data
|
||||
=====================
|
||||
|
||||
Notes for everyone
|
||||
******************
|
||||
|
||||
What data Red collects
|
||||
----------------------
|
||||
|
||||
Red and the cogs included with it collect some amount of data
|
||||
about users for the bot's normal operations.
|
||||
|
||||
The bot will keep track of a short history of usernames/nicknames. It will also
|
||||
remember which actions were taken using your Discord account (such as creating a playlist)
|
||||
as well as the content of specific messages used directly as commands for the bot
|
||||
(such as reports sent to servers).
|
||||
|
||||
By default, Red will not collect any more data than it needs, and will not use it
|
||||
for anything other than the portion of the Red's functionality that necessitated it.
|
||||
|
||||
3rd party extensions may store additional data beyond what Red does by default.
|
||||
You can use the command ``[p]mydata 3rdparty``
|
||||
to view statements about how extensions use your data made by the authors of
|
||||
the specific 3rd party extensions an instance of Red has installed.
|
||||
|
||||
How can I delete data Red has about me?
|
||||
---------------------------------------
|
||||
|
||||
The command ``[p]mydata forgetme`` provides a way for users to remove
|
||||
large portions of their own data from the bot. This command will not
|
||||
remove operational data, such as a record that your
|
||||
Discord account was the target of a moderation action.
|
||||
|
||||
3rd party extensions to Red are able to delete data when this command
|
||||
is used as well, but this is something each extension must implement.
|
||||
If a loaded extension does not implement this, the user will be informed.
|
||||
|
||||
Additional Notes for Bot Owners and Hosts
|
||||
*****************************************
|
||||
|
||||
How to comply with a request from Discord Trust & Safety
|
||||
--------------------------------------------------------
|
||||
|
||||
There are a handful of these available to bot owners in the command group
|
||||
``[p]mydata ownermanagement``.
|
||||
|
||||
The most pertinent one if asked to delete data by a member of Trust & Safety
|
||||
is
|
||||
|
||||
``[p]mydata ownermanagement processdiscordrequest``
|
||||
|
||||
This will cause the bot to get rid of or disassociate all data
|
||||
from the specified user ID.
|
||||
|
||||
.. warning::
|
||||
|
||||
You should not use this unless
|
||||
Discord has specifically requested this with regard to a deleted user.
|
||||
This will remove the user from various anti-abuse measures.
|
||||
If you are processing a manual request from a user, read the next section
|
||||
|
||||
|
||||
How to process deletion requests from users
|
||||
-------------------------------------------
|
||||
|
||||
You can point users to the command ``[p]mydata forgetme`` as a first step.
|
||||
|
||||
If users cannot use that for some reason, the command
|
||||
|
||||
``[p]mydata ownermanagement deleteforuser``
|
||||
|
||||
exists as a way to handle this as if the user had done it themselves.
|
||||
|
||||
Be careful about using the other owner level deletion options on behalf of users,
|
||||
as this may also result in losing operational data such as data used to prevent spam.
|
||||
|
||||
What owners and hosts are responsible for
|
||||
-----------------------------------------
|
||||
|
||||
Owners and hosts must comply both with Discord's terms of service and any applicable laws.
|
||||
Owners and hosts are responsible for all actions their bot takes.
|
||||
|
||||
We cannot give specific guidance on this, but recommend that if there are any issues
|
||||
you be forthright with users, own up to any mistakes, and do your best to handle it.
|
||||
@@ -1,50 +0,0 @@
|
||||
.. v3.2.0 Release Notes
|
||||
|
||||
##################################
|
||||
Red DiscordBot 3.2.0 Release Notes
|
||||
##################################
|
||||
|
||||
|
||||
Please read the following prior to updating.
|
||||
|
||||
- 3.2 comes with improvements which required breaking changes for 3rd party cogs.
|
||||
When you update to 3.2, your cogs may not be compatible if the author has not handled
|
||||
the changes yet.
|
||||
|
||||
|
||||
- 3.2 requires Python 3.8.1.
|
||||
This was done so that we could better handle some behavior which was not fixed for Python 3.7.
|
||||
If you need help updating, our install docs will cover everything you need to know to update.
|
||||
|
||||
.. note::
|
||||
|
||||
You may get a notification from the downloader cog about needing to refetch dependencies
|
||||
This is expected, and it will walk you through everything and do as much as it can for you.
|
||||
|
||||
|
||||
- 3.2 dropped support for the MongoDB driver
|
||||
|
||||
- If you were not using the MongoDB driver, this does not effect you.
|
||||
- If you were using a 3rd party cog which required MongoDB, it probably still does.
|
||||
- If you were using the MongoDB driver, prior to launching your instance,
|
||||
you will need to run the following commands to convert
|
||||
|
||||
.. code::
|
||||
|
||||
python -m pip install dnspython~=1.16.0 motor~=2.0.0 pymongo~=3.8.0
|
||||
redbot-setup convert [instancename] json
|
||||
|
||||
|
||||
- 3.2 comes with many feature upgrades. A brief high level list of these is below.
|
||||
|
||||
- A metric ton of bugfixes
|
||||
- Bot shutdown is handled significantly better
|
||||
- Audio is much more powerful
|
||||
- We've made it easier for cog creators to interact with the core bot APIs safely
|
||||
- We've supplied cog creators with additional tools
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
The full list of changes is much longer than we can include here,
|
||||
but our changelog has the fine details.
|
||||
@@ -1,2 +0,0 @@
|
||||
# We still need this because RTD is special
|
||||
setuptools==40.8.0
|
||||
@@ -1,139 +0,0 @@
|
||||
============
|
||||
Updating Red
|
||||
============
|
||||
|
||||
Updating to the latest version of Red has several benefits:
|
||||
|
||||
- New features and improvements are added.
|
||||
- Bugs are fixed.
|
||||
- Your bot is safe from security vulnerabilities that have been found.
|
||||
|
||||
Here are some things to consider to help make your upgrade as smooth as possible.
|
||||
|
||||
.. note::
|
||||
|
||||
If you're developing for Red, you should also look for "Breaking changes" sections in release notes for each minor (X.Y.0) version that's been released since you last updated Red.
|
||||
|
||||
.. important::
|
||||
|
||||
Make sure to read the **Read before updating** sections of the changelogs for all releases that were published since you last updated your instance. They contain important information and if you don't read them, you might run into some issues later.
|
||||
|
||||
Updating differs depending on the version you currently have. Next sections will explain how to upgrade to latest version of Red (|version|) from the version that is in the header of the section.
|
||||
|
||||
.. contents:: Choose the version you're currently on from the list below:
|
||||
:local:
|
||||
:depth: 1
|
||||
|
||||
|
||||
Red 3.2.0 or newer
|
||||
******************
|
||||
|
||||
Windows
|
||||
-------
|
||||
|
||||
If you have Red 3.2.0 or newer, you can upgrade by following these 4 easy steps:
|
||||
|
||||
1. Shut your bot down.
|
||||
|
||||
2. Activate your venv with the following command:
|
||||
|
||||
.. code:: none
|
||||
|
||||
"%userprofile%\redenv\Scripts\activate.bat"
|
||||
|
||||
3. Update Red with this command:
|
||||
|
||||
.. code:: none
|
||||
|
||||
python -m pip install -U Red-DiscordBot
|
||||
|
||||
.. attention::
|
||||
|
||||
If you're using PostgreSQL data backend, replace ``Red-DiscordBot`` in the second command with ``Red-DiscordBot[postgres]``
|
||||
|
||||
4. Start your bot.
|
||||
|
||||
Linux & Mac
|
||||
-----------
|
||||
|
||||
If you have Red 3.2.0 or newer, you can upgrade by following these 4 easy steps:
|
||||
|
||||
1. Shut your bot down.
|
||||
|
||||
2. Activate your virtual environment.
|
||||
|
||||
If you used ``venv`` for your virtual environment, use:
|
||||
|
||||
.. code:: none
|
||||
|
||||
source ~/redenv/bin/activate
|
||||
|
||||
If you used ``pyenv`` for your virtual environment, use:
|
||||
|
||||
.. code:: none
|
||||
|
||||
pyenv shell <name>
|
||||
|
||||
3. Update Red with this command:
|
||||
|
||||
.. code:: none
|
||||
|
||||
python -m pip install -U Red-DiscordBot
|
||||
|
||||
.. attention::
|
||||
|
||||
If you're using PostgreSQL data backend, replace ``Red-DiscordBot`` in the second command with ``Red-DiscordBot[postgres]``
|
||||
|
||||
4. Start your bot.
|
||||
|
||||
Red 3.1.X
|
||||
*********
|
||||
|
||||
If you have Red 3.1.X, you will need to follow the install instructions for your operating system. Make sure that you turn your bot off first.
|
||||
|
||||
- `Windows <install_windows>`
|
||||
- `Linux & Mac <install_linux_mac>`
|
||||
|
||||
Follow every step to ensure you have all dependencies up-to-date and only skip ``redbot-setup`` step as you already have a bot instance.
|
||||
|
||||
**If you already have Red installed in a virtual environment, you will need to delete it before starting this process.**
|
||||
|
||||
.. attention::
|
||||
|
||||
Red 3.2 dropped support for the MongoDB driver
|
||||
|
||||
- If you were not using the MongoDB driver, this does not affect you.
|
||||
- If you were using a 3rd party cog which required MongoDB, it probably still does.
|
||||
- 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::
|
||||
|
||||
python -m pip install dnspython~=1.16.0 motor~=2.0.0 pymongo~=3.8.0
|
||||
redbot-setup convert [instancename] json
|
||||
|
||||
|
||||
Red 3.0.2 and older
|
||||
*******************
|
||||
|
||||
.. important::
|
||||
|
||||
Red 3.2 dropped support for the MongoDB driver
|
||||
|
||||
- If you were not using the MongoDB driver, this does not affect you.
|
||||
- If you were using a 3rd party cog which required MongoDB, it probably still does.
|
||||
- If you were using the MongoDB driver, **prior to updating**, you will need to convert your data to JSON backend,
|
||||
using following command:
|
||||
|
||||
.. code::
|
||||
|
||||
redbot-setup --edit
|
||||
|
||||
If you have Red 3.0.2 or older, you will need to follow the install instructions for your operating system. Make sure that you turn your bot off first.
|
||||
|
||||
- `Windows <install_windows>`
|
||||
- `Linux & Mac <install_linux_mac>`
|
||||
|
||||
Follow every step to ensure you have all dependencies up-to-date and only skip ``redbot-setup`` step as you already have a bot instance.
|
||||
|
||||
**If you already have Red installed in a virtual environment, you will need to delete it before starting this process.**
|
||||
@@ -1,43 +0,0 @@
|
||||
.. _version-guarantees:
|
||||
|
||||
==========
|
||||
Versioning
|
||||
==========
|
||||
|
||||
Red is versioned as ``major.minor.micro``
|
||||
|
||||
While this is very similar to SemVer, we have our own set of guarantees.
|
||||
|
||||
Major versions are for project wide rewrites and are not expected in the foreseeable future.
|
||||
|
||||
==========
|
||||
Guarantees
|
||||
==========
|
||||
|
||||
Anything in the ``redbot.core`` module or any of its submodules
|
||||
which is not private (even if not documented) should not break without notice.
|
||||
|
||||
Anything in the ``redbot.cogs`` and ``redbot.vendored`` modules or any of their submodules is specifically
|
||||
excluded from being guaranteed.
|
||||
|
||||
Method names and names of attributes of classes, functions, extensions, and modules
|
||||
provided by or provided to the bot should not begin with
|
||||
``red_`` or be of the form ``__red_*__`` except as documented.
|
||||
This allows us to add certain optional features non-breakingly without a name conflict.
|
||||
|
||||
Any RPC method exposed by Red may break without notice.
|
||||
|
||||
If you would like something in here to be guaranteed,
|
||||
open an issue making a case for it to be moved.
|
||||
|
||||
=======================
|
||||
Breaking Change Notices
|
||||
=======================
|
||||
|
||||
Breaking changes in Red will be noted in the changelog with a special section.
|
||||
|
||||
Breaking changes may only occur on a minor or major version bump.
|
||||
|
||||
A change not covered by our guarantees may not be considered breaking for these purposes,
|
||||
while still being documented as a breaking change in internal documentation
|
||||
for the purposes of other internal APIs.
|
||||
@@ -0,0 +1,249 @@
|
||||
from random import randint, choice
|
||||
import time
|
||||
|
||||
import dataIO
|
||||
|
||||
client = None
|
||||
settings = []
|
||||
#words = dataIO.loadWords()
|
||||
#anagram_sessions_timestamps = {}
|
||||
anagram_sessions = []
|
||||
payday_register = {}
|
||||
PAYDAY_TIME = 300 # seconds between each payday
|
||||
PAYDAY_CREDITS = 120 # credits received
|
||||
|
||||
def initialize():
|
||||
global bank
|
||||
bank = dataIO.fileIO("json/economy.json", "load")
|
||||
|
||||
def loadHelp():
|
||||
global slot_help, economy_exp
|
||||
|
||||
if settings == []: return False #first run
|
||||
|
||||
slot_help = """ Slot machine payouts:
|
||||
:two: :two: :six: Bet * 5000
|
||||
:four_leaf_clover: :four_leaf_clover: :four_leaf_clover: +1000
|
||||
:cherries: :cherries: :cherries: +800
|
||||
:two: :six: Bet * 4
|
||||
:cherries: :cherries: Bet * 3
|
||||
|
||||
Three symbols: +500
|
||||
Two symbols: Bet * 2
|
||||
|
||||
You need an account to play. {0}register one.
|
||||
Bet range: 5 - 100
|
||||
""".format(settings["PREFIX"])
|
||||
|
||||
economy_exp = """ **Economy. Get rich and have fun with imaginary currency!**
|
||||
|
||||
{0}register - Register an account at the Twentysix bank
|
||||
{0}balance - Check your balance
|
||||
{0}slot help - Slot machine explanation
|
||||
{0}slot [bid] - Play the slot machine
|
||||
{0}payday - Type it every {1} seconds to receive some credits.
|
||||
""".format(settings["PREFIX"], str(PAYDAY_TIME))
|
||||
|
||||
async def checkCommands(message):
|
||||
p = settings["PREFIX"]
|
||||
cmd = message.content
|
||||
user = message.author
|
||||
if cmd == p + "balance":
|
||||
if accountCheck(user.id):
|
||||
await client.send_message(message.channel, "{} `Your balance is: {}`".format(user.mention, str(checkBalance(user.id))))
|
||||
else:
|
||||
await client.send_message(message.channel, "{} `You don't have an account at the Twentysix bank. Type !register to open one.`".format(user.mention, str(checkBalance(user.id))))
|
||||
elif cmd == p + "register":
|
||||
await registerAccount(user, message)
|
||||
elif cmd == p + "slot help":
|
||||
await client.send_message(message.author, slot_help)
|
||||
await client.send_message(message.channel, "{} `Check your DMs for the slot machine explanation.`".format(message.author.mention))
|
||||
elif cmd.startswith(p + "slot"):
|
||||
await slotMachineCheck(message)
|
||||
elif cmd == p + "economy":
|
||||
await client.send_message(message.author, economy_exp)
|
||||
await client.send_message(message.channel, "{} `Check your DMs for the economy explanation.`".format(message.author.mention))
|
||||
elif cmd == p + "challenge":
|
||||
#isChallengeOngoing(message)
|
||||
pass
|
||||
elif cmd == p + "payday":
|
||||
await payday(message)
|
||||
|
||||
async def registerAccount(user, message):
|
||||
if user.id not in bank:
|
||||
bank[user.id] = {"name" : user.name, "balance" : 100}
|
||||
dataIO.fileIO("json/economy.json", "save", bank)
|
||||
await client.send_message(message.channel, "{} `Account opened. Current balance: {}`".format(user.mention, str(checkBalance(user.id))))
|
||||
else:
|
||||
await client.send_message(message.channel, "{} `You already have an account at the Twentysix bank.`".format(user.mention))
|
||||
|
||||
def accountCheck(id):
|
||||
if id in bank:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def checkBalance(id):
|
||||
if accountCheck(id):
|
||||
return bank[id]["balance"]
|
||||
else:
|
||||
return False
|
||||
|
||||
def withdrawMoney(id, amount):
|
||||
if accountCheck(id):
|
||||
if bank[id]["balance"] >= int(amount):
|
||||
bank[id]["balance"] = bank[id]["balance"] - int(amount)
|
||||
dataIO.fileIO("json/economy.json", "save", bank)
|
||||
else:
|
||||
return False
|
||||
else:
|
||||
return False
|
||||
|
||||
def addMoney(id, amount):
|
||||
if accountCheck(id):
|
||||
bank[id]["balance"] = bank[id]["balance"] + int(amount)
|
||||
dataIO.fileIO("json/economy.json", "save", bank)
|
||||
else:
|
||||
return False
|
||||
|
||||
def enoughMoney(id, amount):
|
||||
if accountCheck(id):
|
||||
if bank[id]["balance"] >= int(amount):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
else:
|
||||
return False
|
||||
|
||||
async def isChallengeOngoing(message): #Work in progress
|
||||
global anagram_sessions, anagram_sessions_timestamps
|
||||
id = message.channel.id
|
||||
for session in anagram_sessions:
|
||||
if time.perf_counter() - session.started >= 600:
|
||||
if session.done:
|
||||
anagram_sessions.remove(session)
|
||||
anagram_sessions.append(Anagram(message))
|
||||
return True
|
||||
else:
|
||||
await client.send_message(message.channel, "{} `A challenge is already ongoing.`".format(message.author.mention))
|
||||
return True
|
||||
else:
|
||||
await client.send_message(message.channel, "{} `You have to wait 10 minutes before each challenge.`".format(message.author.mention))
|
||||
return True
|
||||
anagram_sessions.append(Anagram(message))
|
||||
|
||||
async def payday(message):
|
||||
id = message.author.id
|
||||
if accountCheck(id):
|
||||
if id in payday_register:
|
||||
if abs(payday_register[id] - int(time.perf_counter())) >= PAYDAY_TIME:
|
||||
addMoney(id, PAYDAY_CREDITS)
|
||||
payday_register[id] = int(time.perf_counter())
|
||||
await client.send_message(message.channel, "{} `Here, take some credits. Enjoy! (+{} credits!)`".format(message.author.mention, str(PAYDAY_CREDITS)))
|
||||
else:
|
||||
await client.send_message(message.channel, "{} `Too soon. You have to wait {} seconds between each payday.`".format(message.author.mention, str(PAYDAY_TIME)))
|
||||
else:
|
||||
payday_register[id] = int(time.perf_counter())
|
||||
addMoney(id, PAYDAY_CREDITS)
|
||||
await client.send_message(message.channel, "{} `Here, take some credits. Enjoy! (+{} credits!)`".format(message.author.mention, str(PAYDAY_CREDITS)))
|
||||
else:
|
||||
await client.send_message(message.channel, "{} `You need an account to receive credits. (!economy)`".format(message.author.mention))
|
||||
|
||||
###############SLOT##############
|
||||
|
||||
async def slotMachineCheck(message):
|
||||
p = settings["PREFIX"]
|
||||
msg = message.content.split()
|
||||
if len(msg) == 2:
|
||||
if msg[1].isdigit():
|
||||
bid = int(msg[1])
|
||||
if enoughMoney(message.author.id, bid):
|
||||
if bid > 4 and bid < 101:
|
||||
await slotMachine(message, bid)
|
||||
else:
|
||||
await client.send_message(message.channel, "{} `Bid must be between 5 and 100.`".format(message.author.mention))
|
||||
else:
|
||||
await client.send_message(message.channel, "{0} `You need an account with enough funds to play the slot machine. ({1}economy)`".format(message.author.mention, settings["PREFIX"]))
|
||||
else:
|
||||
await client.send_message(message.channel, "{} `".format(message.author.mention) + p + "slot [bid]`")
|
||||
else:
|
||||
await client.send_message(message.channel, "{} `".format(message.author.mention) + p + "slot [bid]`")
|
||||
|
||||
async def slotMachine(message, bid):
|
||||
reel_pattern = [":cherries:", ":cookie:", ":two:", ":four_leaf_clover:", ":cyclone:", ":sunflower:", ":six:", ":mushroom:", ":heart:", ":snowflake:"]
|
||||
padding_before = [":mushroom:", ":heart:", ":snowflake:"] # padding prevents index errors
|
||||
padding_after = [":cherries:", ":cookie:", ":two:"]
|
||||
reel = padding_before + reel_pattern + padding_after
|
||||
reels = []
|
||||
for i in range(0, 3):
|
||||
n = randint(3,12)
|
||||
reels.append([reel[n - 1], reel[n], reel[n + 1]])
|
||||
line = [reels[0][1], reels[1][1], reels[2][1]]
|
||||
|
||||
display_reels = " " + reels[0][0] + " " + reels[1][0] + " " + reels[2][0] + "\n"
|
||||
display_reels += ">" + reels[0][1] + " " + reels[1][1] + " " + reels[2][1] + "\n"
|
||||
display_reels += " " + reels[0][2] + " " + reels[1][2] + " " + reels[2][2] + "\n"
|
||||
|
||||
if line[0] == ":two:" and line[1] == ":two:" and line[2] == ":six:":
|
||||
bid = bid * 5000
|
||||
await client.send_message(message.channel, "{}{} `226! Your bet is multiplied * 5000! {}!` ".format(display_reels, message.author.mention, str(bid)))
|
||||
elif line[0] == ":four_leaf_clover:" and line[1] == ":four_leaf_clover:" and line[2] == ":four_leaf_clover:":
|
||||
bid += 1000
|
||||
await client.send_message(message.channel, "{}{} `Three FLC! +1000!` ".format(display_reels, message.author.mention))
|
||||
elif line[0] == ":cherries:" and line[1] == ":cherries:" and line[2] == ":cherries:":
|
||||
bid += 800
|
||||
await client.send_message(message.channel, "{}{} `Three cherries! +800!` ".format(display_reels, message.author.mention))
|
||||
elif line[0] == line[1] == line[2]:
|
||||
bid += 500
|
||||
await client.send_message(message.channel, "{}{} `Three symbols! +500!` ".format(display_reels, message.author.mention))
|
||||
elif line[0] == ":two:" and line[1] == ":six:" or line[1] == ":two:" and line[2] == ":six:":
|
||||
bid = bid * 4
|
||||
await client.send_message(message.channel, "{}{} `26! Your bet is multiplied * 4! {}!` ".format(display_reels, message.author.mention, str(bid)))
|
||||
elif line[0] == ":cherries:" and line[1] == ":cherries:" or line[1] == ":cherries:" and line[2] == ":cherries:":
|
||||
bid = bid * 3
|
||||
await client.send_message(message.channel, "{}{} `Two cherries! Your bet is multiplied * 3! {}!` ".format(display_reels, message.author.mention, str(bid)))
|
||||
elif line[0] == line[1] or line[1] == line[2]:
|
||||
bid = bid * 2
|
||||
await client.send_message(message.channel, "{}{} `Two symbols! Your bet is multiplied * 2! {}!` ".format(display_reels, message.author.mention, str(bid)))
|
||||
# elif line[0] == ":cherries:" or line[1] == ":cherries:" or line[2] == ":cherries:":
|
||||
# await client.send_message(message.channel, "{}{} `Cherries! Your bet is safe!` ".format(display_reels, message.author.mention))
|
||||
else:
|
||||
await client.send_message(message.channel, "{}{} `Nothing! Lost bet.` ".format(display_reels, message.author.mention))
|
||||
withdrawMoney(message.author.id, bid)
|
||||
await client.send_message(message.channel, "`Credits left: {}`".format(str(checkBalance(message.author.id))))
|
||||
return True
|
||||
addMoney(message.author.id, bid)
|
||||
await client.send_message(message.channel, "`Current credits: {}`".format(str(checkBalance(message.author.id))))
|
||||
|
||||
#######################################
|
||||
|
||||
############### ANAGRAM ###############
|
||||
# Work in progress
|
||||
|
||||
class Anagram():
|
||||
def __init__(self, message):
|
||||
self.channel = message.channel
|
||||
self.word = choice(words).lower()
|
||||
self.anagram = list(self.word)
|
||||
shuffle(self.anagram)
|
||||
self.anagram = "".join(self.anagram)
|
||||
self.started = int(time.perf_counter())
|
||||
self.MAX_TIME = 60
|
||||
self.done = False
|
||||
|
||||
def checkWord(self, message):
|
||||
if time.perf_counter() - self.Atimestamp <= self.MAX_TIME:
|
||||
msg = message.content.lower()
|
||||
if msg.find(self.word) != -1:
|
||||
pass
|
||||
else:
|
||||
self.gameOver()
|
||||
|
||||
async def gameOver(self):
|
||||
self.done = True
|
||||
try:
|
||||
await client.send_message(self.channel, "`Anagram session over! No one guessed the word!`")
|
||||
except:
|
||||
pass
|
||||
|
||||
######################################
|
||||