Commit Graph

47 Commits

Author SHA1 Message Date
7e2ca02fd1 Add total_message_sent attribute to threads
Co-authored-by: Alex Nørgaard <Umbra@AbstractUmbra.dev>
Co-authored-by: dolfies <jeyalfie47@gmail.com>
2025-08-15 11:38:56 -04:00
ec409a0a7b Guard AppCommandThread.guild attribute access 2025-08-08 03:13:30 -04:00
db42eba4fa Add more attributes to AppCommandChannel/Thread 2025-08-08 03:11:29 -04:00
a62b25c6c0 Add missing attributes in AppCommandChannel 2025-06-20 18:26:36 -04:00
2bcbd49bc6 Add __repr__ method to various classes 2025-06-20 14:57:10 -04:00
2e2f51fd5c First pass at supporting user apps
Co-authored-by: red <red@kalab.sk>
Co-authored-by: Vioshim <63890837+Vioshim@users.noreply.github.com>
2024-05-04 23:25:01 -04:00
0adef0ec89 Update auto_archive_duration documentation
Fix #9351
2023-04-18 06:03:48 -04:00
3ff88db768 Update pyright to 1.1.289 2023-01-16 21:57:54 -05:00
6981eb69c4 Normalize type formatting in TypeError
Normalize most mixed usages of `__class__`, `__class__!r`, 
`__class__.__name__!r` to the standard form of 
`__class__.__name__`
2022-09-12 15:25:55 -04:00
b92fd65707 Document app_commands.Choice limits 2022-08-26 11:59:12 -04:00
63b32994f4 Improve TranslationContext type narrowing using a tagged union 2022-08-15 08:17:41 -04:00
49e6fe9a0c Fix autocomplete translations calling unnecessary locales 2022-08-14 17:35:43 -04:00
32c5a0cec1 Change default Choice.name_localizations to an empty dict 2022-08-14 17:35:43 -04:00
f69d4ee5cb Add Choice.name_localizations data from Discord
Fix #8337
2022-08-14 16:29:16 -04:00
c32567ea81 Refactor TranslationContext to be more useful
The previous enum was good at accomplishing dynamic key generation for
a few cases, but it fell short in others:

1. It could not discern group names and command names
2. It could not give you more contextual data such as the full object
   currently being translated.

On top of that, the context being a required parameter for
Translator.translate meant that it wouldn't be possible to re-use the
translator for other use cases outside of the rigid ones defined in the
library.

To alleviate these concerns, new enum attributes were added along with
a richer type for obtaining even more context.
2022-08-09 10:41:45 -04:00
dc81ff76c4 Add Object.type to Objects where a type can be determined 2022-08-09 08:18:58 -04:00
7d20379bd9 Add name_localizations and description_localizations to AppCommand & co 2022-08-05 22:36:40 -04:00
2d586ae805 Add initial support for app command localisation 2022-08-05 22:35:30 -04:00
d707019348 Bump Pyright to 1.1.265, fix type errors, and remove unnecessary ignores 2022-08-04 22:46:02 -04:00
6c42065210 Fix various a -> an typos across the library
Closes #8301, #8287
2022-08-04 08:17:07 -04:00
6e3c359373 Add min/max_length to Argument
Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
2022-08-01 06:23:12 -04:00
24b619a516 Fix docstring for AppCommand.options and AppCommandGroup.options 2022-07-25 21:20:08 -04:00
55b9a848ff Implement AppCommand mentions 2022-07-09 23:06:09 -04:00
c61e407b50 Fix typo in app_commands.AppCommandGroup 2022-07-01 22:31:54 -04:00
e73a805bd7 Add missing data to Argument model 2022-06-12 15:33:08 -04:00
c9f777c873 Fix type annotations to adhere to latest pyright release 2022-06-12 15:30:45 -04:00
3cb90199c9 Remove private legacy cruft from AppCommand models
- Document `options` for AppCommand
- Remove `choices` and `required` from AppCommandGroup
- Rename `arguments` to `options` since it can include `AppCommand` and `AppCommandGroup`.
2022-06-11 13:46:18 -04:00
ae51d5849a Fix typos in AppCommandPermissions attributes doc 2022-06-07 04:23:22 -04:00
377dde4e4e Change app command permission models guild to not be None 2022-06-07 01:56:44 -04:00
3aa55ba1ed Implement Application Command Permissions models 2022-06-07 01:35:33 -04:00
573b2121b7 Add support for NSFW application commands
Of course, this somehow doesn't work with subcommands
2022-05-22 19:20:37 -04:00
bd727d2b0c Add edit and delete methods to AppCommand 2022-05-05 06:20:55 -04:00
4a73de946a Change dm_permissons to dm_permission 2022-05-02 18:25:42 -04:00
d774b4ac7a Add back tuple __slots__ for AllChannels 2022-05-01 20:10:56 -04:00
ca33824ba2 Change AllChannels.id into a property rather than a slot 2022-05-01 19:41:45 -04:00
619bc50e5d Add application command permissions to audit log 2022-05-01 18:59:57 -04:00
3b3d4d3880 Add support for setting and receiving permissions v2
Closes #7592

This does not include audit log changes or the remaining endpoints.
That will come in a different commit.
2022-04-28 00:23:36 -04:00
6986733833 Revert "Validate Option names similar to slash command names"
This reverts commit 6ef2043b10.
2022-04-01 06:58:11 -04:00
6ef2043b10 Validate Option names similar to slash command names 2022-04-01 00:09:02 -04:00
5ffa3e85de Update comments after # type: ignore to be compatible with PEP 484 2022-03-27 22:26:34 -04:00
1192d842e1 Fix some type checker errors and remove some type ignores
Caught from an upgraded Pyright
2022-03-16 01:46:58 -04:00
5aa696ccfa Fix typing issues and improve typing completeness across the library
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
Co-authored-by: Josh <josh.ja.butt@gmail.com>
2022-03-13 23:52:10 -04:00
bbf7a7981b Ensure all choices are the same type as the parameter type
Fixes #7625
2022-03-11 07:29:11 -05:00
aa74238053 Reorganise documentation for interactions 2022-03-04 21:17:27 -05:00
ae1aaac5a7 Add support for autocomplete 2022-03-01 05:42:44 -05:00
4e04dbdec7 Add support for choice option parameters
This implements it in three different ways:

* The first is using typing.Literal for quick and easy ones
* The second is using enum.Enum for slightly more complex ones
* The last is using a Choice type hint with a decorator to pass
  a list of choices.

This should hopefully cover most use cases.
2022-03-01 05:42:44 -05:00
0d2db90028 Implement slash commands 2022-03-01 05:35:29 -05:00