2438 Commits

Author SHA1 Message Date
Rapptz
aa8a328f0a Remove Message.timestamp and make Message.channel_mentions lazy.
Message.timestamp is replaced with Message.created_at. This commit
also affects how MESSAGE_UPDATE is handled by only assuming that two
keys are provided rather than overwriting data with missing keys.
2017-01-03 09:51:48 -05:00
Rapptz
31229a53e9 Optimise VoiceState for memory.
Instead of storing one VoiceState per Member, only store them if
necessary. This should bring down the number of instances
significantly.
2017-01-03 09:51:47 -05:00
Rapptz
044b0824e6 Begin working on the rewrite. 2017-01-03 09:51:47 -05:00
Kyle Repinski
643950abf8 Add ability to set opus encoder input signal type. 2017-01-03 09:51:14 -05:00
PapyrusThePlant
31cd9ad37a [commands] Bugfix on the teardown function call. 2017-01-01 01:49:10 -05:00
Rapptz
a8264f6540 Chunk every guild if it's a user bot.
This also increases the timeout for chunking by 30 seconds for every
chunk we're waiting for.
2016-12-24 17:32:20 -05:00
Rapptz
4d59bca4aa Support animated avatars in User.avatar_url. 2016-12-23 00:43:19 -05:00
Rapptz
bed2e90e82 Properly propagate loop. Fixes #420. 2016-12-21 00:06:19 -05:00
Rapptz
5731f3405d Version bump to v0.16.0. 2016-12-19 17:53:41 -05:00
Rapptz
00e30f3106 [commands] Shield against dictionary resize in Bot.close 2016-12-17 21:18:48 -05:00
Rapptz
fc1a7183a0 [commands] Unload all cogs when gracefully exiting bot. 2016-12-17 14:47:29 -05:00
Rapptz
b8909ae389 [commands] Properly propagate CommandError derived exceptions.
If a command or a group raised a CommandError derived exception it
would be wrapped into CommandInvokeError. This fixes this case so it
raises the original exception instead.
2016-12-17 14:44:36 -05:00
Rapptz
6d88024f0f [commands] Add special extension function 'teardown' for clean-up.
This is to support people who want to clean up some external resource
that the extension is maintaining outside of a cog, where __unload
should be used instead.

The callable is the antipode of 'setup' and takes the same sole
parameter, the bot, after all commands, events, and cogs have been
unloaded.

Fixes #405.
2016-12-17 14:15:11 -05:00
Rapptz
bafaf72c89 [commands] Unload all extensions when gracefully closing bot. 2016-12-17 14:15:10 -05:00
Rapptz
c7946606f4 Add Channel.overwrites to get a channel's permission overwrites.
Fixes #414.
2016-12-17 14:00:34 -05:00
Rapptz
6302ef8094 Add support for partnered servers. Fixes #387.
This commit allows you to edit a server's invite splash, query if
something has partnered features, and retrieve the invite splash + URL.
2016-12-17 13:34:19 -05:00
Rapptz
a0f4ad36eb Timeout waiting for chunking.
Sometimes the bot would keep waiting for chunks that somehow finished
before getting to the `wait` call. This is more so a temporary fix
rather than a fully correct one.
2016-12-16 21:28:12 -05:00
Rapptz
6306fc08db Discard null sequences in the gateway.
This was forbidding the Discord gateway from allowing us to RESUME
properly, causing an over-abundance of READY being called.
2016-12-16 18:29:29 -05:00
khazhyk
b1117262da [commands] Run global checks in help formatter.
Help formatter was not checking global bot-level checks, resulting in
showing commands a user did not have permission for with
show_check_failure disabled.
2016-12-16 14:39:25 -05:00
Rapptz
51fda76555 Fix typo in wait_for_reaction documentation. 2016-12-07 07:23:12 -05:00
Rapptz
b7c90a5e3d Fix role comparisons.
Fixes #409
2016-12-02 01:28:54 -05:00
Rapptz
64733c0b19 Version bump to v0.15.1 2016-11-30 17:05:29 -05:00
khazhyk
c8fd8a9e1a Fix crash on duplicate or out of order reactions.
Eventual consistency ftw
2016-11-30 16:47:00 -05:00
Rapptz
59d17e4137 Version bump to v0.15.0 2016-11-22 19:59:28 -05:00
Rapptz
6f2603c049 [commands] Remove slots on Context.
This is to allow people to set temporary local variables by injecting
them directly into the context via some decorator or some other
mechanism. Contexts are not kept alive long enough to warrant being
slotted.
2016-11-22 19:57:19 -05:00
Rapptz
c4ee4c1db4 Make discord.Embed builder more strict and easier to use.
Allow for easier use when trying to "reuse" the same discord.Embed
object by providing new methods such as Embed.clear_fields,
Embed.set_field_at, and allowing you to set things to Embed.Empty to
clear out an attribute.

