1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-12-25 06:37:29 +00:00

Misc testing and shit

This commit is contained in:
Myned 2017-10-19 04:39:41 -04:00
parent d137ad40b1
commit ff2ac1b587

View file

@ -18,7 +18,7 @@ from utils import utils as u
# log.basicConfig(level=log.INFO) # log.basicConfig(level=log.INFO)
bot = commands.Bot(command_prefix=u.config['prefix'], description='Experimental booru bot') bot = commands.Bot(command_prefix=u.config['prefix'], description='Experimental miscellaneous bot')
# Send and print ready message to #testing and console after logon # Send and print ready message to #testing and console after logon
@ -99,14 +99,33 @@ async def reaction_remove(r, u):
print('Removed') print('Removed')
bot.remove_listener(on_reaction_remove) bot.remove_listener(on_reaction_remove)
# d.opus.load_opus('opus')
async def wait(voice):
asyncio.sleep(5)
await voice.disconnect()
def after(voice, error):
coro = voice.disconnect()
future = asyncio.run_coroutine_threadsafe(coro, voice.loop)
future.result()
@bot.command(name=',test', hidden=True) @bot.command(name=',test', hidden=True)
@commands.is_owner() @commands.is_owner()
@checks.del_ctx() @checks.del_ctx()
async def test(ctx): async def test(ctx):
test = await ctx.send('\N{NUMBER SIGN}\N{COMBINING ENCLOSING KEYCAP}') def check(react, user):
await test.add_reaction('\N{THUMBS UP SIGN}') return reaction.emoji == '\N{THUMBS UP SIGN}'
await test.add_reaction('#\u20e3') # channel = bot.get_channel(int(cid))
# voice = await channel.connect()
# voice.play(d.AudioSource, after=lambda: after(voice))
test = await ctx.send('thumbs up!')
while True:
done, pending = await asyncio.wait([bot.wait_for('reaction_add', check=check), bot.wait_for('reaction_remove', check=check)], return_when=asyncio.FIRST_COMPLETED)
await ctx.send('well doneeee')
# bot.add_listener(on_reaction_add) # bot.add_listener(on_reaction_add)
# bot.add_listener(on_reaction_remove) # bot.add_listener(on_reaction_remove)