Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: merge stable into documentation (#1113)
* feat: add command and option name in Exception message (#1015) * refactor: remove `Client.__resolve_events` and associated events, since they do nothing (#1019) * feat: add download helper method for Attachments (#1016) * fix(autocomplete dispatch): ID -> name (#1010) * fix: Change the autocomplete dispatch from ID -> name to allow multi-guild functionality when scope is used * ci: correct from checks. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat: add helper methods for component disabling (#1018) * feat: add helper methods for component disabling * ci: correct from checks. * fix: actually return Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * refactor: turn MISSING into a more proper sentinel (#1007) * feat: turn MISSING into a more proper sentinel * docs(docstring): Update `_Missing`'s docstring * feat: Add ``presence`` property to ``User`` (#1005) * feat: Add ``presence`` property to ``User`` * ci: correct from checks. * make optional * ref: remove `"` in docstring Co-authored-by: Max <maxyolo01.ytb@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Max <maxyolo01.ytb@gmail.com> * refactor!: rename outdated channel type names to new (#1024) * refactor!: Rename outdated channel type names to new * refactor: change types in code Co-authored-by: DeltaX <33706469+DeltaXWizard@users.noreply.github.com> * ref!: set GuildMember as a subclass of Member (#1023) * ref!: set GuildMember as a subclass of Member * ci: correct from checks. * revert: add back original functions * ci: correct from checks. * fix: remove other branch git sorcery * ci: correct from checks. * fix: last github fix Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat: Implement ``AllowedMentions`` object (#1002) * feat!: Implement ``AllowedMentions`` object * replace ``MessageInteraction``(what it do here lol) to ``AllowedMentions`` * ref: add to ``__all__`` * ci: pre-commit * typehints * Allow pass dict * ci: correct from checks. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat!: Completely redo gateway process. (#1022) * feat: Implement barebones GW ratelimiter, implement resume url usage. This also refactors some attributes to utilise the ratelimiter and more importantly, the heartbeat loop. (It still works the same!) * feat: Refactor variable switching, optimise seq definitions, written primitive restart command. * feat!: Cache websocket url, completely redo WS client process/instantiation and client login process, implement ratelimiter to GW process * docs, chore: Remove unused code/imports/log prints, optimise docs/slots * docs, chore: Remove/refactor unused comments, document and typehint ratelimiter object * docs: Fix misprint on log debug division * feat: Implement a _stop() client function. * fix: Supress error code 4001. * fix: Change to int value conversions for payload, readd afk attribute to ClientPresence object, revert suppress 4001 commit. * docs, refactor: Tweak ratelimit functions to properties, redo ratelimit documentation and usage of logger exceptions * docs: Tweak ratelimit delay description * fix: Fix changing client presence to IDLE without providing activities attribute * refactor!: Rename __task attribute to _task * refactor: improve the PR template again (#1029) * refactor: improve the PR template again * refactor: improve the PR template again * Fix: modify method in client (#1027) * Fix: modify method in client * ci: correct from checks. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat!: Add a guild id property for the member object (#1025) * feat!: Add a guild id property for the member object * Update interactions/api/models/member.py Co-authored-by: Max <maxyolo01.ytb@gmail.com> * ci: correct from checks. * ref: use self._extras * ci: correct from checks. * ref: raise an exception when not present * ci: correct from checks. * Update gw.py * Update member.py * feat: ensure a guild_id in _extras whenever possible Co-authored-by: Max <maxyolo01.ytb@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * refactor: optmize the project structure (#1028) * feat!: Add a guild id property for the member object * refactor: optimize project structure * revert: stuff from other branch * refactor: move missing from stub files * fix: resolve new circular imports * fix: ``Embed.set_field_at`` doesn't update json (#1033) * fix: Member.get_avatar_url now returns None when guild avatar is not present (#1035) * docs: update FAQ and quickstart documentation links (#1038) * Docs: add back previous changes * docs: fix outdated links in the quickstart (#1037) Co-authored-by: Damego <damego.dev@gmail.com> * refactor: optimize how autodefer works (#1012) * fix: consider self when auto-deffering in extensions * revert: remove unwanted change * refactor: don't check for "self" * add extension typehint * chore/ADMIN: repoint GitHub All funds I receive from sponsors for interactions.py will ALWAYS go to interactions.py. All that is being changed is to repoint to the proper URL. * refactor(bot, gateway, http): Remove any unclosed client session messages (#1014) * fix: command options and choices doesn't syncs (#1046) * fix: command options doesn't syncs * ci: correct from checks. * Update interactions/client/bot.py Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix: Set the websocket's token without referencing the httpclient (#1045) * fix: Set the websocket's token without referencing the httpclient * fix: correct the websocket's headers * ci: correct from checks. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat: Add `APPLICATION_COMMAND_BADGE` to `AppFlags` (#1044) * fix: Mitigate gateway null responses. (#1053) * fix: Handle gateway stream when None is given. * refactor: Change occurrence of heartbeater task recreation (This just mitigates an edgecase of heartbeating when the wsclient is None. * chore: pre-commit ci * refactor: move getting bot info to `_ready` (#1055) * fix: add missing parenthesis (#1058) * chore: bump version and add catalyst to authors (#1030) * chore: bump version and add catalyst to authors * No one saw this * Update PULL_REQUEST_TEMPLATE.md * Update .github/PULL_REQUEST_TEMPLATE.md Co-authored-by: Damego <damego.dev@gmail.com> * ci: correct from checks. Co-authored-by: Damego <damego.dev@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix: Change event sets, fix proper close() WS handling (#1061) * docs(Embed): change description of field's index (#1051) * feat: Add helper methods for sticker (#1047) * feat: Add helper methods for sticker * fix: add missed return * fix: lmao discord * refactor: add missed client check * ref: optional return Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> * docs: optional return Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> * docs: improve docstings Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> * ci: correct from checks. * feat: add support for `str` type Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> * docs: improve docstings Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> * ref: remove check for `Snowflake` type Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> * ci: correct from checks. * docs: improve docstings Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> * ref: remove check for `Snowflake` type Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> * ci: correct from checks. * feat: add `str` support Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> * ci: correct from checks. * fix: description is optional but not optional? * ci: correct from checks. * ref: use None * refactor: add missed converter * refactor: remove sticker from guild and add some checks * refactor: add `StickerPack` to `__all__` * ci: correct from checks. Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat: create `Context.has_permissions()` & `Member.has_permissions()` (#1056) * feat: create `Context.has_permissions()` & `Member.has_permissions()` * ci: correct from checks. * Update interactions/api/models/member.py Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> * fix: guild could be unbound Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> * feat&fix: Implement `Guild.get_scheduled_events` & fix iso (#1043) * feat&fix: Implement `Guild.get_scheduled_events` & fix iso * ci: correct from checks. * fix: check for None Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat: Add base iterators & context managers + helpers (#1057) * fix: small but annoying bug * feat: Add channel history async iterator * docs: change docstring * feat: add `get_channel_history` utility method * fix: add client safeguard * feat: add maximum amount to get * refactor/feat: Create an ABC and update the channel history iterator accordingly * feat/refactor: add checks and move files * docs: fix strings * chore: remove print * fix: add check to channel history iter * fix: add check to channel history iter * feat: make the guild members iterator * fix: type annotation * fix: correct id key * fix: make `maximum` `inf` * fix: math is hard... * feat: Add normal `BaseIterator` * chore: make comment * refactor: change import paths to relative * fix: path * feat: add context managers * feat: add typing context manager * feat: add new attributes and `get_guild_members` utility method * fix: speling (typo intended) * fix: import context managers * Update utils.py * ci: correct from checks. * Update utils.py * Update base_iterators.py * ci: correct from checks. * Update base_iterators.py * Update channel.py * Update guild.py * Update guild.py * ci: correct from checks. * Update channel.py * ci: correct from checks. * Update base_iterators.py * Update base_context_managers.py * ci: correct from checks. * Update base_iterators.py * ci: correct from checks. * Update base_iterators.py * Update channel.py * Update guild.py * Update base_context_managers.py * Update channel.py * Update base_context_managers.py * ci: correct from checks. * Update channel.py * Update base_context_managers.py * Update channel.py * ci: correct from checks. * Update base_context_managers.py * ci: correct from checks. * Update base_context_managers.py * ci: correct from checks. * Update base_context_managers.py * Update base_iterators.py * ci: correct from checks. * Update channel.py * ci: correct from checks. * Update guild.py * Update guild.py * ci: correct from checks. * Update utils.py * ci: correct from checks. * Update base_iterators.py * Update utils.py * ci: correct from checks. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * feat: Add full support for prune endpoints (#1062) * feat: Add `begin_guild_prune` * Update guild.py * Update guild.py * Update guild.py * Remove weird 7 formatting thing * ci: correct from checks. * Add min max counts * Update guild.py * ci: correct from checks. * Add min max to helpers * Fix numbers (sorry ed) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * refactor: Enable repr for all models (#1026) * refactor: Enable repr for all models * ci: correct from checks. * Feat: enable everything into the repr * set channel reprs * ci: correct from checks. * Update emoji.py * Update channel.py * Update member.py * Update guild.py * ci: correct from checks. * Update message.py * Update webhook.py * Update user.py * Update team.py * Update role.py * Update attrs_utils.py * ci: correct from checks. * Update member.py * ci: correct from checks. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Fix force http (#1068) * docs: update FAQ and quickstart documentation links (#1038) * Docs: add back previous changes * docs: fix outdated links in the quickstart (#1037) Co-authored-by: Damego <damego.dev@gmail.com> * fix forcing http add force_arg which takes the pop argument to checking it twice. * ci: correct from checks. Co-authored-by: DeltaX <33706469+DeltaXWizard@users.noreply.github.com> Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> Co-authored-by: Damego <damego.dev@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * refactor(cache): optimize caching and dispatching behaviour (#1039) * refactor: just refactor 1. Moved getting object ID into separated method. 2. Add method to get object ids. Needs for `message_delete_bulk`, `emoji_update` and `stickers_update` 3. Cache `GuildMember` like `Member` 4. Deleting messages from cache on `message_delete_bulk` event * chore: run pre-commit * refactor: merge conditions into one * refactor: add emojis to guild cache in attrs_post_init * fix: typo * refactor: move message cache control to method - Remove message from cache on `message_delete` event * ci: correct from checks. * fix the fix of bug * docs: capitalize return and ` to ' * refactor: leave only `message` * ref: move `__modify_guild_cache` to own method * ci: correct from checks. * docs: add and update docstrings * refactor: properly caching members and roles * ci: correct from checks. * refactor: refuse from raw remove events and ... put `obj` to `__modify_guild_cache` if guild_obj is None * ci: correct from checks. * fix: `guild_obj` referenced before assignment * fix: help me There are only two models which can be converted to model without `Guild` prefix. * refactor: use walrus operator Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> * fix: add missed obj to dispatch * refactor: remove extra dispatch * refactor: message already removed from cache? * refactor: remove `__delete_message_cache` * refactor: dispatch `guild_emojis_update` without `raw` * ci: correct from checks. * refactor: change condition for `ids` * refactor: change condition in getting ids * feat: add support for `_execution` events * refactor: dispatch update event if there are no id & ids * revert: add support for `_execution` event * refactor: some stuff * refactor: use `cache.merge` to resolve guild overloading Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> * fix: Fix constant gateway resume/invalid session loop. (#1070) * fix: Added zlib + compression, disabled msg size limit * fix: Removed `$` on identify call for future-proofing. * Fix force http for lists (#1069) * fix get list when forced * Update interactions/utils/get.py Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> * Update interactions/utils/get.py Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> * Update interactions/utils/get.py Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> Co-authored-by: EdVraz <88881326+EdVraz@users.noreply.github.com> * fix: `mention` in `Member()` being NoneType (#1063) * docs: Fix description in ``set_rate_limit_per_user`` * feat: Adding ``premium_progress_bar_enabled`` for ``Guild`` * feat: Adding ``communication_disabled_until`` in GuildMember Gateway dispatch * ci: correct from checks. * fix: Fix `mention` being NoneType * chore: Update interactions/api/models/member.py By Toricane's suggestion. Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com> * refactor: make Command.dispatch a function (#1040) * refactor: make Command.dispatch a function * docs(docstrings): update the docstring for Command.dispatcher * docs(docstrings): fix the docstring for `command.dispatcher` Co-authored-by: Catalyst4 <catalyst4222@gmail.com> * fix: fix gateway resumes (#1071) * fix: fix gateway resumes * fix: remove errant quotation * feat: add compression type delta asked me to add this * fix: Add zlib-stream compression in accordance with #1071 (#1072) * fix: Added zlib + compression, disabled msg size limit * fix: Removed `$` on identify call for future-proofing. * fix: Add zlib-stream compression in accordance with #1071 * refactor: Change type of parameters in scheduled event requests from Snowflake to int (#1067) * refactor * ci: correct from checks. * Minor rephrase of docstring param Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * ci: weekly check. (#1073) updates: - [github.com/psf/black: 22.6.0 → 22.8.0](psf/black@22.6.0...22.8.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix: autodefer with args and kwargs in commands (#1074) * fix: args and kwargs in commands * fix: autodefer errors * feat(guild)!: Converting `delete_message_days` in ban method to seconds (#1077) * docs: Fix description in ``set_rate_limit_per_user`` * feat: Adding ``premium_progress_bar_enabled`` for ``Guild`` * feat: Adding ``communication_disabled_until`` in GuildMember Gateway dispatch * ci: correct from checks. * fix: Fix `mention` being NoneType * chore: Update interactions/api/models/member.py By Toricane's suggestion. Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com> * feat: Converting `delete_message_days` in ban method to seconds * ci: correct from checks. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com> * fix: warn for no app cmd scope for disable_sync (#1076) * feat: Implement barebones Forum channel support. (#766) * docs, feat: Implement barebones Forum channel support. * docs: Update channel attributes. * feat: Implement barebones create thread in forum function. * feat: Implement tags support, implement creating post in Forums. * fix: Include headers. * chore: Remove redundant slots, update flag headers. * feat: Apply previous forum breaking change, document tags in http method. * feat: Utilise reconnection lock for packet sending. (#1083) * chore: bump version (#1084) * Revert "refactor: make Command.dispatch a function (#1040)" (#1091) This reverts commit b1d2787. * fix: Fix race condition when reconnecting (#1090) * feat: Utilise reconnection lock for packet sending. * chore: bump version * fix: Fix race condition when reconnecting and identifying/resuming using the shared reconnect lock. * feat: add new auditlog events (#1088) * feat: implement forum helpers (#1087) * feat: helpers helpers helpers * docs: helpers helpers helpers * Update error.py * docs: Change type annotations for `Overwrite` args (#1086) * feat: add `__getattr__` to Member to get attributes from User (#1080) * refactor!: add ``event`` to ``raw_socket_create`` dispatch (#992) * refactor!: add ``event`` to ``raw_socket_create`` dispatch * docs: update info about ``raw_socket_create`` * refactor: improve error message formatting (#1079) * refactor: improve error message formatting * revert: oop- * feat: Add support for `REQUEST_MEMBERS` packet sending (#1089) * feat: Add `REQUEST_MEMBERS` support * fix: attributeerror * refactor: convert to `Member` & add http * refactor: change typehints * Update interactions/api/gateway/client.py Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com> * Update interactions/api/gateway/client.py Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com> * ref: optimize condition * refactor: use elif Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com> * feat: allow embed suppression in interaction responses (#1094) * feat: allow embed suppression in interaction responses * docs(docstrings): add toricane's suggestion Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com> * docs(docstrings): add toricane's suggestion (Again) Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com> Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com> * feat: implement a debug setting for the client (#1081) * refactor: give the bot an overrideable logging configuration * credits * ref: change to debug setting * refactor: requested changes * feat: add the client, command, and extension to CommandContext instances (#1093) * feat: add the client, command, and extension to CommandContext instances * docs(docstrings): Update ivars * fix: `ComponentContext.label` not updated to reflect component models (#1096) * Update misc.py * ci: correct from checks. * Update context.py * Update context.py * fix precommit * Revert changes to misc.py * revert unwanted changes * ci: correct from checks. * revert unwanted changes again * Update context.py * Update interactions/client/context.py Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com> * fix: add HTTPClient to CommandContext.target (#1097) * refactor: Rename create_post_in_forum method to create_forum_post * fix: Add attachment import in create_forum_post method * fix: Add message_payload to payload in create_thread_in_forum http method (#1101) * Fix the thing * ci: correct from checks. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix: Replace message_payload with message (#1102) * Update thread.py * Update thread.py * Update channel.py * ci: correct from checks. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix: autodefer erroring when *args is empty (#1103) * chore: bump version (#1106) * docs: Fix missing pages and duplicate type referencing. (#1105) * docs: Update doc utils version, update docs to account for utils architecture layout. * docs: Fix python library and utils pointer at quickstart.rst * docs: Update locale. * docs: Reduce redundancy of type references (deduplication) * docs: Update locale. * docs: Add emoji model to docs. * docs: Fix emoji header typo. * fix: fix incorrect typehint in audit log helper method (#1108) * feat: Implement send method for User class. (#1109) Co-authored-by: Ryan <11697683-Rqtl@users.noreply.gitlab.com> Co-authored-by: Max <maxyolo01.ytb@gmail.com> Co-authored-by: Catalyst4 <84055084+Catalyst4222@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Damego <damego.dev@gmail.com> Co-authored-by: Damego <danyabatueff@gmail.com> Co-authored-by: DeltaX <33706469+DeltaXWizard@users.noreply.github.com> Co-authored-by: Nan R <88463477+Nanrech@users.noreply.github.com> Co-authored-by: i0 <41456914+i0bs@users.noreply.github.com> Co-authored-by: Donbur4156 <janpfister@t-online.de> Co-authored-by: Blue <60958064+Jimmy-Blue@users.noreply.github.com> Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com> Co-authored-by: Catalyst4 <catalyst4222@gmail.com> Co-authored-by: LordOfPolls <ddavidallen13@gmail.com> Co-authored-by: Astrea <25420078+Astrea49@users.noreply.github.com> Co-authored-by: GeomKid <51281740+GeomKid@users.noreply.github.com> Co-authored-by: ItsRqtl <itsrqtl@gmail.com> Co-authored-by: Ryan <11697683-Rqtl@users.noreply.gitlab.com>
- Loading branch information