218 Commits

Author SHA1 Message Date
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
Nadir Chowdhury
2ff24a27b5
Use asyncio.create_task over asyncio.ensure_future 2021-04-05 20:31:03 -04:00
Logan
3abb2fde56
Fix versionadded not showing in docs for Attachment.content_type 2021-04-05 20:24:04 -04:00
Rapptz
ff7094ce96 Convert datetimes to aware datetimes with UTC.
Naive datetimes will now be interpreted as local time throughout
the library.
2021-04-04 23:54:08 -04:00
Rapptz
54288879e2 Remove userbot functionality
This has a lot of legacy and cruft so there may be some stuff I've
missed but this first pass is enough to get a clear separation.
2021-04-04 10:15:30 -04:00
Rapptz
9d39b135f4 Modernize code to use f-strings
This also removes the encoding on the top, since Python 3 does it by
default. It also changes some methods to use `yield from`.
2021-04-04 07:03:53 -04:00
Zomatree
f8d7be5b78
Add content_type to Attachment 2021-04-03 23:26:28 -04:00
Lilly Rose Berner
f60e91d700
Add support for fail_if_not_exists in MessageReference 2021-03-30 00:26:17 -04:00
Edwin
31ee3fafc1
Add remove_markdown helper function 2021-03-28 18:38:34 -04:00
Rapptz
5cb5126548 Make Attachment hashable and castable to str 2021-03-25 09:08:22 -04:00
Nadir Chowdhury
7d345e8e4e
remove trailing whitespace 2021-03-13 00:42:25 -05:00
Nadir Chowdhury
d01500bccd
Fix typo with guild_discovery_grace_period_final_warning 2021-03-02 06:45:24 -05:00
Nadir Chowdhury
6f748e5da5
Add remaining v6 message types 2021-02-23 03:57:11 -05:00
Nadir Chowdhury
427e387a2f
Deprecate non-bot methods 2021-02-23 03:36:37 -05:00
Rapptz
0cd1a88316 Clarify Message.nonce documentation
Fix #2451
2021-02-18 00:23:58 -05:00
Peter Delevoryas
af67256949
Ensure Message.call is None by default
`Message` has an attribute `call` which is claimed to have type
`Optional[CallMessage]`. 

But `Message` doesn't actually ensure that `call` is initialized to a value in
`__init__`. This commit fixes that inconsistency.
2021-02-06 05:42:22 -05:00
z03h
d752916995
Add MessageReference.jump_url 2021-01-17 00:21:00 -05:00
Anurag Singh
941e1efcb6
PartialMessage.edit returns a full Message 2021-01-15 07:10:20 -05:00
Nihaal Sangha
69bdc3a184
Change copyright year to present 2021-01-15 05:28:11 -05:00
Misa
5d75a0e7d6
Capitalize Discord in docs of message related attributes 2020-12-26 02:34:22 -05:00
Rapptz
52d587d286 Allow PartialMessage to work with DM channels as well 2020-12-11 02:32:51 -05:00
Rapptz
186f4968d3 Export to_message_reference_dict to make PartialMessage.reply work 2020-12-11 00:39:05 -05:00
Rapptz
ebf623d9de Add operations you can do to a Message and PartialMessage to docs 2020-12-11 00:32:38 -05:00
Rapptz
3fe6d261f1 Add PartialMessage to allow working with channel/message_id pairs.
Fix #5905
2020-12-11 00:32:38 -05:00
Rapptz
b00aaab0b2 Revert Message.edit logic that deals with allowed_mentions
It made no sense here.
2020-12-08 21:13:29 -05:00
Lilly Rose Berner
08d632880a
Fix embed suppression when using client-wide allowed_mentions 2020-12-08 20:42:26 -05:00
Nadir Chowdhury
6b803acde4
[chore] Remove redundant imports
This also removes the historical patch for NullHandler implemented in bbf1c54, as it has been available since Python 3.1.
2020-11-28 03:16:49 -05:00
Rapptz
a4cb71b64e Fix Message.to_reference from the MessageReference changes 2020-11-27 03:31:10 -05:00
Rapptz
5ef30e34e5 Correct docstring missing ] 2020-11-27 02:36:14 -05:00
Rapptz
34f2fb36b1 Added MessageReference.resolved attribute to get replied to message 2020-11-27 02:24:39 -05:00
Rapptz
1014bfcb63 Allow MessageReference to be constructible by users 2020-11-27 01:08:52 -05:00
Rapptz
bd6ab93348 Code cleanup involving enums and message replies 2020-11-27 00:32:08 -05:00
PikalaxALT
d1cb30cccf
Implement discord.Message.reply 2020-11-26 23:19:00 -05:00
Rapptz
f174365d33 Ensure member key is not overwritten by author key in MESSAGE_UPDATE
This also coerces the older message to take the member data from the
newer message so the types are not incompatible.

Fix #5999
2020-11-23 06:02:27 -05:00
Zomatree
344cb96c5d
Add sticker support 2020-11-23 05:09:20 -05:00
PythonCoderAS
a40e20fa38
Use Hashable mixin for Message 2020-10-16 22:46:08 -04:00
Michael
93fa46713a
Fix and add documentation 2020-09-23 03:19:35 -04:00
Sebastian Law
37c5c583f2
Add support for message_reference on Message object 2020-09-23 02:29:03 -04:00
Rapptz
a183c4f752 Completely update member references from message inner members.
Fixes #5819
2020-09-17 02:45:53 -04:00
Andres Torres
39aa08ab93
Added __eq__ to Message 2020-09-04 08:42:31 -04:00
ELginas
891531fac0
Fixed a typo in message unpinning docs 2020-08-05 21:44:11 -04:00
Rapptz
ec3c3eb4c6 Update message references in AutoShardedConnectionState
Fixes #5133
2020-07-25 09:59:40 -04:00
Nadir Chowdhury
e971e2f16c
Allow more methods to set an audit log reason 2020-06-30 23:35:42 -04:00
Sebastian Law
b4b953bfc6
Fix various inconsistencies within the documentation (#5067) 2020-06-28 03:45:58 -04:00
Rapptz
de7c96333c Update Message.system_content join strings to be up to date.
Fixes #4211
2020-06-27 03:45:27 -04:00