correction sleep to asyncio

This commit is contained in:
BFlow 2020-04-20 16:42:37 +02:00
parent d89024d32f
commit 36f514b856

View file

@ -11,7 +11,6 @@ import giphy_client
import gitlab import gitlab
import lxml import lxml
from time import sleep
from discord.ext import tasks, commands from discord.ext import tasks, commands
from subprocess import * from subprocess import *
from sys import argv from sys import argv
@ -30,7 +29,7 @@ class Mybot(commands.Cog):
async def join(self, ctx): async def join(self, ctx):
channel = [x for x in self.bot.get_all_channels() if x.name == "Général"][0] channel = [x for x in self.bot.get_all_channels() if x.name == "Général"][0]
await channel.connect() await channel.connect()
sleep(2) await asyncio.sleep(2)
@commands.command() @commands.command()
async def disconnect(self, ctx): async def disconnect(self, ctx):
@ -452,7 +451,7 @@ def main():
ctx = await bot.get_context(current_chan.last_message) ctx = await bot.get_context(current_chan.last_message)
ctx.message.author = member ctx.message.author = member
welcome = bot.get_command('welcome') welcome = bot.get_command('welcome')
sleep(2) await asyncio.sleep(2)
await welcome.invoke(ctx) await welcome.invoke(ctx)
bot.add_cog(Mybot(bot)) bot.add_cog(Mybot(bot))