1298 Commits

Author SHA1 Message Date
Rapptz
871a262ee3 [commands] Add ability to have case insensitive commands.
This is powered by a dict-like class for the people who want to opt-in
to the performance downgrade for usability for majority English
speaking users.

Since it is slower than the regular dict due to the excessive calls to
str.lower along with the possibilities of gotchas for other languages
outside of English, this is kept as False for the default case.
2018-03-06 00:37:12 -05:00
Rapptz
1590441dbf Fix typo in TextChannel.delete_messages documentation. 2018-03-06 00:19:58 -05:00
Rapptz
a425bd91be Fix invalid close errors on websockets 4.x
Fixes #1110
2018-03-06 00:15:36 -05:00
Rapptz
0fcd385b9a Add ability to change the activity used when logging in at runtime. 2018-03-05 11:23:07 -05:00
Rapptz
f8f8f418f3 Split Game object to separate Activity subtypes for Rich Presences.
This is a massive breaking change.

* All references to "game" have been renamed to "activity"
* Activity objects contain a majority of the rich presence information
* Game and Streaming are subtypes for memory optimisation purposes for
  the more common cases.
* Introduce a more specialised read-only type, Spotify, for the
  official Spotify integration to make it easier to use.
2018-03-05 11:15:49 -05:00
Jared Shields
2f562bd695
Update docstrings for channel.py
`delete_messages` requires `manage_messages`; the docs in here, nor on RTD reflect this. 
Small amendment at line 180, adding three additional.
2018-02-26 22:04:49 -08:00
Rapptz
6782fdd34d Add missing coroutine decorator to HTTPClient.get_attachment
Fixes #1104
2018-02-26 18:55:05 -05:00
Rapptz
1c215cfbbe Don't cache webhook users.
Fixes #1101
2018-02-24 17:37:37 -05:00
Rapptz
355eb08b25 Add seek_begin keyword argument to Attachment.save 2018-02-13 05:41:10 -05:00
BeatButton
9d3d8e0f0a Fix websockets 4.0 support 2018-02-12 00:20:18 -05:00
Eli
ad7506050c [commands] Allow builtin unbound method converters 2018-02-10 22:07:44 -08:00
Daniel
d53c3a6c12
Fixed opus error check
Fixes #1056
2018-02-06 11:19:42 -05:00
Daniel
881e598a6f Add errcheck functions to opus foreign functions 2018-01-31 18:58:27 -05:00
Daniel
5a59eae95b Update opus and add COPYING notice 2018-01-26 12:46:19 -05:00
Rapptz
8de382fcd3 Change logic in PartialEmoji.__str__ a little. 2018-01-06 17:35:03 -05:00
Gorialis
04d9dd9c0d Change PartialReactionEmoji to PartialEmoji, add a PartialEmojiConverter 2018-01-06 17:32:25 -05:00
Tobotimus
3112e1c17e Add intersphinx 2018-01-06 17:23:59 -05:00
khazhyk
0ef866a704 [commands] Fix MissingRequiredArgument param handling
Documentation was incorrect, and we were throwing
away the param we were passing.
2018-01-06 17:23:58 -05:00
Chkoupinator
b268d81649 Added a missing "to" in Message.raw_mentions documentation. 2018-01-06 17:23:41 -05:00
CloudNineK
0f56ce7c13 Fix typo in Message.embeds documentation. 2018-01-06 17:23:18 -05:00
khazhyk
456390f417 Ensure gif avatar urls end in .gif
This is a workaround for discord having trouble animating gifs if
the url does not end in exactly `.gif`. Since avatar_url is common
for thumbnails etc., adding this workaround here is handy, and
likely restores expected behavior (animated avatars animating).
2018-01-06 01:29:16 -05:00
Rapptz
30b5047b0e Fix multipart sending for RequestsWebhookAdapter to work. 2018-01-03 21:55:48 -05:00
Rapptz
3a8b97ffb0 [commands] Document that can_run can raise. 2017-12-29 06:00:25 -05:00
Rapptz
e61ac8e60f [commands] Forbid passing a string to aliases in Command.
Fixes #974
2017-12-29 01:42:45 -05:00
Joshua Butt
f5a443fa8f Add support for animated emoji to commands ext EmojiConverter 2017-12-22 14:59:21 +10:00
Rapptz
da9828c41f Use the proper endpoint for removing your own reaction. 2017-12-21 19:20:48 -05:00
Rapptz
97fc4bf651 Update Emoji.url to point to the GIF version of the animated emoji. 2017-12-21 18:55:13 -05:00
Rapptz
a6bf792dec Animated emoji support. 2017-12-21 18:51:47 -05:00
Rapptz
e2f7945f59 Proper variable name in Client.clear. 2017-12-20 09:45:09 -05:00
Rapptz
5c5a59c18e Add Client.clear to clear the bot's internal state to a clean slate.
In case you want to have some external restart loop.
2017-12-16 21:36:39 -05:00
Daniel
ceb82ecc7b
Fix self._process not existing during cleanup() in case of error 2017-11-21 17:51:34 -05:00
S Stewart
89f9009a28
[commands] Fix minor spelling mistake 2017-11-20 09:00:32 -06:00
MysterialPy
096584733e
Stop asyncio.async throwing a syntax error in 3.7.
Maintains support for < 3.4.4
2017-11-13 22:07:54 +10:00
Mippy (William)
98c8928934 Missing Voice Regions 2017-11-12 16:58:31 -05:00
verixx
542924d5df Fixed a zero division error when accessing latencies
When accessing the latencies property on an AutoShardedClient when none of shards are ready, we get a ZeroDivisionError. An example of this can be seen here.
```py
class StatsBot(commands.AutoShardedBot):
    def __init__(self):
        super().__init__(command_prefix=None)
        self._add_commands()

    def _add_commands(self):
        '''Adds commands automatically'''
        for name, attr in inspect.getmembers(self):
            if isinstance(attr, commands.Command):
                self.add_command(attr)
```

