Drop support for Python 3.4 and make minimum version 3.5.2.

This commit is contained in:
Rapptz
2018-06-10 18:09:14 -04:00
parent 7eb918b19e
commit f25091efe1
35 changed files with 626 additions and 1069 deletions

View File

@ -86,8 +86,7 @@ class Context(discord.abc.Messageable):
self.command_failed = attrs.pop('command_failed', False)
self._state = self.message._state
@asyncio.coroutine
def invoke(self, *args, **kwargs):
async def invoke(self, *args, **kwargs):
"""|coro|
Calls a command with the arguments given.
@ -125,11 +124,10 @@ class Context(discord.abc.Messageable):
arguments.append(self)
arguments.extend(args[1:])
ret = yield from command.callback(*arguments, **kwargs)
ret = await command.callback(*arguments, **kwargs)
return ret
@asyncio.coroutine
def reinvoke(self, *, call_hooks=False, restart=True):
async def reinvoke(self, *, call_hooks=False, restart=True):
"""|coro|
Calls the command again.
@ -174,7 +172,7 @@ class Context(discord.abc.Messageable):
to_call = cmd
try:
yield from to_call.reinvoke(self, call_hooks=call_hooks)
await to_call.reinvoke(self, call_hooks=call_hooks)
finally:
self.command = cmd
view.index = index
@ -188,8 +186,7 @@ class Context(discord.abc.Messageable):
"""Checks if the invocation context is valid to be invoked with."""
return self.prefix is not None and self.command is not None
@asyncio.coroutine
def _get_channel(self):
async def _get_channel(self):
return self.channel
@property