273 Commits

Author SHA1 Message Date
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
jack1142
686f233954
Add missing information about in-place edits in Message.edit 2022-02-19 22:35:52 -05:00
Josh
dede5539ee
Add support for editing message attachments 2022-02-19 22:02:53 -05:00
jack1142
dc19c6c7d5
Add positional-only arguments in more places 2022-02-19 20:28:01 -05:00
Alex Nørgaard
2e5da07180
Fix unknown DMChannel in MessageReference.resolved.channel
Threads would cause the message reference to resolve to a DMChannel
2022-02-18 20:26:13 -05:00
Josh
ce01033e06
Allow PartialMessage.channel to be a PartialMessageable 2022-02-18 08:31:07 -05:00
Rapptz
770a5fee9c Remove PartialMessage.edit duplicated code
Now that Message.edit returns the message this duplication is no longer
needed.
2022-02-18 07:48:43 -05:00
Rapptz
9c066a8cf6 Refactor internal message sending and editing parameter passing
This reduces some repetition in many functions and is ripped out of
the webhook code. This also removes the unused HTTP functions for
interaction responses since those belong in the webhook code rather
than the HTTPClient.
2022-02-18 07:47:59 -05:00
Josh
08bee0eeb6
Add support for file/attachment descriptions 2022-02-18 05:23:02 -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
8306b9f6af Add type hint for suppress parameter 2021-08-23 23:51:40 -04:00
Rapptz
490bbffc93 Remove in-place edits and return fresh instances instead
Fixes #4098
2021-08-23 23:46:50 -04:00
Rapptz
8bbb8f6db9 Use getattr for default_auto_archive_duration in Message.create_thread
Some channel types do not have this attribute so a fallback is
necessary to prevent the attribute access from erroring.
2021-08-23 23:44:20 -04:00
Stocker
d8b06ca7f2
Fix message.py typehints 2021-08-23 23:43:57 -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
3b4c6269be Fix documentation for Message.is_system
Also fixes some formatting
2021-08-18 01:01:24 -04:00
AkshuAgarwal
6b6bcb92e6
Fix missing or broken versionadded in docstrings
This also documents BadFlagArgument.flag
2021-08-18 00:45:02 -04:00
SYCKGit
f7a3ea90b8
Add other message types exclusions to Message.is_system
Message.is_system was checking if self.type is MessageType.default
but now there are other MessageTypes that are not system messages
2021-08-18 00:42:48 -04:00
Rapptz
1e17b7fcea Rename start_thread to create_thread for consistency 2021-08-12 00:30:50 -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
Nadir Chowdhury
60d82cf908
implement guild stickers 2021-07-30 21:25:41 -04:00
Rapptz
dac0267e28 Allow creating a public thread without a starter message 2021-07-28 23:50:02 -04:00
nickofolas
0112c2819f
Fix PartialMessage rejecting Threads 2021-07-28 20:00:43 -04:00
Lilly Rose Berner
a053f77275
Add system_content for thread message types, fix other system_content issues 2021-07-28 20:00:14 -04:00
Nadir Chowdhury
e2624b9a31
[commands] Fix (Partial)MessageConverter to work with thread messages 2021-07-10 03:11:34 -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
3d0dd5bc1b Change Message.__repr__ to show inherited type name 2021-07-03 11:02:32 -04:00
Josh
d001b9d0ee
[docs] Fix more references
Co-Authored-By: Riley Shaw <30989490+ShineyDev@users.noreply.github.com>
2021-07-01 07:48:37 -04:00
Rapptz
1aeec34f84 Typehint Member and various typing fixes 2021-06-30 01:28:35 -04:00
Rapptz
44d1d29708 Add explicit types to variables in Message types 2021-06-29 23:56:02 -04:00
Lilly Rose Berner
6b1d46a1ea
Set Message.guild from guild_id if unavailable through Message.channel 2021-06-28 19:03:59 -04:00
Rapptz
b1836c5577 Rework Message.edit implementation 2021-06-28 00:33:59 -04:00
Aomi Vel
47e6a754e4
Add support for sending multiple embeds 2021-06-27 23:52:48 -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
ac95b8b85b Allow Message.channel to be a thread 2021-06-08 07:25:40 -04:00
Rapptz
c1ce3b949f Implement remaining HTTP endpoints on threads
I'm not sure if I missed any -- but this is the entire documented set
so far.
2021-06-08 07:25:30 -04:00
Lilly Rose Berner
fb0c6c56e1
Return message content for replies in Message.system_content 2021-06-06 17:31:32 -04:00
Rapptz
d0097c4281 Remove view syncing before editing in views
This prevents a potential race condition when a MESSAGE_UPDATE is
received syncing and refreshing the view components causing a desync.
2021-05-31 05:50:40 -04:00
Rapptz
4a3491cc0a Check for view finished state before resuming listening on edit 2021-05-31 00:18:06 -04:00
Rapptz
8dafe4f544 Add support for editing in views in PartialMessage 2021-05-31 00:17:35 -04:00
Rapptz
02c317d9a4 Fix Message.edit typings to take View parameters 2021-05-30 00:00:24 -04:00
Rapptz
98570793e4 Add initial support for buttons and components 2021-05-27 00:53:13 -04:00
Alex Nørgaard
fb20c4c3d4
Update docs for (Partial)Message.publish to reflect the actual permissions needed 2021-05-15 02:08:16 -04:00
Nadir Chowdhury
757cfad38f
Type up **kwargs of various methods 2021-05-10 20:24:48 -04:00
Rapptz
ca92f37f18 Fix typings in message.py 2021-05-05 23:05:15 -04:00
Rapptz
83611edb66 Fix supressing messages leading a 400 error
This only makes it so allowed_mentions are passed if the message is
authored by the bot itself.
2021-05-01 11:46:27 -04:00
Rapptz
135a7e9e5a Reformat message.py file 2021-05-01 09:54:19 -04:00
Rapptz
d940486552 Add types to PartialMessage 2021-05-01 09:48:37 -04:00
Zomatree
3381d1e089
Add typings for message related classes 2021-05-01 08:51:13 -04:00