224 Commits

Author SHA1 Message Date
Neon Jonn
adb69e7157
Fix some spelling mistakes 2022-03-10 20:45:16 -05:00
Stocker
e15415413b
Add missing parameters to certain methods
- slowmode_delay and reason in Message.create_thread
- slowmode_delay in TextChannel.create_thread
- reason in Guild.edit_widget
2022-03-06 23:00:50 -05:00
Haruka
1bfe3bdff1
Fix bug in PartialMessageable.trigger_typing 2022-03-06 19:35:20 -05:00
Josh
147948af9b
Use typing.Self throughout library 2022-03-01 07:53:24 -05:00
Nadir Chowdhury
3c6279b947
Implement Guild Scheduled Events 2022-03-01 01:00:04 -05:00
Josh
2b69b5d545
Remove discord.InvalidArgument
This uses TypeError and ValueError instead.
2022-02-26 01:44:49 -05:00
Vaskel
86797dd9ab
Add reason param to purge and delete_messages
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
2022-02-26 01:27:28 -05:00
jack1142
fd4c5a65ed
Remove topic from StageChannel.edit's overload 2022-02-23 10:13:54 -05:00
Rapptz
0eb2f32399 Remove VoiceRegion enum and Guild.region attribute
This has been marked deprecated by Discord and it was more or less
usually out of date due to the pace they added them anyway.
2022-02-23 10:03:13 -05:00
Josh
3ce00abeae Fix some type-check errors 2022-02-22 03:59:58 -05:00
Rapptz
6c2ea4f0a0 Fix some type ignores in backoff and channel 2022-02-21 22:43:19 -05:00
mniip
22b06e7bf8
Fix TextChannel.archived_threads
Threads are now returned in a consistent order if multiple requests are
made. The server-side limit is [2, 100] threads per request.
2022-02-21 21:53:40 -05:00
jack1142
45b9585910
Remove versionchanged in PartialMessageable 2022-02-20 21:20:25 -05:00
Rapptz
88b520b5ab Reformat code using black
Segments where readability was hampered were fixed by appropriate
format skipping directives. New code should hopefully be black
compatible. The moment they remove the -S option is probably the moment
I stop using black though.
2022-02-20 08:04:58 -05:00
Josh
4dbe1af32f
Update sphinx and fix documentation issues 2022-02-19 22:35:32 -05:00
Kaylynn Morgan
588cda0996
Refactor AsyncIter to use 3.6+ asynchronous generators 2022-02-19 21:58:13 -05:00
jack1142
dc19c6c7d5
Add positional-only arguments in more places 2022-02-19 20:28:01 -05:00
Josh
4248bb3717
Add invitable to TextChannel.create_thread 2022-02-18 05:24:40 -05:00
James Gayfer
4aafa39e8c
Update thread permissions
Discord has renamed / repurposed "Use Public Threads" and "Use Private
Threads", as well as added a new permission "Send Messages in Threads".

For more information, see:
  https://github.com/discord/discord-api-docs/pull/3672
2021-08-26 15:53:21 -04:00
Rapptz
dd7d4b8e7f Use a thread values view when constructing TextChannel.threads
Avoids an accidental O(n^2) situation.
2021-08-25 20:42:21 -04:00
Rapptz
490bbffc93 Remove in-place edits and return fresh instances instead
Fixes #4098
2021-08-23 23:46:50 -04:00
Stocker
ae01a96bef
Add missing type: ignore and missing typehint to channel.py 2021-08-23 21:03:56 -04:00
James Gayfer
489e5f3288
Use channel default auto archive duration
Currently creating a new thread uses a default auto archive duration of
1440 minutes, or 1 day.