For ease of use, things are automatically casted to ``str`` to prevent
the user from having HTTP 400 errors if they forgot to do so. The new
embed builder also supports "fluent-style" interface to allow you to
chain methods in a single line if necessary.

Certain parameters were removed since they were ignored by Discord
anyway such as `width` and `height` in Embed.set_image and
Embed.set_thumbnail.
2016-11-22 19:30:21 -05:00
Rapptz
fb1f9ac659 Add PermissionOverwrite.is_empty to query empty state of an overwrite.
Fixes #382
2016-11-21 03:12:44 -05:00
Rapptz
7ff7b0fb9c Add Permissions.update and PermissionOverwrite.update for bulk edits.
This should satisfy those that have a one-line obsession and make things
a little bit easier if you have a dict.
2016-11-21 03:08:03 -05:00
Rapptz
92c3c2804d Support MESSAGE_REACTION_REMOVE_ALL event. 2016-11-21 02:49:50 -05:00
Rapptz
e8905fd41b Add missing bucket for endpoints. 2016-11-17 21:07:54 -05:00
Rapptz
44624b7f44 Documentation fixes. 2016-11-17 20:42:06 -05:00
Rapptz
18178c26aa Add support for clearing a message's reactions. 2016-11-17 20:37:33 -05:00
Rapptz
4c1fd2c9b1 Add atomic add and remove role endpoints to HTTPClient.
These are currently unused since their use is pretty limited.
2016-11-17 20:27:43 -05:00
Rapptz
a312f21bc3 Support message editing with rich embeds. 2016-11-13 22:12:16 -05:00
Rapptz
af46718460 Add support for rich embeds. 2016-11-13 05:07:58 -05:00
Rapptz
a7ba0bb7c4 Version bump to v0.14.3 2016-11-06 01:04:50 -04:00
Rapptz
ae796e0d01 Change buckets for reactions. 2016-11-06 01:03:57 -04:00
khazhyk
8bd242f00b Fix crash on reaction remove.
Discord can sometimes send integer 0 as the emoji id instead of
null to signify a non-custom emoji, which was causing a crash due
to a 'is not None' check assuming the reaction was for an emoji
with id 0. Probably a discord bug, but preferable to handle here
rather than crash users.
2016-11-05 21:46:07 -07:00
Rapptz
4fa1349869 Version bump to v0.14.2 2016-11-04 00:14:07 -04:00
Rapptz
edcd1750c9 Make Client.wait_for_reaction return a namedtuple instead.
Also fix a bug in the case that emoji parameter is `None`.
2016-11-04 00:02:25 -04:00
Rapptz
f56dbb0379 Fix Reaction not importing.
Also bump version to v0.14.1
2016-11-03 22:28:18 -04:00
Rapptz
0e856494ed Version bump to v0.14.0 2016-11-03 21:52:21 -04:00
Rapptz
0e8a92cbac Add Client.wait_for_reaction to wait for a reaction from a user. 2016-11-03 21:44:24 -04:00
Rapptz
12a3403af3 Change reaction events signature and name.
This changes the event signature to be (reaction, user) instead of
(message, reaction, user) since the reaction data class already has
the message being reacted to as a member.

The name was shortened from on_message_reaction_ to on_reaction_ since
the message prefix was deemed redundant.
2016-11-03 20:16:39 -04:00
khazhyk
4d87b2f817 Inject full Emoji to Reaction if we have it.
Reaction objects with custom Emoji are partial. If we know of this Emoji
(can find it on this client) then inject it. Otherwise, leave it as a
hollow Emoji. We can still react with a hollow Emoji, but can't get other
metadata about it.
2016-11-03 04:39:45 -04:00
khazhyk
c4acc0e1a1 Add support for reactions.
Reactions can be be standard emojis, or custom server emojis.

Adds
 - add/remove_reaction
 - get_reaction_users
 - Messages have new field reactions
 - new events - message_reaction_add, message_reaction_remove
 - new permission - add_reactions
2016-10-27 21:36:32 -07:00
khazhyk
158ac6bb50 Add around parameter to LogsFromIterator. 2016-10-16 18:10:49 -07:00
khazhyk
e2667a6f66 Refactor LogsFromIterator 2016-10-16 17:25:00 -07:00
khazhyk
98d8c855d8 Fix typo in change_presence validation message 2016-10-15 15:54:50 -07:00
Rapptz
14def4b68e Fix Member.server_permissions docstring. 2016-10-04 18:55:34 -04:00