155 Commits

Author SHA1 Message Date
jack1142
bd9821320e Use a subclass rather than monkey-patching for the websocket 2020-07-25 09:59:40 -04:00
Rapptz
137ff34f3a If we're out of retries just raise the OSError 2020-07-25 09:59:40 -04:00
Rapptz
e2f42597a5 Handle Connection Reset by Peer connection errors.
This should work both on Windows and on Linux.

Apparently these types of blips are considered normal for Discord. So
rather than letting the reconnect logic handler expect these to be
catastrophic, it should handle it specially so it doesn't waste an
IDENTIFY for what ultimately should just be a small networking blip.

This also makes it less noisy for the end-user as these complaints
happen from time to time.
2020-07-25 09:59:40 -04:00
Rapptz
058a1e608b Fix voice websocket connections 2020-07-25 09:59:38 -04:00
Rapptz
b8154e365f Rewrite gateway to use aiohttp instead of websockets 2020-07-25 09:59:38 -04:00
Tarek
a92e3e7b6b Fix TypeError when not specifying roles. 2020-07-08 23:12:10 -04:00
Nadir Chowdhury
e971e2f16c
Allow more methods to set an audit log reason 2020-06-30 23:35:42 -04:00
Nadir Chowdhury
a64006ee9b
Add support for integrations 2020-06-28 14:50:43 -04:00
Nadir Chowdhury
2b3c6e0d47
Add support for Discord templates 2020-06-28 14:48:04 -04:00
Tarek
4bdebcd339
Fix error raised when using the roles parameter. 2020-06-26 22:54:02 -04:00
NCPlayz
bd1420b5f0 Allow editing of channel types for news and text channels 2020-05-29 23:21:59 -04:00
NCPlayz
ed80ba6a5e Implement some missing attributes of Guild (and Guild.edit) 2020-05-23 22:04:02 -04:00
Rapptz
66c6be50d8 Prepare for the discord.com domain rename 2020-05-23 21:44:30 -04:00
unknown
b7c7c86a6b Add roles parameter for pruning members. 2020-05-03 15:39:52 -04:00
Rapptz
d853a57e86 Rename allowed mention parameters to allowed_mentions 2020-04-04 13:22:51 -04:00
Rapptz
041785937e Add support for configuring allowed mentions per message or bot wide. 2020-04-04 07:40:51 -04:00
Rapptz
00f6562728 Suppress missing Content-Type headers when fetching content
Fixes #2572
2020-02-22 19:07:17 -05:00
Rapptz
25a04ed135 Better detection for Cloudflare related 429s.
At some point Cloudflare started returning some JSON. I don't know how
this JSON looks like.

See #2544
2020-02-01 23:46:28 -05:00
Rapptz
6071607176 Bump copyright year to 2020
Closes #2510
2020-01-19 20:03:00 -05:00
Rapptz
87f9dcff9c Add support for clearing a specific reaction.
Closes #2440
2020-01-17 19:53:28 -05:00
NCPlayz
9c6a121644 Implement discord.MessageFlags
Refactor flags placement and use it for suppression.
2019-12-20 20:56:40 -05:00
Rapptz
1b040fd4ba Fix one more remaining loop passing for 3.8 in a Lock 2019-11-20 02:37:00 -05:00
Rapptz
a6f61dcbde Fix all deprecation warnings for 3.8 2019-11-20 02:30:19 -05:00
NCPlayz
dab2519a09 Implement TextChannel.follow() 2019-11-15 04:23:15 -05:00
Rapptz
ea3d119ca6 Use X-Ratelimit-Reset-After header by default.
There is now an option to turn it off, of course.
2019-08-27 18:41:32 -04:00
Rapptz
1c6c26ee38 Fix bucket key to not have the method in there. 2019-08-27 18:41:32 -04:00
Rapptz
078d1d71d8 Use new rate limit millisecond precision option. 2019-08-27 18:41:31 -04:00
Rapptz
0cca3ca5c6 Add support for suppressing embeds. 2019-06-29 20:26:47 -04:00
NCPlayz
5698cf6df9 Implement Guild.fetch_roles 2019-06-29 19:14:22 -04:00
NCPlayz
851f83c821 Implement Guild.fetch_members
Also implements `MemberIterator`.
2019-06-29 19:14:19 -04:00
NCPlayz
f7c6c5995d Implementing GET '/channels/:id' & '/guilds/:id/channels'
Signed-off-by: NCPlayz <chowdhurynadir0@outlook.com>
2019-06-07 19:12:59 -04:00
Rapptz
320dbc0618 Add support for system channel flags 2019-06-06 22:30:02 -04:00
Rapptz
483aa5465d Properly handle compute_prune_count in prune members endpoint. 2019-05-30 18:01:03 -04:00
Rapptz
eb4de55f6d Add reason to TextChannel.create_webhook
The reason parameter does not work with webhook deletes or edits so
they're not added. Probably a Discord bug.
2019-04-18 22:31:55 -04:00
Rapptz
14d66e7b9c Internal consistency with message related HTTPClient methods 2019-04-14 21:05:20 -04:00
Rapptz
519f0c07ea Add compute_prune_count to Guild.prune_members
Fix #2085
2019-04-14 17:33:57 -04:00
khazhyk
7078b665a3 allow passing 0 for logs_from parameters 2019-04-07 22:18:30 -07:00
NCPlayz
1d701f32b6 Add fetch custom emoji, all custom emojis; Add user property to Emoji 2019-04-06 19:19:47 -04:00
NCPlayz
be227ebcf0 Redesign asset retrieval in the library.
Most assets now return a new class named `Asset`. This allows for the
assets to be consistently saved via a `save` method instead of special
casing for `Attachment`.

