312 Commits

Author SHA1 Message Date
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
Rapptz
275a754abd Add support for editing message attachments 2021-04-21 23:45:06 -04:00
Nadir Chowdhury
95777230b0
Add MessageType.guild_invite_reminder 2021-04-18 20:33:56 -04:00
Steve C
86f10f6dd6
Add missing reprs to some objects
These are WidgetMember, BaseUser, and DeletedReferencedMessage
2021-04-17 18:56:08 -04:00
Rapptz
fed259a83b Refactor save() and read() into AssetMixin 2021-04-17 00:56:38 -04:00
Rapptz
f6fcffbab5 Use default allowed_mentions in Message.edit
Fix #6745
2021-04-16 23:00:18 -04:00
Rapptz
6ba3d89076 Revert Attachment.save code to prior implementation 2021-04-16 11:38:56 -04:00
Rapptz
9eaf1e85e4 Rewrite Asset design
This is a breaking change.

This does the following transformations, assuming `asset` represents
an asset type.

Object.is_asset_animated() => Object.asset.is_animated()
Object.asset => Object.asset.key
Object.asset_url => Object.asset_url
Object.asset_url_as => Object.asset.replace(...)

Since the asset type now requires a key (or hash, if you will),
Emoji had to be flattened similar to how Attachment was done since
these assets are keyed solely ID.

Emoji.url (Asset) => Emoji.url (str)
Emoji.url_as => removed
Emoji.url.read => Emoji.read
Emoji.url.save => Emoji.save

This transformation was also done to PartialEmoji.
2021-04-16 11:27:23 -04:00
Nadir Chowdhury
d3ac191a67
Restrict snowflake regexes to 15-20 digits 2021-04-16 07:33:44 -04:00
Nadir Chowdhury
8f9819eb4c
[docs] Fix various unresolved references 2021-04-15 22:41:41 -04:00
Rapptz
da6119e04c Fix fail_if_not_exists not being set when constructed with state 2021-04-14 00:50:37 -04:00
Rapptz
99fc950510 Use f-strings in more places that were missed. 2021-04-08 06:02:47 -04:00