Rather than prescribing our own default, we can use the default auto
archive duration that is set on the channel. This ensures that newly
created threads will respect the default auto archive duration as
prescribed by the user.
2021-08-18 05:12:40 -04:00
Rapptz
b73f02b9c3 Remove deprecated TextChannel.active_threads for Guild version
This also fills in the ThreadMember data from the endpoint
2021-08-18 01:52:24 -04:00
la
8ac5cdc314
Fix Guild.fetch_channel not working for threads 2021-08-18 00:45:45 -04:00
AkshuAgarwal
6b6bcb92e6
Fix missing or broken versionadded in docstrings
This also documents BadFlagArgument.flag
2021-08-18 00:45:02 -04:00
Rapptz
1e17b7fcea Rename start_thread to create_thread for consistency 2021-08-12 00:30:50 -04:00
Rapptz
fda543c844 Fix incorrect indent 2021-08-11 06:25:22 -04:00
Rapptz
dc9c224b54 Undo coercion of partial DMChannel to PartialMessageable 2021-08-10 22:10:45 -04:00
Rapptz
1279510194 Add support for PartialMessageable instances
This allows library users to send messages to channels without fetching
it first.
2021-08-10 09:24:49 -04:00
Rapptz
58ca9e9932 Add TextChannel.default_auto_archive_duration 2021-08-02 04:36:02 -04:00
Rapptz
f72350199d Fix typo in TextChannel.start_thread 2021-07-31 22:55:32 -04:00
Rapptz
dac0267e28 Allow creating a public thread without a starter message 2021-07-28 23:50:02 -04:00
PythonCoderAS
51b02f2568
Change type to be compatible with the overwrites property 2021-07-28 19:59:38 -04:00
Nadir Chowdhury
96b9a0e09d
Add reason kwarg to more methods 2021-07-28 19:54:32 -04:00
Steve C
834e23dc00
Fix type annotations for purge's limit param on Thread/TextChannel
Optional was missing.
2021-07-21 02:44:27 -04:00
Rapptz
74e1ab09a0 Remove channel type coercion in factory methods
This caused unnecessary isinstance checks which were slowing down
channel creation at scale
2021-07-07 20:19:17 -04:00
Alex Nørgaard
d1dc41ec2f
Fix Client.fetch_channel not returning Thread 2021-07-03 21:35:31 -04:00
Rapptz
8b4dd34328 Document TextChannel.start_thread return type 2021-07-03 11:52:20 -04:00
Rapptz
62dad0f7bf Fix potential None access in various StageChannel properties 2021-06-30 01:31:57 -04:00
Rapptz
ea1d423904 Check for None in VocalGuildChannel.voice_states 2021-06-29 23:16:39 -04:00
Rapptz
2beee8be14 Type hint channel.py 2021-06-29 03:37:52 -04:00
Lilly Rose Berner
b59ec318c0
Fix Category.create_x_channel raising without overwrites 2021-06-28 00:00:51 -04:00
Josh
233d10649c
[docs] Update Sphinx and Fix various references
Co-Authored-By: Riley Shaw <30989490+ShineyDev@users.noreply.github.com>
2021-06-27 23:43:49 -04:00
Rapptz
7dccbace78 Refactor Guild to support type hints
This patch also does the following:

* Sets some parameters to be positional only
* Changes Guild.edit to use the MISSING sentinel
* Changes the various create_channel methods to be type safe
* Changes many parameters from Optional[T] to use MISSING
* Changes Guild.create_role to use MISSING sentinel

This refactor is mostly partial but lays a decent foundation
2021-06-08 10:56:26 -04:00
Rapptz
4b51e3e253 Add TextChannel.active_threads 2021-06-08 07:26:22 -04:00
Rapptz
d0d2d7ea62 Clarify actions that require manage_threads permission 2021-06-08 07:26:22 -04:00
Rapptz
3a421a3eb9 Add TextChannel.get_thread shortcut helper 2021-06-08 07:26:22 -04:00
Rapptz
b2176dc0ef Change how threads are created
Instead of start_public_thread and start_private_thread they'll now be
one method.

I might revert this if starting a public thread without a message never
ends up happening.
2021-06-08 07:26:22 -04:00
Rapptz
51cc7622a6 TextChannel.archived_threads is not a coroutine 2021-06-08 07:25:40 -04:00