1401 Commits

Author SHA1 Message Date
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
khazhyk
98a054e19e Use local version identifer for SHA
local version identifier seems to be the only PEP440
way to add arbitrary string to the version. Makes
pip stop complaining about invalid version label.
2017-10-14 20:41:45 -07: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
khazhyk
c3a727ac7e Show sha1 for development versions. 2017-10-14 15:23:32 -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
ReinaSakuraba
13632faf97 Fix AppInfo.id being a string 2017-10-02 13:38:05 -07:00
Rapptz
065f408a10 Move pre-emptive message to DEBUG log level. 2017-10-01 13:43:20 -04:00
Rapptz
711dfb83ab Allow creating a channel with a category. 2017-09-29 05:54:29 -04:00
Rapptz
6d6ce14d7c Fix Guild.system_channel always returning None.
Fixes #811
2017-09-26 22:56:26 -04:00
Rapptz
f86ac47b28 Don't use Bulk Channel Edit endpoint if not actually moving channels.
Should make the category-only edit cases more straightforward since
it does not rely on other guilds in the cache, outside of the category
itself.
2017-09-24 04:55:10 -04:00
Rapptz
148816c4e8 Temporarily add created channels to cache.
This should fix issues when doing a `abc.GuildChannel.edit` immediately
afterwards and then when the corresponding CHANNEL_CREATE comes in the
channel instance should hopefully be overwritten by the authoritative
figure, the WebSocket.
2017-09-23 18:54:12 -04:00
espeonofespeonage
fd531297d2 Changed discord.Client.event to debug log success instead of info log.
This is suggested to prevent spamming the console unnecesarilly.

Info should be used to output information to the user that is important, but
not a warning or an error. If I am bundling a bot as a modular package then
it doesn't really make sense to spam their console with every time a coroutine
is subscribed to, as it likely will not mean anything to the user. If they are
interested in this, it would make more sense to just to enable debugging first.

I have made this change, as I am writing a wrapper for this library for a
private project, and that will handle dispatching events, thus, I do not
need a prompt for each event that is subscribed to in this module outside of
DEBUG. Currently, with logging set to INFO, I am getting 47 lines reading:

    INFO:discord.client:coroutine has successfully been registered as an event

...being output as my bot starts, and without having to disable INFO logging
altogether, I am currently having to temporarily change the verbosity of the
logger as the events are initialised, which is not desirable as it could
potentially cover up any other INFO messages that would be useful to have
output.

Using a filter seems like a bit of a hacky workaround. If this isn't acceptable
then another alternative would be to add a parameter to the constructor of
discord.Client to enable or disable printing this information.
2017-09-23 12:50:12 +01:00
Rapptz
54f2c71e71 Fix margins on <p> tags. 2017-09-22 03:11:37 -04:00
Rapptz
458cb83b47 Properly handle cases where a category is removed. 2017-09-21 22:15:47 -04:00
Rapptz
dbf8b5bda6 Fix header size warnings. 2017-09-21 21:16:00 -04:00
Rapptz
e3d69ce83d Add custom details directive. 2017-09-21 21:15:37 -04:00
Rapptz
8ed5fe472c More CSS fixes. 2017-09-21 19:38:33 -04:00
Rapptz
2bfd15ba89 Fix weird margins with unordered lists in the HTML5 output. 2017-09-21 18:37:22 -04:00
Rapptz
de6cffa347 Try to build HTML5 for docs. 2017-09-21 18:04:46 -04:00
Rapptz
95c28f08e4 Fix sorting for channels. 2017-09-21 00:11:36 -04:00
Jake
3e00e7fe8a [guild] use a defaultdict in by_category 2017-09-20 21:08:46 -07:00
Giovani Irimea
06296bfaf6 Changed README from using Markdown to use reStructuredText 2017-09-18 20:01:57 -04:00
rooni
415ca9a774 Add webhook.url 2017-09-18 19:31:20 +02:00
Rapptz
025136076a Add an example for on_reaction_add waiting.
Apparently people would rather read examples than the actual
documentation.
2017-09-18 05:46:51 -04:00
Rapptz
5e913b265b Change how coroutines are detected internally. 2017-09-16 13:35:00 -04:00
Rapptz
305cc3acfa Clarify VoiceClient.disconnect docs a little more. 2017-09-16 13:29:36 -04:00
Harmon
91e2163523 Fix typo in http.create_channel 2017-09-13 18:05:09 -05:00
Rapptz
7b2e06c263 Fix error when creating guild channels. 2017-09-13 18:47:40 -04:00
Rapptz
e614f6b4cd [commands] Add CategoryChannelConverter 2017-09-13 17:19:30 -04:00
Rapptz
7df8897e3d Add Guild.create_category.
An alias, Guild.create_category_channel is provided.
2017-09-13 17:01:42 -04:00
Steve C
233c2d80ef Fix grammar in abc docs, add new implementation 2017-09-13 13:54:09 -04:00
Rapptz
53b4890435 Add category support.
This adds:

* CategoryChannel, which represents a category
* Guild.by_category() which traverses the channels grouping by category
* Guild.categories to get a list of categories
* abc.GuildChannel.category to get the category a channel belongs to
* sync_permissions keyword argument to abc.GuildChannel.edit to sync
  permissions with a pre-existing or new category
* category keyword argument to abc.GuildChannel.edit to move a channel
  to a category
2017-09-13 09:44:36 -04:00
Rapptz
e24914be0b [commands] Fix NameError when given an invalid prefix.
Closes #775
2017-09-12 04:22:13 -04:00
Rapptz
3cd1fdc1eb Document new features for guilds. 2017-09-12 04:21:15 -04:00
Rapptz
1367877d36 Fix crashing for now when a category is created.
A full implementation will come later.
2017-09-08 21:30:25 -04:00
Rapptz
8912625428 Fix docstrings for Webhook.send 2017-09-08 04:23:11 -04:00