mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 12:18:59 +00:00
[commands] Don't yield from inside bot utility functions.
This commit is contained in:
parent
5f776f369d
commit
c015e492d7
@ -236,7 +236,6 @@ class Bot(GroupMixin, discord.Client):
|
|||||||
|
|
||||||
# utility "send_*" functions
|
# utility "send_*" functions
|
||||||
|
|
||||||
@asyncio.coroutine
|
|
||||||
def say(self, *args, **kwargs):
|
def say(self, *args, **kwargs):
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
@ -251,10 +250,8 @@ class Bot(GroupMixin, discord.Client):
|
|||||||
:meth:`Client.send_message`
|
:meth:`Client.send_message`
|
||||||
"""
|
"""
|
||||||
destination = _get_variable('_internal_channel')
|
destination = _get_variable('_internal_channel')
|
||||||
result = yield from self.send_message(destination, *args, **kwargs)
|
return self.send_message(destination, *args, **kwargs)
|
||||||
return result
|
|
||||||
|
|
||||||
@asyncio.coroutine
|
|
||||||
def whisper(self, *args, **kwargs):
|
def whisper(self, *args, **kwargs):
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
@ -269,10 +266,8 @@ class Bot(GroupMixin, discord.Client):
|
|||||||
:meth:`Client.send_message`
|
:meth:`Client.send_message`
|
||||||
"""
|
"""
|
||||||
destination = _get_variable('_internal_author')
|
destination = _get_variable('_internal_author')
|
||||||
result = yield from self.send_message(destination, *args, **kwargs)
|
return self.send_message(destination, *args, **kwargs)
|
||||||
return result
|
|
||||||
|
|
||||||
@asyncio.coroutine
|
|
||||||
def reply(self, content, *args, **kwargs):
|
def reply(self, content, *args, **kwargs):
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
@ -290,10 +285,8 @@ class Bot(GroupMixin, discord.Client):
|
|||||||
author = _get_variable('_internal_author')
|
author = _get_variable('_internal_author')
|
||||||
destination = _get_variable('_internal_channel')
|
destination = _get_variable('_internal_channel')
|
||||||
fmt = '{0.mention}, {1}'.format(author, str(content))
|
fmt = '{0.mention}, {1}'.format(author, str(content))
|
||||||
result = yield from self.send_message(destination, fmt, *args, **kwargs)
|
return self.send_message(destination, fmt, *args, **kwargs)
|
||||||
return result
|
|
||||||
|
|
||||||
@asyncio.coroutine
|
|
||||||
def upload(self, *args, **kwargs):
|
def upload(self, *args, **kwargs):
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
@ -308,10 +301,8 @@ class Bot(GroupMixin, discord.Client):
|
|||||||
:meth:`Client.send_file`
|
:meth:`Client.send_file`
|
||||||
"""
|
"""
|
||||||
destination = _get_variable('_internal_channel')
|
destination = _get_variable('_internal_channel')
|
||||||
result = yield from self.send_file(destination, *args, **kwargs)
|
return self.send_file(destination, *args, **kwargs)
|
||||||
return result
|
|
||||||
|
|
||||||
@asyncio.coroutine
|
|
||||||
def type(self):
|
def type(self):
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
@ -326,7 +317,7 @@ class Bot(GroupMixin, discord.Client):
|
|||||||
The :meth:`Client.send_typing` function.
|
The :meth:`Client.send_typing` function.
|
||||||
"""
|
"""
|
||||||
destination = _get_variable('_internal_channel')
|
destination = _get_variable('_internal_channel')
|
||||||
yield from self.send_typing(destination)
|
return self.send_typing(destination)
|
||||||
|
|
||||||
# listener registration
|
# listener registration
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user