1321 Commits

Author SHA1 Message Date
Rapptz
9a0e9b0494 Update system_content strings for MessageType.new_member. 2017-08-17 18:36:10 -04:00
Rapptz
3b3b8a5150 Remove incorrect extraneous usage of reason keyword argument.
Fixes #726
2017-08-17 18:20:28 -04:00
Rapptz
13c6a0a17a Add support for Guild.system_channel 2017-08-17 18:14:52 -04:00
Rapptz
b8c19954e4 Add default type for Game.
Good meme.
2017-08-16 19:36:17 -04:00
Ashton Tito
e0f733a5c1 use cdn url for custom emojis 2017-08-16 07:10:48 -04:00
Gorialis
80586cb081 Minor fixes in migrating doc 2017-08-16 07:09:06 -04:00
Rapptz
0f7482ed6e Add Client.latency, AutoShardedClient.latency and latencies.
This should allow an easier way to query the Discord protocol gateway
latency, defined by the difference HEARTBEAT_ACK between and the last
sent HEARTBEAT.
2017-08-15 23:41:11 -04:00
Rapptz
63231ef033 Remove reason keyword argument from message deletion.
Apparently this is unsupported.

Affected functions include:

* abc.Messageable.send
* Message.delete
* TextChannel.delete_messages
* TextChannel.purge
2017-08-15 22:38:43 -04:00
MysterialPy
adf99eb2cd Add delete_after to 'edit'.
Allow for edited messages to be deleted after [float] seconds with optional parameter delete_after.
2017-08-15 20:05:48 -04:00
Rapptz
d8360411ea Fix cases where user_id can be None in audit logs. 2017-08-15 06:12:57 -04:00
Rapptz
fce2ef5534 [commands] Raise when an invalid prefix is given.
Fixes #712
2017-08-15 06:12:09 -04:00
Rapptz
434d6dc347 Fix extraneous parentheses in Client.emojis render in migrating docs. 2017-08-12 18:41:21 -04:00
PapyrusThePlant
0d21e83b7f Fix the proxy support for aiohttp>=1.4. 2017-08-11 16:44:15 +02:00
Rapptz
eb673ec2af [commands] Ensure no mentions escape clean_content
Some clever nicknames or role names would lead themselves to
resolving to pings.
2017-08-10 03:17:24 -04:00
Rapptz
cb709cc9da [commands] Fix clean_content converter not properly escaping mentions.
In some cases, the Discord provided role_mentions and mentions array
would be empty, such as wrapping a mention with a backtick or
other frivolous characters. Since we want to completely nullify
mentions, we should not rely on the Discord provided arrays and instead
use and resolve the IDs from the content itself.
2017-08-10 02:46:00 -04:00
Rapptz
be1cffb7c3 Support for discord.Object in Member.remove_roles and Member.add_roles 2017-08-09 18:41:54 -04:00
Rapptz
f554861e68 Make discord.Object hashable. 2017-08-09 18:39:32 -04:00
Mitchell Ferree
ecdd21212c Disallow setting non-permission attributes 2017-08-08 22:19:59 -04:00
Rapptz
de65f7309b Add heartbeat_timeout to the Client options.
This setting configures how long before a timeout event is emitted
internally and disconnects the websocket. Since some users were
experiencing issues with the gateway not responding, this should help
mitigate the issue for those with poor PCs.
2017-08-08 21:12:04 -04:00
Rapptz
ceafae0ab2 Add DiscordWebSocket.latency to measure discord heartbeat latency. 2017-08-08 20:35:42 -04:00
Matt Gardner
f490afa5dc Fixed ExponentialBackoff not working when integral 2017-08-08 17:31:09 -04:00
SinisterRectus
8acf3d01ce Remove GuildChannel.is_default 2017-08-08 17:31:09 -04:00
Gorialis
1582116b72 Add documentation examples for AsyncIterator and change_presence. 2017-08-08 17:31:08 -04:00
Gorialis
20fae90a08 Add operation documentation for VerificationLevel, ContentFilter 2017-08-02 01:38:15 +09:00
Gorialis
934456035e Change VerificationLevel, ContentFilter to be IntEnums 2017-08-02 01:24:05 +09:00
Rapptz
e493f1f2f4 Remove Guild.create_invite too since it relies on a default channel. 2017-07-31 21:39:48 -04:00
Rapptz
3dc1195637 Remove Guild.default_channel
The concept no longer exists.
2017-07-31 21:32:12 -04:00
Rapptz
9cfa39a1c7 Fix AsyncIterator documentation to properly show coroutines. 2017-07-29 15:26:02 -04:00
Rapptz
51a39b5b1c Rename avatar_is_animated to is_avatar_animated and make it a method. 2017-07-27 06:26:00 -04:00
Rapptz
fe3b917564 Continue connection loop with back-off if connecting fails >5 times. 2017-07-25 20:00:00 -04:00
khazhyk
0a588fac1c allow trailing null bytes in uploaded jpegs 2017-07-25 06:09:41 -04:00
khazhyk
2c4876f2e7 add Guild.icon_url_as
Guild icons can also be up to 1024px, jpg, png, or webp
2017-07-25 06:09:41 -04:00
khazhyk
12ca0d9b16 avatar_url_as improvements
static_format will only apply to static (not animated) avatars. Makes
it easier to grab gif-or-'format' of an avatar. Defaults to 'webp'

