Remove remaining asyncio.coroutine calls.
Also remove Client.async_event
This commit is contained in:
parent
9d301f7cae
commit
ec3435b224
@ -787,13 +787,6 @@ class Client:
|
|||||||
log.debug('%s has successfully been registered as an event', coro.__name__)
|
log.debug('%s has successfully been registered as an event', coro.__name__)
|
||||||
return coro
|
return coro
|
||||||
|
|
||||||
def async_event(self, coro):
|
|
||||||
"""A shorthand decorator for :func:`asyncio.coroutine` + :meth:`event`."""
|
|
||||||
if not asyncio.iscoroutinefunction(coro):
|
|
||||||
coro = asyncio.coroutine(coro)
|
|
||||||
|
|
||||||
return self.event(coro)
|
|
||||||
|
|
||||||
async def change_presence(self, *, activity=None, status=None, afk=False):
|
async def change_presence(self, *, activity=None, status=None, afk=False):
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import asyncio
|
|
||||||
|
|
||||||
from collections import namedtuple, defaultdict
|
from collections import namedtuple, defaultdict
|
||||||
|
|
||||||
@ -794,8 +793,7 @@ class Guild(Hashable):
|
|||||||
|
|
||||||
await http.edit_guild(self.id, reason=reason, **fields)
|
await http.edit_guild(self.id, reason=reason, **fields)
|
||||||
|
|
||||||
@asyncio.coroutine
|
async def get_ban(self, user):
|
||||||
def get_ban(self, user):
|
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
Retrieves the :class:`BanEntry` for a user, which is a namedtuple
|
Retrieves the :class:`BanEntry` for a user, which is a namedtuple
|
||||||
@ -824,7 +822,7 @@ class Guild(Hashable):
|
|||||||
BanEntry
|
BanEntry
|
||||||
The BanEntry object for the specified user.
|
The BanEntry object for the specified user.
|
||||||
"""
|
"""
|
||||||
data = yield from self._state.http.get_ban(user.id, self.id)
|
data = await self._state.http.get_ban(user.id, self.id)
|
||||||
return BanEntry(
|
return BanEntry(
|
||||||
user=User(state=self._state, data=data['user']),
|
user=User(state=self._state, data=data['user']),
|
||||||
reason=data['reason']
|
reason=data['reason']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user