* Simplify `redbot-setup backup` thanks to Click 8.0
* Add some of the missing type hints
* Fix unnecessary new lines in `redbot-setup` and `redbot-setup delete`
* Add default value for storage backend
* Add non-interactive mode to `redbot-setup`
(cherry picked from commit 8cc004f70f)
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This was removed long ago from the Windows guide (#4119) but it seems like we never got around to removing it from Unix install guides as well.
This note is rather inaccurate and the source of truth for updating Red is available in the Updating Red document.
(cherry picked from commit 90406be9ea)
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Drop Fedora 33
By the time we release, it's going to reach EOL.
* Drop Raspberry Pi OS 10, add support for 11
* Bring RPi OS 10 back
* Add Alma Linux 8
* Fix-up RHEL EOL dates
* Add '(Legacy)' to Raspberry Pi OS 10
* Drop CentOS 8.
(cherry picked from commit d1df27bc14)
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Without these type-hints, I've found that PyCharm misidentifies the returned type, causing a number of false positives in static type checking.
(cherry picked from commit e878483318)
Co-authored-by: Toby Harradine <Tobotimus@users.noreply.github.com>
Co-authored-by: Toby Harradine <Tobotimus@users.noreply.github.com>
* Add instructions on how to add pyenv to load path
* Support zsh in pyenv load path instructions
* Make instructions for Mac work when shell-specific profile file exists
* Includes are weird...
* .
* Fix my misunderstanding of what files zsh sources
* Operator precedence, or something like that
(cherry picked from commit 78c92cc766)
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
The new pip 21.3 (released 2021-10-11) uses in-tree builds when `pip install .` is used (see [release notes](https://pip.pypa.io/en/stable/news/#v21-3) and [implementation PR](https://github.com/pypa/pip/pull/10495)). This means CodeQL will see all files twice (once in the real location that is part of this repository, and one in the copy in the `build/` dir), which trips up the analysis.
When an editable install is used instead with `pip install -e .`, there is no `build/` dir, so the analysis will work again.
(cherry picked from commit 42293afd43)
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
* show repo name in findcog
* how did i manage to overcomplicate this?
* for Kreusada
* I wanted to do that... but forgot
(cherry picked from commit 1d34e9e47b)
Co-authored-by: Dav <dav@mail.stopdavabuse.de>
Co-authored-by: Dav <dav@mail.stopdavabuse.de>
* Exclude include files from being built
* Split install guides into multiple documents (one per OS/version combo)
* Update references
* Unify anchor names
* Update pyenv requirements in CentOS 7 guide
* Update install guides for RHEL derivatives to not use pyenv
* Add guide for Rocky Linux 8
* 8.4+ -> 8.4-8.x
* Add 'the'
(cherry picked from commit cbbb9d9b9b)
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Added years and months to parse_timedelta
* Added new parse_datetimedelta along with classes for relative dates
* Switched datetime as dt to just datetime for clarity
* Changed to returning relativedelta instead of datetime
* Fixed single char typo
* After some digging, removed min and max from relative delta b/c of https://github.com/dateutil/dateutil/issues/350
* Add dateutil to intersphinx mapping
* Change uppercase D in RelativeDeltaConverter to a lowercase D
* Fix cross-references in docstrings
* Add new class and methods to __all__
* Remove get_relativedelta_converter()
* style
* Fix name of parse_relativedelta test
* more style
* Re-export new class and function in `redbot.core.commands`
(cherry picked from commit ed9bb77eec)
Co-authored-by: Zoë F <zoe@dataleek.io>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: Zoë F <zoe@dataleek.io>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Clarify Debian 10 as "Buster"
* Add Debian 11 Install
* This typo would of bugged my OCD...
* Clarify Debian 10 as "Buster"
* Add Debian 11 Install
* This typo would of bugged my OCD...
* Add apt upgrade line to doc
* Removing dupe for Debian 11
I'm not sure how that happened, but oh well...
(cherry picked from commit 33dddaf5b4)
Co-authored-by: Ryan <twinshadow@shadowhime.net>
Co-authored-by: Ryan <twinshadow@shadowhime.net>
* Split `Requires._transition_state` into reusable methods for Diagnoser
* (style) Fix line length
* Add missing .format()
* Add handling for user permissions, privilege level, Permissions rules
* Add missing awaits, use correct method in user perms check, add 'the'
* Fix .format() fields
* Add comment
* Add new file to labeler's configuration
* Add the command to the documentation
* All the work from DiagnoserCog
You can find the commit history of it here:
https://github.com/jack1142/DiagnoserCog
* Fix circular import
* Make channel argument optional
* Add a tip about channels from different servers
(cherry picked from commit 86649e897f)
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* [Trivia] Handle potential Discord errors in session.
* Hm why did I put HTTPException in there
* Revert "Hm why did I put HTTPException in there"
This reverts commit dc5cb990cb.
* Revert "[Trivia] Handle potential Discord errors in session."
This reverts commit d90e45f9e0.
* Handle Discord errors in _error_handler.
(cherry picked from commit 42edb12b2e)
Co-authored-by: PredaaA <46051820+PredaaA@users.noreply.github.com>
Co-authored-by: PredaaA <46051820+PredaaA@users.noreply.github.com>
* [Streams] Check non-existent streams more than once
- For YouTube streams, it seems like the RSS feed may sometimes return
an HTTP 404 for a channel, even though the channel exists.
- If this happens more than a few times, then we should declare the
stream as non-existent, and purge it from the list of streams we
check.
* [Streams] Move retry_count reset for YouTubeStream
- Reset after the RSS check, since that is the only place where we raise
StreamNotFound in that function.
* [Streams] Increase retry to 20
* [Streams] Reduce retry count to 10
(cherry picked from commit 36ea867dcf)
Co-authored-by: Lui <injabie3@gmail.com>
Co-authored-by: Lui <injabie3@gmail.com>
* Add test for presence of upper and lower bound on Python version
* [part 1/3] Test that this works, DO NOT MERGE
* [part 2/3] Test that this works, DO NOT MERGE
* [part 3/3] Revert unwanted changes, NOW YOU CAN MERGE!
(cherry picked from commit 6f0a8b11d7)
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Oh my gosh Kowlin is finishing work!?
* fix style
* use f-strings
* moar f-strings actually
* Fix style...
* I did a poor job of find-replacing things
* Improve code readability per previous Kowlin's style
* And reformat it in such a way that get jack through the day
* Okay maybe some whitespace
* Update core_commands.py
* Update core_commands.py
(cherry picked from commit 3b7f9e24b4)
Co-authored-by: Kowlin <Kowlin@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: Kowlin <Kowlin@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Force-disable Audio's Global API functionality
* Remove owner message about global API
* Two more comments
* Update CODEOWNERS
* Bring back the owner notification, modified to not mention global DB
* Remove the global api group fully, remove the mentions of it
* Since i have these uncommitted locally sharing...
* clean up
* clean up
* noone can figure out how my pycharm got into this state .. but hey ho.
* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
* We don't need this comment, we already include these in gitgnore anyway
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* [Modlog] Confirmation for resetting modlog cases
* We need to return there
* Update modlog.py
* style
* Update redbot/cogs/modlog/modlog.py
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* version bump
* - bump RLL
- logging changes
- player.channel.guild->player.guild
- small cleanup around logging changes
* missed one
* here this one too
* Apply suggestions from code review
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* add one missing player log
* missed one
* Format with Black
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Initial commit
* Add some args
* bool prolog
* index
* Add more arguments
* more arguments, style fixes
* improve naming of arguments
* Fix up backlog
* Run black
* extra corrections from backlog
* Update tempban arg names
* backlog
* change prolog type
* Change kick argument prolog to member instead of user
* Update argument names
* missed a colon
* Update prolog to be friendly with non-positional args
* Edit through the decorator instead
* Add back docstring spacing
* black
* usage in decorator for name commands
* Fix command signature
* fixup docstring spacing
* style fixes
* Add spacing inside unban docstring
* Rename args instead of using usage
* black - simple
* Add labeler glob
* unify style
* rename variables instead of usage
* Update docstrings correspondingly
* run black
* update description in usage
* ehh this isn't necessary...
* fix up tags
* fix grammar and accuracy issues
* fix docstring too
* This PR depends on Part 2 due to new store value
- cleanup of [p]volume
- a fix for infinite retrying
* update `[p]volume` help
* Update controller.py
* Update redbot/cogs/audio/core/commands/controller.py
meh still hardcoded in RLL .. will be removed in 0.9
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Update redbot/cogs/audio/core/commands/controller.py
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* [Docs] add `sudo systemctl disable` to Linux auto-restart docs
* [Docs] fix typo in Linux auto-restart docs
* [Docs] update Mac auto-restart docs
* [Docs] implement suggestions for Linux auto-restart docs
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* [Docs] update wording on Mac auto-restart docs
* [Docs] fix grammar in Linux auto-restart docs
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Core guide initial commit
* Mydata docstrings
* Regenerated docs
* Lots more docstrings
* Add document link
* Up to load docstrings
* Black formatting
* docstring semantics
* "cog packages" for loads
* Refix line lengths
* Regenerate docs
* Remove link
* Regenerate docs with new code
* Some small docstrings
* Regenerate docs with new .. warning code
* More docstrings into the `set` command
* Bullet lists need blank lines.
* Regenerate docs
* Regenerate docs (fix bullet lists)
* set activity statuses docstrings
* Docstrings up to helpset pagecharlimit
* Regenerate docs
* Core guide initial commit
* Mydata docstrings
* Regenerated docs
* Lots more docstrings
* Add document link
* Up to load docstrings
* Black formatting
* docstring semantics
* "cog packages" for loads
* Refix line lengths
* Regenerate docs
* Remove link
* Regenerate docs with new code
* Some small docstrings
* Regenerate docs with new .. warning code
* More docstrings into the `set` command
* Bullet lists need blank lines.
* Regenerate docs
* Regenerate docs (fix bullet lists)
* set activity statuses docstrings
* Docstrings up to helpset pagecharlimit
* Regenerate docs
* Maxpages and delete delay docstrings
* spagetthi ctrl+v
* tagline and contact
* A little more contact
* Up to allowlist
* Up to command defaultdisablecog
* Regenerate docs
* Redo custominfo to not be terrible
* Up to default enabled cog
* More docs
* Up to command disabledmsg
* Disabled message stuff was missed
* Finish the rest of the docstrings
* Regenerate docs
* Longer description of the cog
* Regenerate Docs
* Fix some of the suggestions
* Apply additional suggests and some small rewording.
* Regenerate docs.
* Apply suggestions and make additional fixes
* Regenerate docs
* Clarifies it's only loaded.
* Regenerate docs.
* New formatting, more examples, some fixes
* Regenerate docs
* Adds consistant use of dashes to arguments
* More consistant punctuation
* Regenerate docs
* Add labeler detection
* Fix example and use clearing language for helpset verifyexists docstring
* Regenerate docs
* Add leave example and arguments
* Regenerate docs
* Regenerate docs
* Make embedset more readable
(933aefd3ee was the sphinx compatible update)
* Regenerate docs
* Black formatting
* Regenerate docs
* Adds docstring examples and arguments for multiple `embedset` subcommands
* Regenerate docs
* Use partial messages in Streams cog to avoid leakage
* Stop trying to save bot object to Config...
* Put guild id as part of message data
* Fix AttributeError
* Pass bot object to stream classes in commands
* ugh
* Another place we use this class in
* more...
* Bump discord.py, but to the git version for now
* Import GuildConverter from d.py and deprecate our implementation
* Import PartialMessageConverter in our commands extension
* Use newly added `Cog.has_error_handler()` rather than private method
* Update snowflake regex to use 20 as max length
See Rapptz/discord.py#6501
* Use new supported way for custom cooldown buckets
* Include group args in command signature
* Update code to use `Client.close()` over `Client.logout()`
* Add StageChannelConverter and StoreChannelConverter
* Fix AttributeError in licenseinfo
* Prep for 0.7.2
* So What di i do here? I done Magic, magic only found in the tales of old.
* turns out formatting is something important
* fixes
* improved Error handling when Global API is enabled
* further improve resuming logic
* more of dat dark voodoo blood magic
* major tweaks to auto restore when auto play is enabled 👀
* fix duplicated "Auto play stated." message + Auto play restart :feelsgoodman:
* missed these
* fix the new duplicated fucking message bitch.
* Let discord handle player reconnects
* eh
* `Requires force install`, utilize new Exponential Backoff object on player and safer reconnect logic, emulating d.py and WL.
* hmmmmm gotta monitor
* mother fucking brackets
* Why didnt i consider this the first time?????????????
* new error code to handle?
* soooooooooooooooo these are import so why arent we ensuring they are set.
* improved logging
* improved logging
* aaaaaaaaaaaaaaa
* We need our own error and special handling to not conflict with dpy
* (Last Known Bug) Fix the infinite loop of 4006 that sometimes could happen as an edge case after a successful resume.
* This will require a force reinstall to install `RLL 0.8.0`, this properly fixes the bug mentioned on the previous commit.
* address "Localtrack names/paths need to be escaped." comment
* address Fixators crash mentioned in #AT
* style
* fix preda's crash mentioned in PR
* add a thing here add a thing there add a thing everywhere
* style
* fixes here, fixes there, and backbone for curated playlist.
* bypass aiohttp and githubs and cloudflare and yo mammas cache
* I propose the new style is no style.
* allow curated playlist to be updated it `[p]playlist update` and show the diff
* fix `[p]summon` not resuming playback until next track.
* Hopefully handle predas rate limits.
* what else did i break now
* Update Lavalink.jar build
* lets try this
* reset the queue
* Bring Edge commits over fix a bunch of shiz again
* Bring Edge commits over fix a bunch of shiz again
* Handle 4014 OPs, Change `skip_votes` key to be an int rather than guild object
* aaaaaaaaaaaaaaa im dumb
* ...
* Simplify some shiz + use a set instead of a list for votes.
Co-authored-by: aikaterna <20862007+aikaterna@users.noreply.github.com>
* Better user feedback during slow backend migrations
This uses a tqdm progress bar to keep the user updated on the progress of the migrations.
I didn't realise this was necessary until I did a migration from Mongo to Postgres on CASE, and it took quite a long time to complete, I started to doubt that it was actually making progress.
Also includes a utility to help with tqdm in slow asynchronous for-loops.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Make `async_tqdm` support async-for loops
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Reformat
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Remove unused method
* Remove quotes for the return type annotation
* Few style improvements
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Add per-command embed settings
* Update `[p]embedset showsettings`
* Use command.qualified_name in `[p]embedset` commands
* Fix the call to subcommand and simplify it
* And I oversimplified this
* Update end user messages to use 'guild' rather than 'server'
* meh
* This should be a named field
* Add check for Embed Links perm to confuse users a bit less
* Wrap this string in _()
* Let's use a different exception then...
* Let's clear the setting when we can in whole `[p]embedset`
* Add the order of checking to help of `[p]embedset`
* Add note about full evaluation order to subcommands
* [Cleanup] Handle missing message_id and reply
* Fix a new situation where we could end up with unwanted `None`
* I suck at this (style fix)
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* [Mutes] Add a note about conversion to schema_version 1
* Only start the conversion if all_channels
* Actually do what the previous commit said
* okay this time is the right time
* Update mutes.py
* Move conversion to its own method
* Update mutes.py
* ctx.invoke -> bot.invoke
ctx.message.guild -> ctx.guild
* remove the invoke stuff
* remove invoke stuff
* use id attrib instead of entire guild
* change type hinting too
* change second typehint
* [Mod] No longer loop through all guilds on check_tempban_expirations.
* Address Jack's review.
* I don't think this comment actually served any purpose
* Split this into more methods
* Small optimization for cases where the guild tempbans weren't updated
* Blackify
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Use sphinx-prompt extension
* Update PM2 guide
* Use an actual proper way to run Red with PM2
* Fix pm2 docs
Co-authored-by: Kowlin <Kowlin@users.noreply.github.com>
* add ✨ color ✨
* add color on line 315, fix line 340
* Black style
* fix color on line 341
* thanks jojo >_>
* dont need i18n here
* Black style again :D
* start
* Get user inside blocklist/allowlist lists
* Changes to cover unknown or deleted users
* Use square brackets for clarity
* Implement the above commit for all four versions
* Much improved UI, removed `[]` to fit new format
* updates to support roles in local version
* add /role to unknown str
* Improve variable names
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* [Mutes] Add guild ID to mutes data.
* Actually make the whole thing works.
* config version as integer, and init task no longer in setup
* oops
* Fix cog_disabled_in_guild check.
* Add Trusty's requested changes.
* [Docs] Use explicit name of the python packages for openSUSE Tumbleweed
* Add warning for Arch Linux instructions
Co-authored-by: Kowlin <Kowlin@users.noreply.github.com>
* Remove the unneeded pytest options from pyproject.toml
* Clean up setup.py from old readthedocs.org workaround
* Removes unused folder
* Simplify list of excluded files in black's configuration
* Fix returned exit codes in `make.ps1`
* Add Sublime's project files to `.gitignore`
* Update the link to Black in README and contributing guidelines
* [Docs] Images Cog Guide
* [Docs] Image Cog Guide
* Fixes for directory inside the index
* The cog is cakked IMAGE not IMAGES
* Potential fixes for failing checks
* Grammar fixes
* Some formatting updates
* Fix merge conflicts from 3.4.7
* Re-format for requested changes
* Add missing command to `make.bat`'s help
* Add `activateenv` and `deactivateenv` commands to `make.bat`
* Add help to `Makefile`
* Add `make.ps1` cmdlet
* Make workflow name use TitleCase
* Indicate in the PR description that it's a multi-part workflow
* Auto-put PRs from Prepare Release workflow in the proper milestone
* Rename "Publish the release" workflow to "Publish Release"
* Auto-put PR from Publish Release workflow in the proper milestone
* Clarify that the owner is a team.
* This should do.
* Style check... for a comma, in your dreams Tox...
* Annndddd for the insane people who don't use embeds
* [Mutes] Wrong error message when muting fails
* This applies to both mute and unmuting of members.
Co-authored-by: Kowlin <Kowlin@users.noreply.github.com>
* Alternative way of doing Crowdin...
* Limit the upload translations workflow to V3/develop
* Make the workflow close and reopen the PR automatically while I'm at it
* Add a workflow for preparing PRs for release
* Make the crowdin env vars local to the step requiring them
* Move dev bump to Publish Release workflow
* Add default settings for name tracking
* Add configuration command for name tracking
* Check the track names settings before tracking
* *grumble*
* Fix permissions levels
* Update settings.py
* Use clean_prefix in inline, and don't use f-strings in `_()`
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Merge selfrole and remove into one command
replacement pr
* docs
add to the docs
* Update admin.py
remove register name
* Update admin.rst
* Fixes
* Fix the duplicated command decorators
* Minimize the diff
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* add a time converter, as well as not allowing negative integers
* timedeltaconverter
* styling and unused imports
* update docstrings
* update param name to "duration" instead of seconds
* make timedelta default_unit seconds
* better descriptions & docstrings
* docs for updated paydaytime & slottime
* Fix style
* Few minor fixes
* Cast `total_seconds()` return type to `int`
* Fix one of my own issues
* Make the duration argument catch-rest for convenience
* One more fix for the docs
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Current/up to date answers regarding some hero's health and abilities
Added more options for "What does Tracer say when using her ultimate?"
Competitive point changes for Season 6+ on August 29, 2017 patch
Mercy's major rework on September 19, 2017 patch
Hanzo's major rework on May 3, 2018 patch
Symmetra's major rework on June 6, 2018 patch
"Offense" and "Defense" categories have been merged into "Damage" on June 26, 2018 patch
McCree's roll cooldown decreased on October 9, 2018 patch
Torbjorn's health changed on March 19, 2019 patch
Sombra's translocator cooldown increased on October 15, 2019 patch
Orisa's fortify cooldown decreased on December 10, 2019 patch
Ana's sleep dart duration decreased on April 29, 2020 patch
Orisa's health changed on September 24, 2020 patch
McCree and Widowmaker's health changed on October 29, 2020 patch
Reinhardt's health changed on December 10, 2020 patch
Removed "What was the name of the Lunar New Year themed event in Overwatch?:" since this changes every year.
* [Utils] Additional chat formatting functions
* [Utils] Updated docstrings to unify with other docstrings
* [Utils] Spoiler feature for chat_formatting
* Fixes for black style
Co-authored-by: kreusada <67752638+kreus7@users.noreply.github.com>
* Use Rich's default console object instead of making one
* Bump Rich to version 9.8.2
* Disable indent guides in tracebacks
* Skip empty lines between stack levels in traceback rendering
* Use full width of the terminal when printing tracebacks
* Disabling syntax highlighting on the log messages
* Make logger name bold
* Make logger level bold
* Make URLs in console bold
* Change `bright_blue` and `blue` colors in syntax theme (NEEDS CHANGING)
* Show only one line per stack level in tracebacks
* Shuffle things in `redbot.logging` a bit
* Change logging handler while redirecting stdout in Dev cog
* Revert last two commits...
This reverts commit cf563bd06a6ae398da12713ceef3db9cc903d902.
This reverts commit 6dddf300726ddf89b8924441eed59b67b58faca0.
* Change Rich console to always print to sys.stdout (therefore ignoring stdout redirects)
* Pass cli_flags to init_logging()
* Add a flag to set the amount of extra lines in rich tracebacks
* First take on the syntax theme colors
* Use the Windows trick
* ARE YOU SERIOUS!?
* Remove dead code
* Use Monokai when Terminal application supports truecolor
* Syntax theme update
* Change logger name color
* This is not needed
* Adjust logging level colors
* Add a flag for showing local variables in Rich tracebacks
* change imports a bit
* Remove usage of blue color fully
* Stop highlighting in Red-DiscordBot splash
* Fix unreadable paths in tracebacks
* Make CRITICAL logging level more readable
* Make time in logs more readable
* Fix the first row being bolded in tables
* Update rich to 9.9.0
* Oh boy! more issue templates!
* Add some descriptions to command_bug.yml
* Update enhancements.yml to refer to "components" since one might want to request API enhancement
* Update feature_request.yml
* Update command_bug.yml
* typo
* I don't think this would cause any issue but I would rather not need another PR
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Revert "Cut the list in half (#4781)"
This reverts commit 9737c1b5eb.
* Story likes to repeat itself
Yet again, Kowlin makes a small mistake that ends up with us making shitton of commits
* Lets try this new fancy thing
* Rename command_bug.md to command_bug.yml
* Update command_bug.yml
* Cog name before command name, thank you
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Bump d.py, aiohttp, Red-Lavalink
* Remove deprecation warnings that are no longer relevant
* Max concurrency things in `Command.prepare()`
* Two random things that date back to times older than d.py 1.1...
* [Core] Fix commands using plural with the same user
Some plural checking have also been added to the local blocklist/allowlist and the wording has been revised.
* AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
* BLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACK
* the
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Docs: added brackets escape note for Linux/macOS installation
* Corrected punctuation for bracket escaping note
* Use quotes - those work on cmd, bash, zsh, and probably other shells
* Minimize the diff
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* better explain on how to use.
* i.... dont know why i removed that dot.
* don't think that was meant to
* Update kickban.py
* smh
* style????
* hm?
* last try to fix style......
i dont even know how to do this :/
* failing style is fun, trynna learn.
* .....
* not the best way but lets try?
* yep, didnt work dropping softban.
* Update kickban.py
* grammar fix
* Add non-generic message when loading a cog with command name that is already registered
* Use regex instead and add i18n support
* This requires d.py 1.4
* handle manual mutes/unmutes
Doing this in the Web-Editor is painful. Let's switch to VSC.
* embed version
* non embed
* config stuff
* testing done
* wow black
* Few things before I start local testing
* Fix new lines
* Make messages not depend on modlog
* Yay voicemutes
* black+import
* what is your ducking problem vscode
* adress review
* this is driving me mad
* Check the config in `_send_dm_notification` to avoid code repetition
* Fix incorrect type hints
* Remove no longer needed line changes
* Remove unused function
* Update the type hints from commit 946299 in the MixinMeta too
* Fixed wrong variable being passed to the method and ensure DMs aren't sent when we couldn't get the member object
* They call me dumb for a reason
* Stop overriding variable with duration + various formatting tweaks
* :(
* We need to differ between voice and text in two places, interesting...
* Show info about no reason provided in embed
* Apparently, the `reason` can also be an empty string :|
* Update redbot/cogs/mutes/mutes.py
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Make the dev env flexible
* Fix rst format in docstrings
* Reproduce current behaviour for _ in repl
* Prevent adding existing or reserved names
* Fix typo with environment
* Docstring changes
Apply suggestions from code review
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Get env before loop
* Hey I'm not the only one doing typos
* Keep new messages in env
* Clear exception of stack frames
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Include the `channel` variable in the reserved names
* And we're also missing `discord` :)
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Update help.py
* Create 3040.enhance.rst
* remove towncrier entry
* Make it i18n friendly.
* That was uneeded to change this actually.
* ...
* ..
* .
* Add a setting for aliases.
* DOTS
* Update redbot/core/core_commands.py
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Address requested changes maybe
* New format + changes requested.
* okay we'll get there someday
* honk
* aaaaaaaaaaaaaaa
* Black
* Fix missing humanize_timedelta import.
* style
* Two things from my very old pending review, see commit desc
```py
valid_alias_list = [
af
for a in aliases
if (af := f"{a}")
and len(af) < 500
and ((a_counter + len(af)) < 500)
and (a_counter := a_counter + len(af))
]
```
^ This can be simplified:
```suggestion
valid_alias_list = [
alias
for alias in aliases
if (a_counter := a_counter + len(alias)) < 500
]
```
Although I think it would be somewhat clearer to use a `for` loop rather than a list comprehension (+ we can just `break` when there's not gonna be another alias that could fit in the list since it's sorted):
```suggestion
valid_alias_list = []
for alias in aliases:
if (a_counter := a_counter + len(alias)) < 500:
valid_alias_list.append(alias)
else:
break
```
* style *again*
* use qualified name of the parent command
* meh
* another meh
* Revert the last commit...
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* [Streams] Remove the blank suppression of errors
* Okay, maybe do gracefully handle it a little bit...
* Update redbot/cogs/streams/streams.py
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* update image
* MAXIMISE THE QUALITY
* add storage driver as JSON (#3935)
* fk
* REEEE
how am i faling to use git so much
* rich!
* make image width 696 pixels so it doesn't scale
* Pop stash
* add rich to setup
* Added forceful enabling of rich logging
* revert some unintended pushed
* Fix possible unbound var
Fix possible 0 members w/out members intent
* One day I won't forget to do style passes
* So this is a thing apperently...
* Bump rich to 9.5.1
* Lock secondary deps
* Different stuff, see the full commit description for more info
- Change few things from print to log.info
- put the log handlers on the root logger instead of individual loggers
- capture warnings to a logger
* Modify log handler to show logger name
* Add a Triboolian to force disable rich
* Style checks
* shortened time, added logger name... again.
* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
* Style & linking
* Be or not to be? Whatever man, it's 4:30 in the morning, goto sleep >.<
* Reintroduce outdated message.
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Update CodeQL to resolve warnings.
* Make CodeQL analyze our Python dependencies
* `fetch-depth` should be no longer needed
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* [Mod] Check for reason length & remove unused vars
This PR also remove unused variable.
* Blame me
* Apply Kowlin order.
Text will get truncate in audit logs in case we're going over 512 characters.
* This is already handled by ban_user()
* Use `get_audit_reason()` in `[p]tempban`
* Add a new kwarg to `get_audit_reason()` instead
* Include `[p]voiceban` and `[p]voiceunban`
* Include Mutes cog
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Make command usage in help for required arguments consistent
* Bob 3
* Bob 1
* Docstring updates
* Address Flame's review
* Update cog guides in docs
* Properly handle slotmin/slotmax rules
* Use a variable to reduce config calls. No reason to process differently half way through a command anyways.
* Update redbot/cogs/economy/economy.py
* Add positive int converter for slotmin/slotmax
* Option to allow bad mins and maxes.
* Update economy.py
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Resolve bug with [p]streamalert youtube
The command didn't handle channels that were not provided as IDs
* Provide a different message if the scheduled date has passed
* Ignore streams scheduled for more than an hour
* General geography category :D
* Fixes
* Fixed typo
* Added some more questions
* Made some changes, and accuracy fixes, corrections
* *state, not actual river
* Started docstrings
* Add to index
* First generated guide
* Indented examples, some more docstrings
* Aliases are now `in ticks and fully qualified`
* More economy docstrings
* Started docstrings
* Add to index
* First generated guide
* Indented examples, some more docstrings
* Aliases are now `in ticks and fully qualified`
* More economy docstrings
* Regenerate docs
* Much more docstrings and regenerate docs
* Better explaination of `bank set` and grammar changes
* Regenerate docs
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Catch scheduled livestreams
* Announce scheduled streams and starts
* Add setting, fix bugs
* Add new dependency
* Black reformat
* Fix the duplicated messages bug
* Do not send messages for schedules
* Format embed
* Getting started guide
* Remove DigitalOcean referral link
* Fix typos and mispells, thanks to @Flame442
* Remove cogs.red hyperlink until it is finished
* Add towncrier entry
* Add prolog.txt
This is not necessary for this PR but all of the other cog guides rely on this file.
The cog guides are individual branches based on this one, which is why I'm adding this file right now.
* Add changelog entry
* Add CogManagerUI guide
* Remove towncrier
* CogManagerUI update
* Apply suggestions from code review
Co-authored-by: Vexed <sebdazeley@gmail.com>
* Apply suggestions from code review
Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
* Add section for downloader
Co-authored-by: Toby Harradine <Tobotimus@users.noreply.github.com>
Co-authored-by: Vexed <sebdazeley@gmail.com>
Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
* Add to index, url matching links, and add link to customcommands.rst
* Some docstring rewriting
* Adding arguments and more details.
* Handle aliases, rest of arguments and examples.
* Black formatting
* Switch to alphabetical
* Apparently forgot to regenerate this.
* Update redbot/cogs/customcom/customcom.py
Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
* Update docs/cog_guides/customcommands.rst
Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
* [Streams] Remove the `__del__`
* Add a teardown function to call Streams.cog_unload()
* Apparently I forgot cog_unload is called automatically (Thanks @rapptz
lol)
Co-authored-by: palmtree5 <3577255+palmtree5@users.noreply.github.com>
* Autogenerated doc and index spot
* Update command descriptions
* Use qualified name in titles and new command descriptions
* Add arguments to descriptions and cleanup self examples.
* Examples are bulleted and indented.
* Handle aliases (none), examples are bulleted and indented
* Switch to alphabetical
* Fix X typo
* add 2 get_or_fetch methods
* style
* local tox didnt scream and blow up
* ewh extra space is ugly
* Jack meant this
* I think jack wanted this.
* Nope Jack desired this
* aaaaaaaaaaaaa Jack just say you are reviewing it come on
* add get_or_fetch_member
* Update redbot/core/bot.py
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Wubba Lubba Dub Dub
* woa!! this one was really HARD! (sweats)
* fiiiiire
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* New stuff from RLL 0.7.0
* discard here
* formatting
* do this properly
* make it more unique
* bump RLL
* nuke `[p]llset restport`, only `[p]llset wsport` matters
* Update setup.cfg
* properly deprecate Rest port and Ensure Nodes are properly closed upon running LLSET commands
* restore player on a attempt reconnect
* restore player as a task
* ensure we send the signal only if not playing.
* register events a little earlier
* hmmm
* ffs
* update application.yml
* fix permissions edge case
* Remove use of asyncio.gather
* black
* typo
* lol 1 character difference
* Let's try this instead
* another typo, it's too early to read
* Add max concurrency on makerole command and prevent multiple roles being added created
* Add Hockey Trivia
* Add more questions and address review
* cleanup authors for now
* Add missing authors
* address vexed's review
* new trivia
* Add New Jersey Devils Trivia
* Add Vancouver Canucks Trivia
* Address Flame's grammar review
do commit messages require proper grammar?
* revert the revert the revert git is hard...
* and remove old mutes
* make voicemutes less yelly
* fix error when no args present in mute commands
* update docstrings
* address review
* black
* oops
* fix voicemutes
* remove mutes.py file
* Remove _voice_perm_check from mod since it's now in mutes cog
* remove naive datetimes
prevent muting the bot
prevent muting yourself
fix error message when lots of channels are present
* change alias for channelunmute
Be more verbose for creating default mute role
* add `[p]activemutes` to show current mutes in the server and time remaining on the mutes
* improve resolution of unmute time
* black
* Show indefinite mutes in activemutes and only show the current servers mutes in activemutes
* replace message.created_at with timezone aware timezone
* remove "server" from activemutes to clean up look since channelmutes will show channel
* better cache management, add tracking for manual muted role removal in the cache and modlog cases
* Fix keyerror in mutes command when unsuccessful mutes
* add typing indicator and improve config settings
* flake8 issue
* add one time message when attempting to mute without a role set, consume rate limits across channels for overwrite mutes
* Don't clear the whole guilds settings when a mute is finished. Optimize server mutes to better handle migration to API method later. Fix typehints.
* Utilize usage to make converter make more sense
* remove decorator permission checks and fix doc strings
* handle role changes better
* More sanely handle channel mutes return and improve failed mutes dialogue. Re-enable task cleaner. Reduce wait time to improve resolution of mute time.
* Handle re-mute on leave properly
* fix unbound error in overwrites mute
* revert the revert the revert git is hard...
* and remove old mutes
* make voicemutes less yelly
* fix error when no args present in mute commands
* update docstrings
* address review
* black
* oops
* fix voicemutes
* Remove _voice_perm_check from mod since it's now in mutes cog
* remove naive datetimes
prevent muting the bot
prevent muting yourself
fix error message when lots of channels are present
* change alias for channelunmute
Be more verbose for creating default mute role
* add `[p]activemutes` to show current mutes in the server and time remaining on the mutes
* improve resolution of unmute time
* black
* Show indefinite mutes in activemutes and only show the current servers mutes in activemutes
* replace message.created_at with timezone aware timezone
* remove "server" from activemutes to clean up look since channelmutes will show channel
* better cache management, add tracking for manual muted role removal in the cache and modlog cases
* Fix keyerror in mutes command when unsuccessful mutes
* add typing indicator and improve config settings
* flake8 issue
* add one time message when attempting to mute without a role set, consume rate limits across channels for overwrite mutes
* Don't clear the whole guilds settings when a mute is finished. Optimize server mutes to better handle migration to API method later. Fix typehints.
* Utilize usage to make converter make more sense
* remove decorator permission checks and fix doc strings
* handle role changes better
* More sanely handle channel mutes return and improve failed mutes dialogue. Re-enable task cleaner. Reduce wait time to improve resolution of mute time.
* Handle re-mute on leave properly
* fix unbound error in overwrites mute
* remove mutes.pt
* remove reliance on mods is_allowed_by_hierarchy since we don't have a setting to control that anyways inside this.
* black
* fix hierarchy check
* wtf
* Cache mute roles for large bots
* fix lint
* fix this error
* Address review 1
* lint
* fix string i18n issue
* remove unused typing.Coroutine import and fix i18n again
* missed this docstring
* Put voiceban and voiceunban back in mod where it's more appropriate
* Address review 2 electric boogaloo
* Make voicemutes use same methods as channel mute
* black
* handle humanize_list doesn't accept generators
* update voicemutes docstrings
* make voiceperm check consistent with rest of error handling
* bleh
* fix modlog case spam when overrides are in place
* <a:pandaexplode:639975629793787922>
* bleck
* use total_seconds() instead of a dict, sorry everyone already using this lmao
* <:excited:474074780887285776> This should be everything
* black
* fix the things
* bleh
* more cleanup
* lmao hang on
* fix voice mutes thingy
* Title Case Permissions
* oh I see
* I'm running out of funny one-liners for commit messages
* oof
* ugh
* let's try this
* voicemutes manage_permissions
* Cleanup mutes if they expire when member is not present
* black
* linters go brr
Co-authored-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* handles #4491
* add typing indicators to audio playlists commands like discussed with aika.
* recheck perms upon change of token to avoid needing a reload.
* Ensure the player lock is always released... on rewrite to this as a callback to the task.
* ffs
* resolves#4495
* missed one
* aaaaaaaaa
* fix https://canary.discord.com/channels/133049272517001216/387398816317440000/766711707921678396
* some tweaks
* Clear errors to users around YouTube Quota
* Fix cleanup self not working in private.
This fix#4408.
* Apply Jack's logic.
* Obviously Black fault.
AGAIN!
* Apply Jack's trick.
* This is not a converter so let's move this to a different file
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* handle verified bots, and more specific errors
* stuff
* fuck, I forgot
* Improve errors by splitting into few different messages
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* ban revamp
* black & converters fix
* discord.object
* Update redbot/cogs/admin/admin.py
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* remove discord.user converter
* black
* .
* Update redbot/cogs/mod/kickban.py
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Update redbot/cogs/mod/kickban.py
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Update redbot/cogs/mod/kickban.py
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Update redbot/cogs/mod/kickban.py
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* incomplete
* massban support
* black
* Use 2-tuple to separate result and the message in `ban_user()`
This also fixes the issue with `True` being equal to `1` which caused a problem with previously returned types
* Whoops...
* trailing whitespace...
* I missed this one
* Update kickban.py
* Update kickban.py
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* First commit - Bring everything from dev cog minus NSFW support
* Add a toggle for auto deafen
* Add a one off Send to Owners
* aaaaaaa
* Update this to ensure `get_perms` is not called if the API is disabled
* Apply suggestions from code review
Co-authored-by: Vuks <51289041+Vuks69@users.noreply.github.com>
* silence any errors here (in case API is down so it doesnt affect audio)
* update the message to tell the mto join the Official Red server.
* remove useless sutff, and change dj check order to ensure bot doesnt join VC for non DJ's
* ffs
* Update redbot/cogs/audio/core/tasks/startup.py
Co-authored-by: Twentysix <Twentysix26@users.noreply.github.com>
* Aikas Review
* Add #3995 in here
* update
* *sigh*
* lock behind owner
* to help with debugging
* Revert "to help with debugging"
This reverts commit 8cbf17be
* resolve last review
Co-authored-by: Vuks <51289041+Vuks69@users.noreply.github.com>
Co-authored-by: Twentysix <Twentysix26@users.noreply.github.com>
* [Core] Pagify cog unload output properly
When you unload a large amount of cogs (close to message limit on characters), the character count is easily pushed over 2k characters on the command response with the cog names each being wrapped in 2x backticks. The current implementation breaks in the middle of cog names or wherever else it feels like it. 1600 might have been a safe value for splitting but at 1500 I don't see how multiple short cog names could make it break at least.
* Address review
* add an `[all]` extras_requires
* can go here
* add a [dev] which includes [all] + development extras (style, test, docs)
* special case all and dev in update message
* Optimize by changing the place of the check for "special" extras
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* add get_shared_api_keys
* add set listapi command
* fix typo
* refactor `[p]set listapi` into `[p]set api list`
* remove unnecessary check
* fix decorators
* corrected wording
* add remove_shared_api_services
* add `set api remove`
* further typo sniping
* bugsniping
* minor typo
* aaaaaaaaa
* Apply suggestions from code review
Co-authored-by: Draper <27962761+Drapersniper@users.noreply.github.com>
* update api docstring to reflect new subcommands
* Apply suggestions from code review
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* update framework_apikeys.rst with new methods
* Update redbot/core/bot.py
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* rewrite get_shared_api_services into a special case of
get_shared_api_tokens
* rewrite api_list to include keys and tokens in response
* don't show secrets
* better api_remove response
* black
* remove nonexistent method
* remove unnecessary import
* fix wording
* Improve docstrings and type hints
- added overloads to help out developers a bit more
* this wasn't necessary, but development tools work better
with this information
- fixed type hint to use Union as now
its return type depends on whether `service_name` is passed
- updated docstrings to contain information about the added behavior
* Use `humanize_list()` rather than `str.join()`
This is done for consistency within Red
and it makes the list have the last element joined
with `and` (or its equivalent in chosen locale)
* Use `.format()` after translation is applied
If `.format()` is used before `_()`, the search for translation is done
with the string that already has the dynamic text added,
which results in no matches.
* Add plural support
* Improve error message
Updated message to be more specific
(used phrases: "None of the services" and "had any keys set")
and a bit more nice to the user (judging word "anyway" removed)
* Improve readability of `[p]set api list`
It's a lot clearer when the sublists are indented,
especially on mobile where code blocks aren't colored at all.
New look:
https://user-images.githubusercontent.com/6032823/94614944-3bbd7c80-02a7-11eb-89e4-64bdf06c650b.png
Co-authored-by: Draper <27962761+Drapersniper@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Account for duplicated mentions
* Spelling fix + Wording change
* Requested changes *hopefully*
* forgot to formattttttttttttttttttttttt
* Improve the consistency with existing commands in inconsistent `[p]modset` group
* What was the point of defining `guild` if you didn't end up using it, Jack!?
* I hate you, web editor ಠ益ಠ
* You could have just copy-pasted this Jack, seriously...
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* [Modlog] Fix typehints for create_case
* Simplify Logic after review
* discord.abc.User to catch both member and user objects and other potential discord.Object's being sent
* fix typehints and Case.edit()
* fix docstrings in create_case
* Add note about last_known_username
* fix the weird thing that scared me
* URL encode user input in the general cog
Adds URL encoding to `[p]lmgtfy` via `urllib2.parse.quote_plus()`
and to `[p]urban` via `aiohttp.ClientSession.get`'s `params` argument
* Black reformatting
* Update CODEOWNERS
* Prepend with backslash, add downloader fixtures
* Update CODEOWNERS
* Schemas are closely related to Downloader...
...so I should know about the changes to those.
* Would be nice to add my name (thanks Draper)
* JSON schemas for cogs and repos
* newline at the end
* capitalization
* Remove *.json from .gitignore
* Remove empty line
* resolve requested changes
* resolve requested changes, again
Co-authored-by: Fixator10 <fixator10@users.noreply.github.com>
@@ -42,7 +42,7 @@ Unsure of how to get started contributing to Red? Please take a look at the Issu
* 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)
**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://app.egghead.io/playlists/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!
@@ -83,7 +83,7 @@ We're using [tox](https://github.com/tox-dev/tox) to run all of our tests. It's
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`)
- Ensures that the code meets our style guide with [black](https://github.com/psf/black) (test environment `style`)
To run all of these tests, just run the command `tox` in the project directory.
@@ -92,9 +92,9 @@ To run a subset of these tests, use the command `tox -e <env>`, where `<env>` is
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.
Our style checker of choice, [black](https://github.com/psf/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>`.
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/psf/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:
@@ -104,14 +107,14 @@ plugins directly from Discord! A few examples are:
- AniList
- And much, much more!
Feel free to take a [peek](https://cogboard.red/t/approved-repositories/210) at a list of
Feel free to take a [peek](https://index.discord.red) at a list of
available 3rd party cogs!
# Join the community!
**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,
[find](https://index.discord.red) 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!
@@ -128,4 +131,4 @@ Artwork created by [Sinlaire](https://sinlaire.deviantart.com/) on Deviant Art f
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.
A copy of this license can be found in the [discord-ext-menus.LICENSE](redbot/vendored/discord-ext-menus.LICENSE) file in the [redbot/vendored](redbot/vendored) folder of this repository.
..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:
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.
@@ -65,20 +69,34 @@ Starting and enabling the service
To start the bot, run the service and add the instance name after the **@**:
:code:`sudo systemctl start red@instancename`
..prompt:: bash
sudo systemctl start red@instancename
To set the bot to start on boot, you must enable the service, again adding the instance name after the **@**:
:code:`sudo systemctl enable red@instancename`
..prompt:: bash
sudo systemctl enable red@instancename
If you need to shutdown the bot, you can use the ``[p]shutdown`` command or
type the following command in the terminal, still by adding the instance name after the **@**:
:code:`sudo systemctl stop red@instancename`
..prompt:: bash
sudo systemctl stop red@instancename
..warning:: If the service doesn't stop in the next 10 seconds, the process is killed.
Check your logs to know the cause of the error that prevents the shutdown.
To view Red’s log, you can acccess through journalctl:
To set the bot to not start on boot anymore, you must disable the service by running the following command, adding the instance name after the **@**:
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.
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.
Remember that :ref:`we do not support public bots <intents>`. We encourage you to read that page before scaling up your bot.
*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>`_.
- 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 overriden by Permissions cog (:issue:`3672`, :issue:`3233`)
- 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`)
@@ -650,7 +650,7 @@ Dev Cog
Documentation changes
---------------------
- Fixed install instructions for Mac in `install_linux_mac` (:issue:`3675`, :issue:`3436`)
- Fixed install instructions for 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`)
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.
This is the cog guide for the downloader 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 downloader
.._downloader-usage:
-----
Usage
-----
Install community cogs made by Cog Creators.
Community cogs, also called third party cogs, are not included
in the default Red install.
Community cogs come in repositories. Repos are a group of cogs
you can install. You always need to add the creator's repository
using the ``[p]repo`` command before you can install one or more
cogs from the creator.
.._downloader-commands:
--------
Commands
--------
.._downloader-command-cog:
^^^
cog
^^^
..note:: |owner-lock|
**Syntax**
..code-block::none
[p]cog
**Description**
Base command for cog installation management commands.
.._downloader-command-cog-checkforupdates:
"""""""""""""""""""
cog checkforupdates
"""""""""""""""""""
**Syntax**
..code-block::none
[p]cog checkforupdates
**Description**
Check for available cog updates (including pinned cogs).
This command doesn't update cogs, it only checks for updates.
Use ``[p]cog update`` to update cogs.
.._downloader-command-cog-info:
""""""""
cog info
""""""""
**Syntax**
..code-block::none
[p]cog info <repo> <cog>
**Description**
List information about a single cog.
Example:
- ``[p]cog info 26-Cogs defender``
**Arguments**
-``<repo>`` The repo to get cog info from.
-``<cog>`` The cog to get info on.
.._downloader-command-cog-install:
"""""""""""
cog install
"""""""""""
**Syntax**
..code-block::none
[p]cog install <repo> <cogs...>
**Description**
Install a cog from the given repo.
Examples:
- ``[p]cog install 26-Cogs defender``
- ``[p]cog install Laggrons-Dumb-Cogs say roleinvite``
**Arguments**
-``<repo>`` The name of the repo to install cogs from.
-``<cogs...>`` The cog or cogs to install.
.._downloader-command-cog-installversion:
""""""""""""""""""
cog installversion
""""""""""""""""""
**Syntax**
..code-block::none
[p]cog installversion <repo> <revision> <cogs...>
**Description**
Install a cog from the specified revision of given repo.
Revisions are "commit ids" that point to the point in the code when a specific change was made.
The latest revision can be found in the URL bar for any GitHub repo by `pressing "y" on that repo <https://docs.github.com/en/free-pro-team@latest/github/managing-files-in-a-repository/getting-permanent-links-to-files#press-y-to-permalink-to-a-file-in-a-specific-commit>`_.
Older revisions can be found in the URL bar by `viewing the commit history of any repo <https://cdn.discordapp.com/attachments/133251234164375552/775760247787749406/unknown.png>`_
This is the cog guide for the filter 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 filter
.._filter-usage:
-----
Usage
-----
This cog is designed for "filtering" unwanted words and phrases from a server.
It provides tools to manage a list of words or sentences, and to customize automatic actions to be taken against users who use those words in channels or in their name/nickname.
This can be used to prevent inappropriate language, off-topic discussions, invite links, and more.
.._filter-commands:
--------
Commands
--------
.._filter-command-filter:
^^^^^^
filter
^^^^^^
..note:: |mod-lock|
**Syntax**
..code-block::none
[p]filter
**Description**
Base command to add or remove words from the server filter.
Use double quotes to add or remove sentences.
.._filter-command-filter-add:
""""""""""
filter add
""""""""""
**Syntax**
..code-block::none
[p]filter add [words...]
**Description**
Add words to the filter.
Use double quotes to add sentences.
Examples:
- ``[p]filter add word1 word2 word3``
- ``[p]filter add "This is a sentence"``
**Arguments:**
-``[words...]`` The words or sentences to filter.
.._filter-command-filter-channel:
""""""""""""""
filter channel
""""""""""""""
**Syntax**
..code-block::none
[p]filter channel
**Description**
Base command to add or remove words from the channel filter.
Use double quotes to add or remove sentences.
.._filter-command-filter-channel-add:
""""""""""""""""""
filter channel add
""""""""""""""""""
**Syntax**
..code-block::none
[p]filter channel add [words...]
**Description**
Add words to the filter.
Use double quotes to add sentences.
Examples:
- ``[p]filter channel add word1 word2 word3``
- ``[p]filter channel add "This is a sentence"``
**Arguments:**
-``[words...]`` The words or sentences to filter.
.._filter-command-filter-channel-clear:
""""""""""""""""""""
filter channel clear
""""""""""""""""""""
**Syntax**
..code-block::none
[p]filter channel clear
**Description**
Clears this channel's filter list.
.._filter-command-filter-channel-list:
"""""""""""""""""""
filter channel list
"""""""""""""""""""
**Syntax**
..code-block::none
[p]filter channel list
**Description**
Send a list of the channel's filtered words.
.._filter-command-filter-channel-remove:
"""""""""""""""""""""
filter channel remove
"""""""""""""""""""""
**Syntax**
..code-block::none
[p]filter channel remove [words...]
**Description**
Remove words from the filter.
Use double quotes to remove sentences.
Examples:
- ``[p]filter channel remove word1 word2 word3``
- ``[p]filter channel remove "This is a sentence"``
**Arguments:**
-``[words...]`` The words or sentences to no longer filter.
..note:: To use this cog, load it by typing this::
[p]load mod
.._mod-usage:
-----
Usage
-----
A range of highly customizable moderation tools used to protect your
guild from users who cannot follow the rules.
.._mod-commands:
--------
Commands
--------
.._mod-command-ban:
^^^
ban
^^^
..note:: |admin-lock|
**Syntax**
..code-block::none
[p]ban <user> [days] [reason]
**Description**
Ban a user from this server and optionally delete days of messages.
``days`` is the amount of days of messages to cleanup on ban.
**Arguments**
*``<user>``: The user to ban. |user-input|
*``[days]``: The amount of days of messages to cleanup on ban. This parameter defaults to the defaultdays setting, or no days if this has not yet been configured.
*``[reason]``: The reason why the user was banned (optional).
**Example Usage**
*``[p]ban 428675506947227648 7 Continued to spam after told to stop.``
This will ban the user with ID 428675506947227648 and it will delete 7 days worth of messages.
*``[p]ban @Twentysix 7 Continued to spam after told to stop.``
This will ban Twentysix and it will delete 7 days worth of messages.
A user ID should be provided if the user is not a member of this server.
If days is not a number, it's treated as the first word of the reason.
Minimum 0 days, maximum 7. If not specified, the defaultdays setting will be used instead.
.._mod-command-kick:
^^^^
kick
^^^^
..note:: |admin-lock|
**Syntax**
..code-block::none
[p]kick <member> [reason]
**Description**
Kick a user.
**Arguments**
*``<member>``: The member to kick. |member-input|
*``[reason]``: The reason why the user was kicked (optional).
**Example Usage**
*``[p]kick 428675506947227648 wanted to be kicked.``
This will kick the user with ID 428675506947227648 from the server.
*``[p]kick @Twentysix wanted to be kicked.``
This will kick Twentysix from the server.
If a reason is specified, it will be the reason that shows up
in the audit log.
.._mod-command-massban:
^^^^^^^
massban
^^^^^^^
..note:: |admin-lock|
**Syntax**
..code-block::none
[p]massban <user_ids...> [days] [reason]
..tip:: Alias: ``hackban``
**Description**
Mass bans user(s) from the server.
**Arguments**
*``<user_ids...>``: The users to ban. This must be a list of user IDs separated by spaces.
*``[days]``: The amount of days of messages to cleanup on massban.
*``[reason]``: The reason why these users were banned.
**Example Usage**
*``[p]massban 345628097929936898 57287406247743488 7 they broke all rules.``
This will ban all the added userids and delete 7 days worth of their messages.
.._mod-command-modset:
^^^^^^
modset
^^^^^^
..note:: |guildowner-lock|
**Syntax**
..code-block::none
[p]modset
**Description**
Manage server administration settings.
.._mod-command-modset-defaultdays:
""""""""""""""""""
modset defaultdays
""""""""""""""""""
**Syntax**
..code-block::none
[p]modset defaultdays [days=0]
**Description**
Set the default number of days worth of messages to be deleted when a user is banned.
The number of days must be between 0 and 7.
**Arguments**
*``[days=0]``: The default number of days of messages to be deleted when a user is banned.
..note:: This value must be between 0 and 7.
.._mod-command-modset-defaultduration:
""""""""""""""""""""""
modset defaultduration
""""""""""""""""""""""
**Syntax**
..code-block::none
[p]modset defaultduration <duration>
**Description**
Set the default time to be used when a user is tempbanned.
Accepts: seconds, minutes, hours, days, weeks
**Arguments**
*``<duration>``: The default duration for when a user is temporarily banned. Accepts seconds, minutes, hours, days or weeks.
**Example Usage**
*``[p]modset defaultduration 7d12h10m``
*``[p]modset defaultduration 7 days 12 hours 10 minutes``
.._mod-command-modset-deletenames:
""""""""""""""""""
modset deletenames
""""""""""""""""""
..note:: |owner-lock|
**Syntax**
..code-block::none
[p]modset deletenames [confirmation=False]
**Description**
Delete all stored usernames and nicknames.
**Arguments**
-``<confirmation>``: Whether to delete all stored usernames and nicknames. |bool-input|
.._mod-command-modset-deleterepeats:
""""""""""""""""""""
modset deleterepeats
""""""""""""""""""""
**Syntax**
..code-block::none
[p]modset deleterepeats [repeats]
**Description**
Enable auto-deletion of repeated messages.
**Arguments**
*``[repeats]``: The number of repeated messages needed before further messages are deleted.
..note:: Must be between 2 and 20. Set to -1 to disable this feature.
.._mod-command-modset-dm:
"""""""""
modset dm
"""""""""
**Syntax**
..code-block::none
[p]modset dm [enabled]
**Description**
Toggle whether a message should be sent to a user when they are kicked/banned.
If this option is enabled, the bot will attempt to DM the user with the guild name
and reason as to why they were kicked/banned.
**Arguments**
*``[enabled]``: Whether a message should be sent to a user when they are kicked/banned. |bool-input|
.._mod-command-modset-hierarchy:
""""""""""""""""
modset hierarchy
""""""""""""""""
**Syntax**
..code-block::none
[p]modset hierarchy
**Description**
Toggle role hierarchy check for mods and admins.
..warning:: Disabling this setting will allow mods to take actions on users above them in the role hierarchy!
This is enabled by default.
.._mod-command-modset-mentionspam:
""""""""""""""""""
modset mentionspam
""""""""""""""""""
**Syntax**
..code-block::none
[p]modset mentionspam
**Description**
Manage the automoderation settings for mentionspam.
.._mod-command-modset-mentionspam-ban:
""""""""""""""""""""""
modset mentionspam ban
""""""""""""""""""""""
**Syntax**
..code-block::none
[p]modset mentionspam ban <max_mentions>
**Description**
Set the autoban conditions for mention spam.
Users will be banned if they send any message which contains more than
``<max_mentions>`` mentions.
**Arguments**
*``<max_mentions>``: Must be 0 or greater. Set to 0 to disable this feature.
.._mod-command-modset-mentionspam-kick:
"""""""""""""""""""""""
modset mentionspam kick
"""""""""""""""""""""""
**Syntax**
..code-block::none
[p]modset mentionspam kick <max_mentions>
**Description**
Set the autokick conditions for mention spam.
Users will be kicked if they send any message which contains more than
``<max_mentions>`` mentions.
**Arguments**
*``<max_mentions>``: Must be 0 or greater. Set to 0 to disable this feature.
.._mod-command-modset-mentionspam-strict:
"""""""""""""""""""""""""
modset mentionspam strict
"""""""""""""""""""""""""
**Syntax**
..code-block::none
[p]modset mentionspam strict [enabled]
**Description**
Setting to account for duplicate mentions.
If enabled all mentions will count including duplicated mentions.
If disabled only unique mentions will count.
Use this command without any parameter to see the current setting.
**Arguments**
*``[enabled]``: Whether all mentions will count, including duplicated mentions. |bool-input|
.._mod-command-modset-mentionspam-warn:
"""""""""""""""""""""""
modset mentionspam warn
"""""""""""""""""""""""
**Syntax**
..code-block::none
[p]modset mentionspam warn <max_mentions>
**Description**
Sets the autowarn conditions for mention spam.
Users will be warned if they send any messages which contain more than
``<max_mentions>`` mentions.
**Arguments**
*``<max_mentions>``: Must be 0 or greater. Set to 0 to disable this feature.
.._mod-command-modset-reinvite:
"""""""""""""""
modset reinvite
"""""""""""""""
**Syntax**
..code-block::none
[p]modset reinvite
**Description**
Toggle whether an invite will be sent to a user when unbanned.
If this is True, the bot will attempt to create and send a single-use invite
to the newly-unbanned user.
.._mod-command-modset-showsettings:
"""""""""""""""""""
modset showsettings
"""""""""""""""""""
**Syntax**
..code-block::none
[p]modset showsettings
**Description**
Show the current server administration settings.
.._mod-command-modset-trackallnames:
""""""""""""""""""""
modset trackallnames
""""""""""""""""""""
..note:: |owner-lock|
**Syntax**
..code-block::none
[p]modset trackallnames [enabled]
**Description**
Toggle whether all name changes should be tracked.
Toggling this off also overrides the tracknicknames setting.
**Arguments**
*``[enabled]``: Whether all name changes should be tracked. |bool-input|
.._mod-command-modset-tracknicknames:
"""""""""""""""""""""
modset tracknicknames
"""""""""""""""""""""
**Syntax**
..code-block::none
[p]modset tracknicknames [enabled]
**Description**
Toggle whether nickname changes should be tracked.
This setting will be overridden if trackallnames is disabled.
**Arguments**
*``[enabled]``: Whether all nickname changes should be tracked. |bool-input|
.._mod-command-movedeletedelay:
^^^^^^^^^^^^^^^
movedeletedelay
^^^^^^^^^^^^^^^
..note:: |owner-lock|
**Syntax**
..code-block::none
[p]movedeletedelay
**Description**
Move deletedelay settings to core
.._mod-command-moveignoredchannels:
^^^^^^^^^^^^^^^^^^^
moveignoredchannels
^^^^^^^^^^^^^^^^^^^
..note:: |owner-lock|
**Syntax**
..code-block::none
[p]moveignoredchannels
**Description**
Move ignored channels and servers to core
.._mod-command-names:
^^^^^
names
^^^^^
**Syntax**
..code-block::none
[p]names <member>
**Description**
Show previous names and nicknames of a member.
**Arguments**
*``<member>``: |member-input|
.._mod-command-rename:
^^^^^^
rename
^^^^^^
..note:: |admin-lock|
**Syntax**
..code-block::none
[p]rename <member> [nickname]
**Description**
Change a member's nickname.
Leaving the nickname empty will remove it.
**Arguments**
*``<member>``: |member-input|
*``[nickname]``: The new nickname for the member.
.._mod-command-slowmode:
^^^^^^^^
slowmode
^^^^^^^^
..note:: |admin-lock|
**Syntax**
..code-block::none
[p]slowmode [interval=0:00:00]
**Description**
Changes channel's slowmode setting.
Interval can be anything from 0 seconds to 6 hours.
Use without parameters to disable.
**Arguments**
*``[interval=0:00:00]``: The time for the channel's slowmode settings.
..note::
Interval can be anything from 0 seconds to 6 hours.
Use without parameters to disable.
.._mod-command-softban:
^^^^^^^
softban
^^^^^^^
..note:: |admin-lock|
**Syntax**
..code-block::none
[p]softban <member> [reason]
**Description**
Kick a member and delete 1 day's worth of their messages.
**Arguments**
*``<member>``: The member to softban. |member-input-quotes|
*``[reason]``: Reason for the kick (optional).
.._mod-command-tempban:
^^^^^^^
tempban
^^^^^^^
..note:: |admin-lock|
**Syntax**
..code-block::none
[p]tempban <member> [duration] [days] [reason]
**Description**
Temporarily ban a user from this server.
**Arguments**
*``<member>``: The member to temporarily ban. |member-input-quotes|
*``[duration]``: The amount of time the user should be banned for.
*``[days]``: The amount of days of messages to cleanup on tempban.
*``[reason]``: The reason for the tempban (optional).
**Example Usage**
*``[p]tempban @Twentysix Because I say so``
This will ban Twentysix for the default amount of time set by an administrator.
..note:: To use this cog, load it by typing this::
[p]load mutes
.._mutes-usage:
-----
Usage
-----
Mute users temporarily or indefinitely.
.._mutes-commands:
--------
Commands
--------
.._mutes-command-activemutes:
^^^^^^^^^^^
activemutes
^^^^^^^^^^^
..note:: |mod-lock|
**Syntax**
..code-block::none
[p]activemutes
**Description**
Displays active mutes on this server.
.._mutes-command-mute:
^^^^
mute
^^^^
..note:: |mod-lock|
**Syntax**
..code-block::none
[p]mute <users...> [time_and_reason]
**Description**
Mute users.
Examples:
*``[p]mute @member1 @member2 spam 5 hours``
*``[p]mute @member1 3 days``
**Arguments**
*``<users...>``: A space separated list of usernames, ID's, or mentions.
*``[time_and_reason]``: The time and reason. If no time is provided, the mute will use the default set time or indefinite if this hasn't been configured.
*``<users...>``: A space separated list of usernames, ID's, or mentions.
*``[time_and_reason]``: The time and reason. If no time is provided, the mute will use the default set time or indefinite if this hasn't been configured.
.._mutes-command-muteset:
^^^^^^^
muteset
^^^^^^^
**Syntax**
..code-block::none
[p]muteset
**Description**
Mute settings.
.._mutes-command-muteset-defaulttime:
"""""""""""""""""""
muteset defaulttime
"""""""""""""""""""
..note:: |mod-lock|
**Syntax**
..code-block::none
[p]muteset defaulttime [time]
..tip:: Alias: ``muteset time``
**Description**
Set the default mute time for the mute command.
If no time interval is provided this will be cleared.
**Arguments**
*``[time]``: The length of time for a default mute.
.._mutes-command-muteset-forcerole:
"""""""""""""""""
muteset forcerole
"""""""""""""""""
..note:: |owner-lock|
**Syntax**
..code-block::none
[p]muteset forcerole <true_or_false>
**Description**
Whether or not to force role only mutes on the bot.
**Arguments**
*``<true_or_false>``: Whether to enable or disable this setting, must provide ``true`` or ``false``.
.._mutes-command-muteset-makerole:
""""""""""""""""
muteset makerole
""""""""""""""""
..note:: |admin-lock|
**Syntax**
..code-block::none
[p]muteset makerole <name>
**Description**
Create a Muted role.
This will create a role and apply overwrites to all available channels
to more easily setup muting a user.
If you already have a muted role created on the server use
``[p]muteset role ROLE_NAME_HERE``
**Arguments**
*``<name>``: The name of the muted role to create.
.._mutes-command-muteset-notification:
""""""""""""""""""""
muteset notification
""""""""""""""""""""
..note:: |admin-lock|
**Syntax**
..code-block::none
[p]muteset notification [channel]
**Description**
Set the notification channel for automatic unmute issues.
If no channel is provided this will be cleared and notifications
about issues when unmuting users will not be sent anywhere.
**Arguments**
*``[channel]``: The channel to receive unmute issue updates. |channel-input|
.._mutes-command-muteset-role:
""""""""""""
muteset role
""""""""""""
..note:: |admin-lock|
**Syntax**
..code-block::none
[p]muteset role [role]
**Description**
Sets the role to be applied when muting a user.
If no role is setup the bot will attempt to mute a user by setting
channel overwrites in all channels to prevent the user from sending messages.
..Note::
If no role is setup a user may be able to leave the server
and rejoin no longer being muted.
**Arguments**
*``[role]``: The role for muted users to receive. |role-input|
.._mutes-command-muteset-senddm:
""""""""""""""
muteset senddm
""""""""""""""
..note:: |mod-lock|
**Syntax**
..code-block::none
[p]muteset senddm <true_or_false>
**Description**
Set whether mute notifications should be sent to users in DMs.
**Arguments**
*``<true_or_false>``: Whether to enable or disable this setting, must provide ``true`` or ``false``.
.._mutes-command-muteset-settings:
""""""""""""""""
muteset settings
""""""""""""""""
..note:: |mod-lock|
**Syntax**
..code-block::none
[p]muteset settings
..tip:: Alias: ``muteset showsettings``
**Description**
Shows the current mute settings for this guild.
.._mutes-command-muteset-showmoderator:
"""""""""""""""""""""
muteset showmoderator
"""""""""""""""""""""
..note:: |mod-lock|
**Syntax**
..code-block::none
[p]muteset showmoderator <true_or_false>
**Description**
Decide whether the name of the moderator muting a user should be included in the DM to that user.
**Arguments**
*``<true_or_false>``: Whether to enable or disable this setting, must provide ``true`` or ``false``.
.._mutes-command-unmute:
^^^^^^
unmute
^^^^^^
..note:: |mod-lock|
**Syntax**
..code-block::none
[p]unmute <users...> [reason]
**Description**
Unmute users.
**Arguments**
*``<users...>``: A space separated list of usernames, ID's, or mentions.
*``[reason]``: The reason for the unmute.
.._mutes-command-unmutechannel:
^^^^^^^^^^^^^
unmutechannel
^^^^^^^^^^^^^
..note:: |mod-lock|
**Syntax**
..code-block::none
[p]unmutechannel <users...> [reason]
..tip:: Alias: ``channelunmute``
**Description**
Unmute a user in this channel.
**Arguments**
*``<users...>``: A space separated list of usernames, ID's, or mentions.
*``[reason]``: The reason for the unmute.
.._mutes-command-voicemute:
^^^^^^^^^
voicemute
^^^^^^^^^
**Syntax**
..code-block::none
[p]voicemute <users...> [reason]
**Description**
Mute a user in their current voice channel.
Examples:
*``[p]voicemute @member1 @member2 spam 5 hours``
*``[p]voicemute @member1 3 days``
**Arguments**
*``<users...>``: A space separated list of usernames, ID's, or mentions.
*``[time_and_reason]``: The time and reason. If no time is provided, the mute will use the default set time or indefinite if this hasn't been configured.
.._mutes-command-voiceunmute:
^^^^^^^^^^^
voiceunmute
^^^^^^^^^^^
**Syntax**
..code-block::none
[p]voiceunmute <users...> [reason]
**Description**
Unmute a user in their current voice channel.
**Arguments**
*``<users...>``: A space separated list of usernames, ID's, or mentions.
This is the cog guide for the permissions 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 permissions
.._permissions-usage:
-----
Usage
-----
Customise permissions for commands and cogs.
This cog extends the default permission model of the bot. By default, many commands are restricted based on what the command can do.
This cog allows you to refine some of those restrictions. You can allow wider or narrower access to most commands using it. You cannot, however, change the restrictions on owner-only commands.
When additional rules are set using this cog, those rules will be checked prior to checking for the default restrictions of the command.
Global rules (set by the owner) are checked first, then rules set for servers. If multiple global or server rules apply to the case, the order they are checked in is:
1. Rules about a user.
2. Rules about the voice channel a user is in.
3. Rules about the text channel a command was issued in.
4. Rules about a role the user has (The highest role they have with a rule will be used).
5. Rules about the server a user is in (Global rules only).
.._permissions-commands:
--------
Commands
--------
.._permissions-command-permissions:
^^^^^^^^^^^
permissions
^^^^^^^^^^^
**Syntax**
..code-block::none
[p]permissions
**Description**
Command permission management tools.
.._permissions-command-permissions-acl:
"""""""""""""""
permissions acl
"""""""""""""""
..note:: |guildowner-lock|
**Syntax**
..code-block::none
[p]permissions acl
**Description**
Manage permissions with YAML files.
..tip:: See :ref:`here <cog_permissions>` for more information with configuring these yaml files.
.._permissions-command-permissions-acl-getglobal:
"""""""""""""""""""""""""
permissions acl getglobal
"""""""""""""""""""""""""
..note:: |owner-lock|
**Syntax**
..code-block::none
[p]permissions acl getglobal
**Description**
Get a YAML file detailing all global rules.
.._permissions-command-permissions-acl-getserver:
"""""""""""""""""""""""""
permissions acl getserver
"""""""""""""""""""""""""
..note:: |guildowner-lock|
**Syntax**
..code-block::none
[p]permissions acl getserver
**Description**
Get a YAML file detailing all rules in this server.
.._permissions-command-permissions-acl-setglobal:
"""""""""""""""""""""""""
permissions acl setglobal
"""""""""""""""""""""""""
..note:: |owner-lock|
**Syntax**
..code-block::none
[p]permissions acl setglobal
**Description**
Set global rules with a YAML file.
..warning::
This will override reset *all* global rules
to the rules specified in the uploaded file.
This does not validate the names of commands and cogs before
setting the new rules.
.._permissions-command-permissions-acl-setserver:
"""""""""""""""""""""""""
permissions acl setserver
"""""""""""""""""""""""""
..note:: |guildowner-lock|
**Syntax**
..code-block::none
[p]permissions acl setserver
**Description**
Set rules for this server with a YAML file.
..warning::
This will override reset *all* rules in this
server to the rules specified in the uploaded file.
@@ -83,9 +83,12 @@ In that file, place the following code:
fromredbot.coreimportcommands
classMycog(commands.Cog):
classMyCog(commands.Cog):
"""My custom cog"""
def__init__(self,bot):
self.bot=bot
@commands.command()
asyncdefmycom(self,ctx):
"""This does stuff!"""
@@ -96,11 +99,11 @@ Open :code:`__init__.py`. In that file, place the following:
..code-block::python
from.mycogimportMycog
from.mycogimportMyCog
defsetup(bot):
bot.add_cog(Mycog())
bot.add_cog(MyCog(bot))
Make sure that both files are saved.
@@ -156,6 +159,12 @@ Publishing your cog
Go to :doc:`/guide_publish_cogs`
--------------------------------
Becoming an Approved Cog Creator
--------------------------------
:doc:`/guide_cog_creators` explains the Cog Creator Application process and lists requirements and good practices for Cog Creators. This information is worth following for anyone creating cogs for Red, regardless of if you plan to publish your cogs or not.
--------------------
Additional resources
--------------------
@@ -163,98 +172,3 @@ 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
This guide serves to explain the Cog Creator Application process and lays out the requirements to be a Cog Creator.
----------------------------------
Creating a Cog Creator Application
----------------------------------
..note::
You will need to have created and published your cogs before you create a Cog Creator Application!
See `guide_cog_creation` and `guide_publish_cogs` for more information.
Cog Creator Applications are hosted on the `cogboard <https://cogboard.discord.red/c/apps/12>`__.
To create an application, start a new topic in the "Applications" category and fill out all of the required information.
QA reviews Cog Creator Applications for security and functionality on a first come, first serve basis.
Once your application is reviewed, you will have 14 days to make any requested changes, or to check in with the member of QA who is reviewing your application.
-----------------------------
Requirements for Cog Creators
-----------------------------
The following is a list of the requirements for approved Cog Creators.
QA uses this list to request changes for Cog Creator Applications.
Handling these requirements before submitting your application can streamline the review process.
Any Cog Creator that does not follow these requirements will have their repo removed from approved listings and may have their Cog Creator status revoked.
- Readme that contains
- Repository name
- Installation instructions
- Extra setup instructions (if applicable)
- Credits (if applicable)
- Repo-wide ``info.json`` file with the keys
- ``author``
-``name``
-``short``
-``description``
- Cog ``info.json`` files with the keys
- ``author``
-``name``
-``short``
-``requirements`` (if applicable)
-``description``
See `info-json-format` for more information on how to set up ``info.json`` files.
- No cog contains malicious code.
- No cog contains code that could impact the stability of the bot, such as blocking the event loop for an extended period of time, unreasonably high IO usage, etc.
- No cog contains copied code that does not respect the license of the source.
- Disclose in the ``install_msg`` key of the ``info.json`` file of each cog that contains any of the following:
- Heavy memory or I/O usage.
- Any NSFW material.
- Bundled data.
- Stored data (outside of using Config).
- Interactions with outside services.
- Any extra setup instructions required.
- No cog breaks the Discord TOS.
- No cog conflicts with any core cogs (e.g., causing a core cog to fail to load) unless it is intended to replace that cog.
- Your repo shows an understanding of a range of common cog practices. This requirement exists to ensure QA can trust the safety and functionality of any future code you will create. This is handled on a case-by-case basis, however the following points should outline what we are looking to see:
- Cogs that are more than what is able to be run in a simple eval.
- Cogs that are more than just a simple API access request.
- Cogs that properly use Red utilities, including Config, checks, and any other utility functions.
- Cogs that use event listeners (bot.wait_for or cog-wide listeners) or custom tasks that are efficient and handle exceptions appropriately.
- Cogs that handle errors properly.
- Cogs that handle permissions properly.
*While we're looking for these things to qualify your code, you don't need to apply all of them in order to qualify.*
- Any unusable or broken commands or cogs are hidden.
- The default locale must be English.
- The main cog class and every command must have a doc-string.
- No cog allows for escalation of permissions. (e.g., sending a mass ping through the bot without having permission to do so)
- Respect the role hierarchy. Don’t let a lower role have a way to grant a higher role.
- If your cog install comes with any pre-packaged data, use `bundled_data_path()` to access it.
- If your cog install creates any non-config data, use `cog_data_path()` to store it.
- Unless the cog is intentionally designed to listen to certain input from bots, cogs should ignore input from bots.
- Cogs use public methods of Red where possible.
- Use the proper method if one exists. (and ask for one if it doesn't exist)
- If that's not possible, don't break anything in core or any other cog with your code.
- If you have to use private methods, lock the cog to specific Red versions you can guarantee it works on without breaking anything using the ``min_bot_version`` and ``max_bot_version`` keys in that cog's ``info.json`` file.
- Cog Creators must keep their cogs up-to-date with core Red or be delisted until cogs meet Red API changes. Repositories must be kept up to date with the latest version of Red within 3 months of its release.
.._recommendations-for-cog-creators:
--------------------------------
Recommendations for Cog Creators
--------------------------------
The following is a list of recommendations for Cog Creators.
While not required for approved Cog Creators, they are still recommended in order to ensure consistency between repos.
- 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.
- 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.
- If you use asyncio.create_task, your tasks should:
- Be cancelled on cog unload.
- Handle errors.
- | 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.
- Use .gitignore (or something else) to keep unwanted files out of your cog repo.
- 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.
- Use botwide features when they apply. Some examples of this:
- ``ctx.embed_color``
-``bot.is_automod_immune``
- Use checks to limit command use when the bot needs special permissions.
- 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.
- 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.
- Respect settings when treating non-command messages as commands.
- 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.
- 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.
- 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.
----------------------------
Perks of being a Cog Creator
----------------------------
- Added to a growing, curated list of approved repositories hosted on the `Red Index <https://index.discord.red/>`__.
- The Cog Creator role on the main Red Server and the Cog Support Server.
- Access to an additional testing channel and the #advanced-coding channel on the main Red Server.
- Write permission in the #v3-burndown channel on the main Red Server.
- Access to an additional testing channel and the Cog Creators channel on the Support Server.
- Alerted about breaking changes in Red before anyone else.
- Ability to request a channel in the Cog Support Server if you feel like the traffic/question volume for your cogs warrants it.
-------------
Other Details
-------------
- Once a QA member has conducted a final review, you will have up to 14 days to make the necessary changes.
- The reviewer of your application has the final word.
- Hidden cogs will not be explicitly reviewed, however they are not allowed to contain malicious or ToS breaking code.
- QA reserves the right to revoke these roles and all privileges if you are found to be in gross negligence, malicious intent, or reckless abandonment of your repository.
- If a Cog Creator's repository is not maintained and kept up to date, that repo will be removed from the approved repo listings until such issues are addressed.
- Only 1 person is allowed to be the Cog Creator for a particular repo. Multiple people are allowed to maintain the repo, however the "main" owner (and the Cog Creator) is responsible for any code on the repo.
- The Cog Creator status for a repo can be transferred to another user if the Cog Creator requests it.
- An approved Cog Creator can ask QA to add additional repos they have created to the approved pool.
@@ -85,5 +85,13 @@ Keys specific to the cog info.json (case sensitive)
``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 version 3.4.
Shared libraries are deprecated since version 3.2 and are marked for removal in the future.
Adding to the Index
-------------------
Repositories that are correctly configured can be added to the `public index of cogs <https://index.discord.red/>`_.
To be added to the index, make a pull request to the `Red-Index repository <https://github.com/Cog-Creators/Red-Index>`_ in the unapproved section. You can learn more about this process in the repository description.
To be added to the approved repositories, first see `guide_cog_creators`.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.