117 Commits

Author SHA1 Message Date
Vexed
2386b8363f
Fix visual issues with Discord's new Markdown (#6101)
Co-authored-by: Jakub Kuczys <me@jacken.men>
2023-05-13 12:39:57 +02:00
github-actions[bot]
7b80043d19
Automated Crowdin downstream (#6119)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-04 03:04:41 +02:00
Jakub Kuczys
2fe251ecf3
Port TiV changes applied to voice channels to stage channels (#6109) 2023-05-02 19:05:44 -04:00
AAA3A
eafbb06756
Add public positive_int and finite_float converters (#5969)
Co-authored-by: Kreusada <67752638+Kreusada@users.noreply.github.com>
2023-04-17 22:33:44 +01:00
Kreusada
79d11e947c
Use the commands module instead of checks for permission decorators (#5463)
Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
2023-04-13 14:16:12 -04:00
keqking
1cb5836db4
[cleanup] fix error in [p]cleanup spam command (#5879) 2022-10-13 11:57:41 +02:00
Leet
64e6044aba
[Cleanup] Pass reason for bulk message deletion to audit log (#5863)
Co-authored-by: Jakub Kuczys <me@jacken.men>
2022-10-12 23:02:37 +02:00
Jakub Kuczys
f02528378f
discord.py 2.0 update (3d914e08->2.0.1) (#5709) 2022-10-03 16:07:15 +02:00
jack1142
febca8ccbb
Migration to discord.py 2.0 (#5600)
* 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
2022-04-03 03:21:20 +02:00
jack1142
c69e8d31fd Reformat with Black 22.1.0 2022-03-22 18:37:17 +01:00
Kreus Amredes
e068294cc8
Restrict [p]cleanupset notify to guild only (#5466) 2021-12-25 00:54:37 +01:00
palmtree5
6acdcdeae9
Move modlogset/bankset commands to core (#4486)
* 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>
2021-11-25 10:06:30 +01:00
jack1142
4b70acb989
Do not include expected wait_for responses in translated strings (#5364)
* Do not include 'I agree' prompt in translation string

* Add more stuff

* Address review comment

* Address review comments
2021-10-16 00:02:35 +02:00
Kreus Amredes
63fd7cc95f
[Docs] Update Cleanup docs with new cleanupset command group (#5245)
* Add cleanupset commands to cleanup docs

* fix spacing

* shown -> sent

* update command docstring

* Fix trailing whitespace and use same style for docs

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2021-09-07 21:12:46 +00:00
PredaaA
4366af6f6c
[Cleanup] Handle NotFound error of prompt in check_100_plus (#5191)
* [Cleanup] Handle HTTPException of prompt in check_100_plus

* Update redbot/cogs/cleanup/cleanup.py

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2021-09-04 00:38:03 +02:00
Jamie
c4f8f65d4d
Add toggleable notification of deleted messages count in Cleanup (#5218)
* Addition of cleanup notification.

* black

* subtract invoking message from count

* Update redbot/cogs/cleanup/cleanup.py

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

* be explicity about kwarg

* address review

* style

* Fix type hints

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2021-09-03 01:12:28 +02:00
jack1142
88abe469b6
Accept mentions in [p]cleanup user (#5169)
* Accept mentions in `[p]cleanup user`

* Updated spacing & formatting on info logging

* Whoops...

Co-authored-by: Kowlin <boxedpp@gmail.com>
2021-09-02 01:08:13 +02:00
github-actions[bot]
5f0b4403bc
[i18n] Automated Crowdin downstream (#5132)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-06-12 18:53:21 +02:00
github-actions[bot]
ce4fd6cca8
[i18n] Automated Crowdin downstream (#5087)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-05-28 20:09:47 +02:00
jack1142
7459af25ba
Specify that cleanup commands remove messages from current channel (#5070) 2021-05-23 15:24:17 +01:00
github-actions[bot]
6cae1c0204
[i18n] Automated Crowdin downstream (#4946)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-04-06 00:55:36 +02:00
Pred
03d72dd5fa
[Cleanup] Pre-set the variable to None in [p]cleanup before (#4931)
* [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>
2021-04-04 09:34:11 +00:00
PhenoM4n4n
fb701d8c72
Allow Cleanup before/after to accept message replies (#4790)
* cleanup after

* style

* bring back cleanup before

* style

* docstring

* make message id optional
2021-03-29 14:39:31 +02:00
github-actions[bot]
51b73fdd1a
[i18n] Automated Crowdin downstream (#4857)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-02-26 19:51:59 +01:00
github-actions[bot]
e80a00ec1b
[i18n] Automated Crowdin downstream (#4829)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-02-16 19:22:05 +00:00
MAX
3122eb0447
Rename [p]cleanup spam to [p]cleanup duplicates (#4814)
* rename `spam` to `duplicates` and aliases it to `spam`

* style
2021-02-14 21:41:04 +01:00
github-actions[bot]
bf30f2078c
[i18n] Automated Crowdin downstream (#4816)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-02-14 16:57:35 +01:00
Neuro Assassin
1920212eda
[Cleanup] Fix error when providing message snowflake above the maximum (9223372036854775807) (#4791)
* [Cleanup] Fix angry error

* haha just kidding, does not work

* change to be clearer

* update to module level

* cmon black

* added in wrong place
2021-02-11 22:30:16 +01:00
github-actions[bot]
663876fba3
Automated Crowdin downstream (#4804)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-02-11 13:20:38 +00:00
github-actions[bot]
0f8f33fed2
Automated Crowdin downstream (#4734)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-02-04 18:05:40 +00:00
github-actions[bot]
13cd751932
Automated Crowdin downstream (#4689)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-12-24 15:45:31 +01:00
Ryan
3a12a9b47f
[Cleanup] Delete command message when using [p]cleanup self (#4640)
* delete command message

* only delete command if can_mass_purge
2020-12-17 20:37:38 +01:00
github-actions[bot]
e2adb29cf3
Automated Crowdin downstream (#4638)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-11-29 22:04:43 +01:00
github-actions[bot]
bc8f2311d9
Automated Crowdin downstream (#4627)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-11-19 22:18:05 +01:00
github-actions[bot]
e50b32cc27
[i18n] Automated Crowdin downstream (#4596)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-11-16 18:26:02 +01:00
github-actions[bot]
0089380bfd
Automated Crowdin downstream (#4578)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-11-05 16:53:43 +01:00
github-actions[bot]
ffcf104dfc
Automated Crowdin downstream (#4567)
Red I18n: "Context comments are changed edition"

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-11-02 17:32:43 +01:00
bobloy
252951c706
[Docs] Cleanup Cog Guide (#4488)
* 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
2020-10-28 00:51:19 -04:00
github-actions[bot]
b018c6a24d
[i18n] Automated Crowdin downstream (#4476)
Kowlin told me I should just merge.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-10-26 21:26:02 +01:00
Stonedestroyer
08bd0567ad
Grammar fixes (#4500)
* Grammar fixes

* More changes

* Grammar

* Error grammar

* Spelling

* Grammar

* REsolves grammar

* grammar

* grammar

* grammar

* grammar

* grammar

* grammar

* grammar

* grammar

* "commited" > "committed"

* apostrophe

* more grammar

* grammar

* `funtion` to `function`

* grammar in alias cog

* grammar in cleanup cog

* grammar in customcom cog

* grammar in mod cog

* grammar in reports cog

* fix grammar in streams cog

* missing apostrophe

* grammar fix in trivia cog

Co-authored-by: Jyu Viole Grace <24418520+thisisjvgrace@users.noreply.github.com>
Co-authored-by: Jyu Viole Grace <thisisjvgrace@users.noreply.github.com>
2020-10-18 08:52:56 +01:00
Predeactor
4453b5653a
Fix [p]cleanup self not working in DMs for non-owners (#4481)
* 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>
2020-10-18 02:07:08 +02:00
Kowlin
a9656dea38
Delete no-NO in favor of nb-NO (#4396) 2020-09-05 02:48:55 +02:00
github-actions[bot]
f8fcabfe10
Automated Crowdin downstream (#4395)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-09-03 17:26:47 +02:00
github-actions[bot]
e1a9b31e9b
Automated Crowdin downstream (#4394)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-09-03 15:48:34 +02:00
github-actions[bot]
ec7c2ca4b9
Automated Crowdin downstream (#4373)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-08-30 17:42:37 +02:00
jack1142
85afe19455
Bump black to 20.8b1 (and reformat) (#4371)
* Bump black version

* Reformat with black
2020-08-29 19:12:28 +02:00
github-actions[bot]
8c7848f18b
Automated Crowdin downstream (#4327)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-08-20 19:30:44 +02:00
github-actions[bot]
5f52fb872a
[i18n] Automated Crowdin downstream (#4166)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-08-06 17:19:59 +02:00
MeatyChunks
8e0dbb7185
Fix amount of messages in log message of [p]cleanup message (#4156)
Fixes #4155
2020-08-04 12:14:13 +02:00
Michael H
c0b1e50a5f
Begin work on a data request API (#4045)
[Core] Data Deletion And Disclosure APIs

 - Adds a Data Deletion API
   - Deletion comes in a few forms based on who is requesting
   - Deletion must be handled by 3rd party
 - Adds a Data Collection Disclosure Command
   - Provides a dynamically generated statement from 3rd party
   extensions
 - Modifies the always available commands to be cog compatible
   - Also prevents them from being unloaded accidentally
2020-08-03 15:09:07 +02:00