diff options
| author | Rapptz <[email protected]> | 2016-03-31 20:09:20 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-03-31 20:09:20 -0400 |
| commit | c015e492d7d44f389dd2cccbc571e6f2e578bf97 (patch) | |
| tree | b803c56d499ff80787fb9a92c7ddfb0f2a5fc715 | |
| parent | Add default avatar property to User. (diff) | |
| download | discord.py-c015e492d7d44f389dd2cccbc571e6f2e578bf97.tar.xz discord.py-c015e492d7d44f389dd2cccbc571e6f2e578bf97.zip | |
[commands] Don't yield from inside bot utility functions.
| -rw-r--r-- | discord/ext/commands/bot.py | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index 1c388504..d8bc6cfb 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -236,7 +236,6 @@ class Bot(GroupMixin, discord.Client): # utility "send_*" functions - @asyncio.coroutine def say(self, *args, **kwargs): """|coro| @@ -251,10 +250,8 @@ class Bot(GroupMixin, discord.Client): :meth:`Client.send_message` """ destination = _get_variable('_internal_channel') - result = yield from self.send_message(destination, *args, **kwargs) - return result + return self.send_message(destination, *args, **kwargs) - @asyncio.coroutine def whisper(self, *args, **kwargs): """|coro| @@ -269,10 +266,8 @@ class Bot(GroupMixin, discord.Client): :meth:`Client.send_message` """ destination = _get_variable('_internal_author') - result = yield from self.send_message(destination, *args, **kwargs) - return result + return self.send_message(destination, *args, **kwargs) - @asyncio.coroutine def reply(self, content, *args, **kwargs): """|coro| @@ -290,10 +285,8 @@ class Bot(GroupMixin, discord.Client): author = _get_variable('_internal_author') destination = _get_variable('_internal_channel') fmt = '{0.mention}, {1}'.format(author, str(content)) - result = yield from self.send_message(destination, fmt, *args, **kwargs) - return result + return self.send_message(destination, fmt, *args, **kwargs) - @asyncio.coroutine def upload(self, *args, **kwargs): """|coro| @@ -308,10 +301,8 @@ class Bot(GroupMixin, discord.Client): :meth:`Client.send_file` """ destination = _get_variable('_internal_channel') - result = yield from self.send_file(destination, *args, **kwargs) - return result + return self.send_file(destination, *args, **kwargs) - @asyncio.coroutine def type(self): """|coro| @@ -326,7 +317,7 @@ class Bot(GroupMixin, discord.Client): The :meth:`Client.send_typing` function. """ destination = _get_variable('_internal_channel') - yield from self.send_typing(destination) + return self.send_typing(destination) # listener registration |