`AppInfo` is no longer a namedtuple it is a fully documented dataclass,
as well as having the state attached to it.

Fixes #1997
2019-04-06 19:12:50 -04:00
Rapptz
dea3ba5eb7 Propagate Cloudflare 429 HTML text. 2019-03-31 05:44:00 -04:00
CapnS
4ec7213506 Added functionality to edit user settings
Changing docs to fit other parts of the lib

Co-Authored-By: CapnS <38225872+CapnS@users.noreply.github.com>

Removing Type Checking

Made all of Rapptz's suggested changes

Removing imports that are no longer needed
2019-03-28 17:33:39 -04:00
Rapptz
548b9d5693 Double underscore HTTPClient's internal session. 2019-03-24 14:45:18 -04:00
NCPlayz
8a30a4cac0 Add support for guild widget 2019-03-19 09:22:48 -04:00
NCPlayz
f507f508a2 Expose Metadata
Added access to:
* `/users/@me/guilds`
* `/guilds/{guild_id}`
* `/guilds/{guild_id}/members/{member_id}`

BREAKING CHANGE:
* `get_user_info` -> `fetch_user_info` to match naming scheme.

Remove useless note

Remove `reverse` and corresponding documentation

Update documentation to reflect #1988

Rename `get_` HTTP functions to `fetch_`

Breaking Changes:
* `get_message` -> `fetch_message`
* `get_invite` -> `fetch_invite`
* `get_user_profile` -> `fetch_user_profile`
* `get_webhook_info` -> `fetch_webhook`
* `get_ban` -> `fetch_ban`

Fix InviteConverter, update migrating.rst

Rename get_message to fetch_message
2019-03-19 09:00:18 -04:00
Rapptz
5e65ec978c Take back ownership of files from aiohttp for retrying requests.
Fix #1809
2019-03-18 07:54:36 -04:00
SnowyLuma
42a7c4f7e5 Add support for guild banners
Document banner attribute of Guild and Invite

Update discord/utils.py

Co-Authored-By: SnowyLuma <38926001+SnowyLuma@users.noreply.github.com>
2019-03-09 00:37:49 -05:00
Tarek1337
616616b847 Add support for guild descriptions 2019-03-08 21:45:43 -05:00
Rapptz
df130e10f0 Prevent AttributeError when closing HTTPClient early. 2019-03-02 16:48:40 -05:00
Rapptz
48b60b2eac Prepare fix for aiohttp 4.0 breaking change with session creation. 2019-02-27 06:34:30 -05:00
Rapptz
5d78f43e55 Expose more information from partial invites, along with counts.
This adds the following information.

* `PartialInviteGuild` to replace `Object` patching
* `PartialInviteChannel` to replace `Object` patching
* Invite.approximate_member_count and Invite.approximate_presence_count

The new partial objects provide better documentation on what is
expected when you fetch random invites.

Fixes #1830
2019-02-12 20:22:47 -05:00