When iterating through this custom client's it accesses the latencies property when no shards are ready, therefore it raises the error. A quick fix for this would be to return None if no shards are ready.
2017-11-12 16:58:30 -05:00
Mippy (William)
b5bc5a36ce Fix Spelling Error 2017-11-12 16:58:28 -05:00
Rapptz
5013102574 Fix Webhook.delete not working. 2017-11-07 05:36:55 -05:00
Rapptz
89bbbec37e Missing name parameter in VoiceChannel.edit documentation. 2017-10-26 05:36:19 -04:00
Rapptz
f0c53e4519 Fix URI quoting in Route. 2017-10-24 00:50:20 -04:00
khazhyk
ebecb90c96 is_avatar_animated should always return bool
Was returning None when User.avatar was None
2017-10-24 00:16:44 -04:00
Gorialis
6fc2b51dea Quote all Route params 2017-10-20 05:57:33 +09:00
Rapptz
47a58d354d Reimplement zlib streaming.
This time with less bugs. It turned out that the crash was due to a
synchronisation issue between the pending reads and the actual shard
polling mechanism.

Essentially the pending reads would be cancelled via a simple bool but
there would still be a pass left and thus we would have a single
pending read left before or after running the polling mechanism and
this would cause a race condition.

Now the pending read mechanism is properly waited for before returning
control back to the caller.
2017-10-14 21:19:46 -04:00
Rapptz
92a37c2e4f Revert "Implement zlib streaming for the gateway."
This reverts commit 462191a08b5b2efb83f5bc32935dc546d35a744b.
2017-10-14 15:22:39 -04:00
Rapptz
462191a08b Implement zlib streaming for the gateway. 2017-10-12 22:53:20 -04:00
Rapptz
9b4a2dc7cb [commands] Minor speed-up for the BucketType.guild case.
None case:
344ns ± 24.4ns -> 49.9ns ± 1.39ns

Valid case:
128ns ± 2.76ns -> 42.7ns ± 0.459ns
2017-10-08 07:57:58 -04:00
Rapptz
1bb7b6ff2d [commands] Make CooldownMapping.get_bucket take Message instead.
Requiring a full blown Context might be a bit overkill considering
we only use a single attribute from it.
2017-10-08 07:52:56 -04:00
ReinaSakuraba
d53cada91e Fix TypeError in utils.oauth_url 2017-10-04 21:27:31 -07:00
MysterialPy
bae6f80327 [commands] Split Cooldown state processing to two different functions.
This allows us to check if we are rate limited without
creating a new cool-down window for the command.
2017-10-03 03:57:06 -04:00
Pandentia
b22f7c76c5 Further clarify how bots can interact with emoji endpoints
Clarifies that bot accounts can only interact with emoji they have
created.
2017-10-03 00:22:06 +02:00
Pandentia
51a696e674 Remove reference to "whitelisted" bots for emoji endpoints
Due to a recent change in the Discord API, bots can now create
guild-specific emoji, so I've removed the parts of the documentation
referencing this restriction.
2017-10-03 00:10:01 +02:00