* Temporarily set d.py to use latest git revision
* Remove `bot` param to Client.start
* Switch to aware datetimes
A lot of this is removing `.replace(...)` which while not technically
needed, simplifies the code base. There's only a few changes that are
actually necessary here.
* Update to work with new Asset design
* [threads] Update core ModLog API to support threads
- Added proper support for passing `Thread` to `channel`
when creating/editing case
- Added `parent_channel_id` attribute to Modlog API's Case
- Added `parent_channel` property that tries to get parent channel
- Updated case's content to show both thread and parent information
* [threads] Disallow usage of threads in some of the commands
- announceset channel
- filter channel clear
- filter channel add
- filter channel remove
- GlobalUniqueObjectFinder converter
- permissions addglobalrule
- permissions removeglobalrule
- permissions removeserverrule
- Permissions cog does not perform any validation for IDs
when setting through YAML so that has not been touched
- streamalert twitch/youtube/picarto
- embedset channel
- set ownernotifications adddestination
* [threads] Handle threads in Red's permissions system (Requires)
- Made permissions system apply rules of (only) parent in threads
* [threads] Update embed_requested to support threads
- Threads don't have their own embed settings and inherit from parent
* [threads] Update Red.message_eligible_as_command to support threads
* [threads] Properly handle invocation of [p](un)mutechannel in threads
Usage of a (un)mutechannel will mute/unmute user in the parent channel
if it's invoked in a thread.
* [threads] Update Filter cog to properly handle threads
- `[p]filter channel list` in a threads sends list for parent channel
- Checking for filter hits for a message in a thread checks its parent
channel's word list. There's no separate word list for threads.
* [threads] Support threads in Audio cog
- Handle threads being notify channels
- Update type hint for `is_query_allowed()`
* [threads] Update type hints and documentation to reflect thread support
- Documented that `{channel}` in CCs might be a thread
- Allowed (documented) usage of threads with `Config.channel()`
- Separate thread scope is still in the picture though
if it were to be done, it's going to be in separate in PR
- GuildContext.channel might be Thread
* Use less costy channel check in customcom's on_message_without_command
This isn't needed for d.py 2.0 but whatever...
* Update for in-place edits
* Embed's bool changed behavior, I'm hoping it doesn't affect us
* Address User.permissions_in() removal
* Swap VerificationLevel.extreme with VerificationLevel.highest
* Change to keyword-only parameters
* Change of `Guild.vanity_invite()` return type
* avatar -> display_avatar
* Fix metaclass shenanigans with Converter
* Update Red.add_cog() to be inline with `dpy_commands.Bot.add_cog()`
This means adding `override` keyword-only parameter and causing
small breakage by swapping RuntimeError with discord.ClientException.
* Address all DEP-WARNs
* Remove Context.clean_prefix and use upstream implementation instead
* Remove commands.Literal and use upstream implementation instead
Honestly, this was a rather bad implementation anyway...
Breaking but actually not really - it was provisional.
* Update Command.callback's setter
Support for functools.partial is now built into d.py
* Add new perms in HUMANIZED_PERM mapping (some from d.py 1.7 it seems)
BTW, that should really be in core instead of what we have now...
* Remove the part of do_conversion that has not worked for a long while
* Stop wrapping BadArgument in ConversionFailure
This is breaking but it's best to resolve it like this.
The functionality of ConversionFailure can be replicated with
Context.current_parameter and Context.current_argument.
* Add custom errors for int and float converters
* Remove Command.__call__ as it's now implemented in d.py
* Get rid of _dpy_reimplements
These were reimplemented for the purpose of typing
so it is no longer needed now that d.py is type hinted.
* Add return to Red.remove_cog
* Ensure we don't delete messages that differ only by used sticker
* discord.InvalidArgument->ValueError
* Move from raw <t:...> syntax to discord.utils.format_dt()
* Address AsyncIter removal
* Swap to pos-only for params that are pos-only in upstream
* Update for changes to Command.params
* [threads] Support threads in ignore checks and allow ignoring them
- Updated `[p](un)ignore channel` to accept threads
- Updated `[p]ignore list` to list ignored threads
- Updated logic in `Red.ignored_channel_or_guild()`
Ignores for guild channels now work as follows (only changes for threads):
- if channel is not a thread:
- check if user has manage channels perm in channel
and allow command usage if so
- check if channel is ignored and disallow command usage if so
- allow command usage if none of the conditions above happened
- if channel is a thread:
- check if user has manage channels perm in parent channel
and allow command usage if so
- check if parent channel is ignored and disallow command usage
if so
- check if user has manage thread perm in parent channel
and allow command usage if so
- check if thread is ignored and disallow command usage if so
- allow command usage if none of the conditions above happened
* [partial] Raise TypeError when channel is of PartialMessageable type
- Red.embed_requested
- Red.ignored_channel_or_guild
* [partial] Discard command messages when channel is PartialMessageable
* [threads] Add utilities for checking appropriate perms in both channels & threads
* [threads] Update code to use can_react_in() and @bot_can_react()
* [threads] Update code to use can_send_messages_in
* [threads] Add send_messages_in_threads perm to mute role and overrides
* [threads] Update code to use (bot/user)_can_manage_channel
* [threads] Update [p]diagnoseissues to work with threads
* Type hint fix
* [threads] Patch vendored discord.ext.menus to check proper perms in threads
I guess we've reached time when we have to patch the lib we vendor...
* Make docs generation work with non-final d.py releases
* Update discord.utils.oauth_url() usage
* Swap usage of discord.Embed.Empty/discord.embeds.EmptyEmbed to None
* Update usage of Guild.member_count to work with `None`
* Switch from Guild.vanity_invite() to Guild.vanity_url
* Update startup process to work with d.py's new asynchronous startup
* Use setup_hook() for pre-connect actions
* Update core's add_cog, remove_cog, and load_extension methods
* Update all setup functions to async and add awaits to bot.add_cog calls
* Modernize cogs by using async cog_load and cog_unload
* Address StoreChannel removal
* [partial] Disallow passing PartialMessageable to Case.channel
* [partial] Update cogs and utils to work better with PartialMessageable
- Ignore messages with PartialMessageable channel in CustomCommands cog
- In Filter cog, don't pass channel to modlog.create_case()
if it's PartialMessageable
- In Trivia cog, only compare channel IDs
- Make `.utils.menus.menu()` work for messages
with PartialMessageable channel
- Make checks in `.utils.tunnel.Tunnel.communicate()` more rigid
* Add few missing DEP-WARNs
* Move bankset and modlogset to core commands
* Move prune over too
* Finish moving prune
* Move [p]economyset registeramount to [p]bankset registeramount
* style fix
* Fix circular import issue with another breaking change
* Apparently I missed a conflict and git still let me commit...
* Really git?
* Rename RawUserIds -> RawUserIdConverter, improve documentation
* Improve documentation of `is_owner_if_bank_global()`
* MENTION_REGEX -> USER_MENTION_REGEX
* Add 'bank.' prefix
* Fix command examples in docstrings
* Missing docstring change from `bankset prune`
* Missing changes for commands in modlogset
* Update docs
* Remove duplicated info in `economyset showsettings`
* Fix toctree in index.rst
* Add command group prefixes to names of functions for bankset/modlogset
* Remaining string updates due to command name changes
* Ensure that the bank folder is actually gone
Co-authored-by: palmtree5 <palmtree5+3577255@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Fix wording in redbot/cogs/mod/kickban.py to match with the command example
* Made changes as requested in PR Review #770078179
* Added changes to docs/cog_guides/mod.rst as requested in PR Review #70784066
* Fixed kick wording
* Fix kick wording
* [Mod] Send ban reason on Temp Bans
* If none
* Locale friendly
* Fixes for black style
* Use double line break to distinguish between reason header
* Check settings
* Black
* Reduce the number of config calls
* remove additional config call
* fixes
* style
* We're already in `if reason` so this is always True
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
* [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>
* 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
* [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
* 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>
* Add support for default duration in kickban.py
* add setting command and info to settings view
* add config key
* black
* Thx jack
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* adress review
* Address review
* typo
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>
* Use aware objects instead of naive ones
* Use aware objects when storing and reading UTC timestamps
* Remove unneeded parentheses
* Fixed naive and aware objects unable to be compared here
* Address feedback
* Fix the newly added `modlog.create_case()` calls
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* create cog disbale base
* Because defaults...
* lol
* announcer needs to respect this
* defaultdict mishap
* Allow None as guild
- Mostly for interop with with ctx.guild
* a whitespace issue
* Apparently, I broke this too
* Apply suggestions from code review
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* This can probably be more optimized later, but since this is a cached value, it's not a large issue
* Report tunnel closing
* mod too
* whitespace issue
* Fix Artifact of prior method naming
* these 3 places should have the check if i understood it correctly
* Announce the closed tunnels
* tunnel oversight
* Make the player stop at next track
* added where draper said to put it
* Apply suggestions from code review
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Remove users from tempban unban list when hackbanning them
* black and missing bracket
* make sure this actually gets processed
* let the user know when a tempban was upgraded
* say more things
* reduce config calls
* jack loves performance
* adress review
* review the 2nd
* add duration atribute
* sanity checks
* add days parameter
* maybe resolve conflicts?
* black and make linting happy
* right... I need to send this
* but I still need to return... oops
* lets reduce config calls here
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Lets normalize how we name config attributes across the bot.
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* ....
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Just a tiny PR improving config call in a lot of places (Specially events and Help)
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* stop using `bot.guilds` in `on_command_add`
* Just a tiny PR improving config call in a lot of places (Specially events and Help)
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* missed this one
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* nothing to see here
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* lets reduce config calls here
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Just a tiny PR improving config call in a lot of places (Specially events and Help)
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* stop using `bot.guilds` in `on_command_add`
* missed this one
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* welp
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* welp
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* welp
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* jack
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Update redbot/cogs/mod/kickban.py
Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>
* Update redbot/cogs/filter/filter.py
Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>
* jack
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* make all large loops async to avoid blocking larger bots
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* ...
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* okay now working AsyncGen
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* may or may not have forgotten black
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Apply suggestions from code review
Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>
* jack's review
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* DOCS
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* DOCS
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Apply suggestions from code review
Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>
* jack
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* Apply suggestions from code review
Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>
* Update redbot/core/utils/__init__.py
Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>
* Update redbot/core/utils/__init__.py
Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>
* avoid loop if possible and if not only iterate once
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Lets normalize how we name config attributes across the bot.
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* ....
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
* nothing to see here
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>