This is for a similar usecase to avatar_url_as(format=None), except
one can specify the non-animated format, instead of always using
webp.

add User.avatar_is_animated property.

add validation for avatar_url_as, since invalid arguments result in
a url which will return 415, which can be confusing for a user. (They
just see a blank page)

Discord accepts size=16-2048, but images cap at 1024px, so accept 16-1024
Discord accepts "jpg", "jpeg", "png", "gif", and "webp", *unless* the
avatar is not animated, in which case "gif" is not supported. :\
2017-07-25 06:09:40 -04:00
Juan
ea0c37b538 accept_invite() doesn't exist on rewrite 2017-07-25 06:58:42 -03:00
khazhyk
f1e08cccac Add bulk argument to TextChannel.purge
bulk=False will never use bulk message delete. Useful e.g. for
using the purge interface for deleting the bot's own messages.
2017-07-24 00:11:05 -04:00
khazhyk
62cdfbdbcd Raise in HTTPClient.request when out of retries
Raise after loop completes without returning with most recent values
for r, data. This is a bit less fragile than checking tries < 4, since
changing the retry count requires changing values in multiple places.
(There seemed to already be handling in the 502 retry, tries <= 5,
which always evaluated to true, e.g.)
Previously, once out of retries, we would always return None without
raising.
This won't NameError so long as we make at least one HTTP request.
2017-07-22 20:10:28 -07:00
khazhyk
2850995062 Retry on 500 in HTTPClient.request
Discord official client retries on 500, so worst case scenario, we're
not any worse than the official client which seriously outnumbers us.
2017-07-22 20:10:25 -07:00
Daniel
b532da7906 Fix waiting for resume when calling stop() on AudioPlayer 2017-07-21 18:37:22 -04:00
Rapptz
5d75c44651 Call cleanup on AudioSource.__del__. 2017-07-19 05:58:20 -04:00
Rapptz
a7f846b37f [commands] Fix Command.root_parent not properly working. 2017-07-19 05:14:23 -04:00
Rapptz
eda903f6b1 Add some logging for when ffmpeg processes get terminated. 2017-07-18 18:46:56 -04:00
Rapptz
bd4505fec5 [commands] Restart the StringView properly in Context.reinvoke.
The old code for some reason assumed that the length of the command
would be 1. This is because when I tested this I would use single
letter command names and it would "just work" when in reality it was
completely incorrect.

A reminder to thoroughly test instead of just fitting something to work
2017-07-18 18:02:06 -04:00
Rapptz
bcaee518a1 [commands] Remove support for pass_context=False in Command. 2017-07-18 17:58:38 -04:00
Rapptz
6e0902ef57 Implement new-style NSFW channels.
No idea how these will change in the future but this is barebones
enough for now.
2017-07-18 16:36:26 -04:00
Rapptz
2e57fa6dfd Don't re-raise in Client.connect if it's a clean close code. 2017-07-14 11:06:00 -04:00
Rapptz
3fbeb94cdb Expose reverse parameter in TextChannel.purge 2017-07-14 01:13:50 -04:00
Rapptz
8f0dcaa666 Variadic arguments are a tuple not a list. 2017-07-10 20:33:53 -04:00
Rapptz
b3cad74442 Message content is Optional in Message.edit. 2017-07-10 06:14:51 -04:00
Rapptz
1d3bb1f510 Simplify embed timestamp code due to it being fixed Discord side.
See https://github.com/hammerandchisel/discord-api-docs/issues/291
2017-07-09 15:52:50 -04:00
Rapptz
6c67910fa9 Remove Invite.accept. 2017-07-08 21:33:04 -04:00