223 Commits

Author SHA1 Message Date
TrustyJAID
fdaa869130
[Help command] Utilize copy to clipboard (#6244)
Co-authored-by: Kreusada Ignad Amredes <67752638+Kreusada@users.noreply.github.com>
2024-12-24 03:23:26 +01:00
cdaman3141
150692538f
Fixed [p]ban raising an unhandled error if an ID too large is provided (#6486)
Co-authored-by: Jakub Kuczys <me@jacken.men>
2024-12-24 01:12:33 +00:00
github-actions[bot]
f4c8077268
Automated Crowdin downstream (#6405)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-11 01:02:52 +02:00
Michael Oliveira
0b0b23b971
Fix @commands.can_manage_channel always passing (#6398) 2024-07-10 20:41:24 +02:00
github-actions[bot]
23c86d7850
Automated Crowdin downstream (#6362)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-21 04:04:35 +02:00
Jakub Kuczys
47d4675f52
Fix error message edge case in parse_timedelta (#6357) 2024-04-21 00:27:40 +02:00
Jakub Kuczys
e61327a65c
Fix potential API compatibility issue in parse_timedelta() (#6355) 2024-04-20 23:42:20 +02:00
Zephyrkul
11ebd40dfa
Fix TimedeltaConverter allowing negative values by default (#6354)
Co-authored-by: zephyrkul <zephyrkul@users.noreply.github.com>
2024-04-20 23:17:38 +02:00
Zephyrkul
00e41d38f9
Improve timedelta conversions (#6349)
Co-authored-by: zephyrkul <zephyrkul@users.noreply.github.com>
2024-04-14 12:58:00 -06:00
Louis Dominic
97b467939c
Increase default timeout for ctx.send_interactive to 60 (#6352) 2024-04-11 21:18:40 -08:00
github-actions[bot]
de1141af98
Automated Crowdin downstream (#6318)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-22 01:56:41 +01:00
Auguste Charpentier
8c2976504a
Add user param to menu() (#4913)
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: Jakub Kuczys <me@jacken.men>
2024-03-18 01:35:53 +01:00
Jakub Kuczys
0c83fcd495
Add explicit mention of word 'provisional' for version guarantee exclusions (#6311) 2024-03-17 20:15:17 -04:00
Michael Oliveira
ff09713aad
Fix edge case where perm names are not validated in custom Red decos (#6291) 2024-02-11 10:42:25 +01:00
Dav
dbd71db6a8
[Help] Send menus to dm if maxpages is 0 (#5375)
Co-authored-by: Dav <dav@mail.stopdavabuse.de>
Co-authored-by: Michael Oliveira <34169552+Flame442@users.noreply.github.com>
2024-01-19 15:06:14 -05:00
Kreusada Ramicario
47a267b38b
[Help] Allow prefix formatting in taglines (#4972)
Co-authored-by: Michael Oliveira <34169552+Flame442@users.noreply.github.com>
2024-01-01 23:25:02 -05:00
github-actions[bot]
97377a9f8d
Automated Crowdin downstream (#6251)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-09-14 20:02:01 +00:00
github-actions[bot]
d04cc36bc6
Automated Crowdin downstream (#6212)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-24 20:15:23 +02:00
Jakub Kuczys
6f920daeed
Improve unreleased Command.is_enabled() and document related methods (#6209)
Co-authored-by: Michael Oliveira <34169552+Flame442@users.noreply.github.com>
2023-07-23 21:12:33 -04:00
Jakub Kuczys
be5751a7ea
Handle empty name case when splitting description field in help (#5941) 2023-06-19 14:15:34 +02:00
Predä
f47d1dffb3
Use a SnowflakeList for Command disable instead of checks (#5552) 2023-05-17 21:33:04 +01:00
github-actions[bot]
c52ef73097
Automated Crowdin downstream (#6127)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-04 08:22:59 +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
Flame442
b3fd90ae4c
Red 3.5.0 - Changelog (#6106)
Co-authored-by: Jakub Kuczys <me@jacken.men>
Co-authored-by: aikaterna <20862007+aikaterna@users.noreply.github.com>
2023-05-04 02:53:02 +02:00
Jakub Kuczys
ba1bf23363
Remove unused ConversionFailure (#6113) 2023-05-03 23:49:12 +02:00
Jakub Kuczys
2fe251ecf3
Port TiV changes applied to voice channels to stage channels (#6109) 2023-05-02 19:05:44 -04:00
Jakub Kuczys
226d8d734d
Reformat with Black 2023 formatting changes 2023-05-02 00:51:29 +02:00
Flame442
6cef8408e8
Fix help breaking when removing a command without removing its cog (#6104) 2023-04-28 02:01:46 +02:00
Jakub Kuczys
f051eae92d
Privatize APIs by renaming or removing them from __all__ (#6021) 2023-04-17 17:44:33 -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
Samuel
fa305cb060
[Help] Optimisation on getting commands in Cog-help (#5354)
Co-authored-by: npc203 <npc203@users.noreply.github.com>
Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
2023-04-16 17:17:10 -04:00
yuansheng1549
030607fb04
Add Traceback prompt (#5851)
Co-authored-by: Jakub Kuczys <me@jacken.men>
2023-04-14 18:50:39 +02: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
Jakub Kuczys
44e129bc66
Add redbot.core.app_commands namespace (#6006) 2023-03-27 20:49:59 -04:00
Lioness100
a89a27cadf
docs: fix typos (#5989)
Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
2023-02-13 21:36:09 -05:00
TrustyJAID
bbb15924b9
Allow send_interactive to upload a file containing all content (#5902)
Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
2022-11-24 16:05:07 -05:00
TrustyJAID
aaeb1b5daa
Add buttons to help (#5634)
Co-authored-by: Zephyrkul <23347632+Zephyrkul@users.noreply.github.com>
Co-authored-by: Kowlin <10947836+Kowlin@users.noreply.github.com>
Co-authored-by: Jakub Kuczys <me@jacken.men>
2022-10-12 16:29:10 +02:00
TrustyJAID
f8b0cc6c6a
Add support for Hybrid commands in Red (#5681)
Co-authored-by: Kowlin <10947836+Kowlin@users.noreply.github.com>
Co-authored-by: aikaterna <20862007+aikaterna@users.noreply.github.com>
Co-authored-by: Jakub Kuczys <6032823+jack1142@users.noreply.github.com>
Co-authored-by: Kreusada <67752638+Kreusada@users.noreply.github.com>
Co-authored-by: Candy <28566705+mina9999@users.noreply.github.com>
Co-authored-by: Matt Chandra <55866950+matcha19@users.noreply.github.com>
Co-authored-by: Lemon Rose <78662983+japandotorg@users.noreply.github.com>
Co-authored-by: Honkertonken <94032937+Honkertonken@users.noreply.github.com>
Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
Co-authored-by: River <18037011+RheingoldRiver@users.noreply.github.com>
Co-authored-by: AAA3A <89632044+AAA3A-AAA3A@users.noreply.github.com>
Co-authored-by: Lemon Rose <japandotorg@users.noreply.github.com>
Co-authored-by: Julien Mauroy <pro.julien.mauroy@gmail.com>
Co-authored-by: TheThomanski <15034759+TheThomanski@users.noreply.github.com>
2022-10-11 22:52:43 +02:00
Jakub Kuczys
f02528378f
discord.py 2.0 update (3d914e08->2.0.1) (#5709) 2022-10-03 16:07:15 +02:00
Kowlin
acdc1df084
Add support for set api Modals (#5637)
* Add support for set api Modals

Co-authored-by: TrustyJAID <TrustyJAID@gmail.com>

* Blaacckkkk!

* Swap locations of interaction and button.

* Clarified template tokens

* Update docs and some string

* More docs

* Rework the client

Co-authored-by: TrustyJAID <TrustyJAID@gmail.com>

* Goddamned black!

* Missed a few arguments

* Black... Again

* Update redbot/core/utils/views.py

Co-authored-by: TrustyJAID <TrustyJAID@gmail.com>

* Update redbot/core/core_commands.py

Co-authored-by: TrustyJAID <TrustyJAID@gmail.com>

Co-authored-by: TrustyJAID <TrustyJAID@gmail.com>
2022-05-20 13:58:18 -06:00
TrustyJAID
2995a457f6
Fix AttributeError in new decorators added to requires (#5665) 2022-04-03 04:27:24 +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
TrustyJAID
5a5b22003f
Fix embed requested in DMs (#5635)
* Fix embed requested in DM's

* Add documentation

* black

* Address comments

* Unnecessary added line

* Use correct channel on context

* use correct var name

* More review stuff
2022-03-22 21:04:45 +01:00
jack1142
c69e8d31fd Reformat with Black 22.1.0 2022-03-22 18:37:17 +01:00
jack1142
7a5ada2d92
Make decorator combining in Requires more consistent (#5625)
* Allow combining bot_has_permissions() decos

* Improve consistency for Requires.user_perms
2022-03-21 10:23:23 -06:00
jack1142
0f299ae195
Support all Messageables in bot.embed_requested() (#5576)
* Support all Messageables in bot.embed_requested

* Update usage in core

* Simplify [p]contact

This couldn't be done before this change.

I have also simplified getting embed color.

* Make `True` the new default for `check_permissions` kwarg
2022-03-21 10:22:55 -06:00
GhOsT
7d716a2d67
Fix formatting breaking with nested formatting utils in help (#5601)
* Fix formatting breaking with nested formatters.

* Remove useless f-strings

* Revert formatting to the one before PR #5435

* One more small formatting revert

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2022-03-06 17:48:48 +01:00
Dav
c6517d5087
[Core/Core Cogs] Prevent translation errors and use formatting utils (#5435)
* Use proper syntax for inline formatting in core_commands

* use proper formating utils in core and core cogs wherever reasonable

* tests are awesome

* ensure "(continued)" is translated in help.py

* add colons to translatable strings for easier context comprehension by translators

* Thx flame :)

Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>

* good point

Co-authored-by: Dav <dav@mail.stopdavabuse.de>
Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
2022-02-15 20:25:21 -05:00
jack1142
ff7c146b62
Make embeds in help output consistent (#5452)
* Add `check_permissions` kwarg to `bot.embed_requested()`

* Make embeds in help consistent regardless of why it's being sent
2021-12-31 02:01:23 +01:00
Flame442
dce2378806
Prevent unexpected timedelta matches (#5393)
* Prevent unexpected matches by asserting whitespace or eof at the end of matches

* Use a positive lookahead instead of a capturing group to support 1d6h syntax

* Use fullmatch instead of modifying regex strings
2021-12-30 00:46:36 +01:00