mirror of
https://github.com/myned/modufur.git
synced 2024-12-25 06:37:29 +00:00
⚠️ > \N{WARNING SIGN}
This commit is contained in:
parent
4d92778c8a
commit
22afd87d8b
1 changed files with 47 additions and 42 deletions
|
@ -40,19 +40,19 @@ async def on_ready():
|
||||||
|
|
||||||
# bot.loop.create_task(u.clear(booru.temp_urls, 30*60))
|
# bot.loop.create_task(u.clear(booru.temp_urls, 30*60))
|
||||||
|
|
||||||
if u.config['playing'] is not 'None':
|
if u.config['playing'] is not 'None':
|
||||||
await bot.change_presence(game=d.Game(name=u.config['playing']))
|
await bot.change_presence(game=d.Game(name=u.config['playing']))
|
||||||
else:
|
else:
|
||||||
await bot.change_presence(game=None)
|
await bot.change_presence(game=None)
|
||||||
|
|
||||||
print('\n\\ \\ \\ \\ \\ \\ \\ \\ \\\nC O N N E C T E D : {}\n/ / / / / / / / /\n'.format(bot.user.name))
|
print('\n\\ \\ \\ \\ \\ \\ \\ \\ \\\nC O N N E C T E D : {}\n/ / / / / / / / /\n'.format(bot.user.name))
|
||||||
await bot.get_channel(u.config['info_channel']).send('**Started** \N{BLACK SUN WITH RAYS} .')
|
await bot.get_channel(u.config['info_channel']).send('**Started** \N{BLACK SUN WITH RAYS} .')
|
||||||
# u.notify('C O N N E C T E D')
|
# u.notify('C O N N E C T E D')
|
||||||
if u.temp:
|
if u.temp:
|
||||||
channel = bot.get_channel(u.temp['restart_ch'])
|
channel = bot.get_channel(u.temp['restart_ch'])
|
||||||
message = await channel.get_message(u.temp['restart_msg'])
|
message = await channel.get_message(u.temp['restart_msg'])
|
||||||
await message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
await message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
u.temp.clear()
|
u.temp.clear()
|
||||||
|
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
|
@ -67,8 +67,13 @@ async def on_message(message):
|
||||||
async def on_error(error, *args, **kwargs):
|
async def on_error(error, *args, **kwargs):
|
||||||
print('\n! ! ! ! !\nE R R O R : {}\n! ! ! ! !\n'.format(error), file=sys.stderr)
|
print('\n! ! ! ! !\nE R R O R : {}\n! ! ! ! !\n'.format(error), file=sys.stderr)
|
||||||
tb.print_exc()
|
tb.print_exc()
|
||||||
await bot.get_user(u.config['owner_id']).send('**ERROR** ⚠ `{}`'.format(error))
|
await bot.get_user(u.config['owner_id']).send('**ERROR** \N{WARNING SIGN} `{}`'.format(error))
|
||||||
await bot.get_channel(u.config['info_channel']).send('**ERROR** ⚠ `{}`'.format(error))
|
await bot.get_channel(u.config['info_channel']).send('**ERROR** \N{WARNING SIGN} `{}`'.format(error))
|
||||||
|
if u.temp:
|
||||||
|
channel = bot.get_channel(u.temp['restart_ch'])
|
||||||
|
message = await channel.get_message(u.temp['restart_msg'])
|
||||||
|
await message.add_reaction('\N{WARNING SIGN}')
|
||||||
|
u.temp.clear()
|
||||||
# u.notify('E R R O R')
|
# u.notify('E R R O R')
|
||||||
await bot.logout()
|
await bot.logout()
|
||||||
u.close(bot.loop)
|
u.close(bot.loop)
|
||||||
|
@ -76,54 +81,54 @@ async def on_error(error, *args, **kwargs):
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_command_error(ctx, error):
|
async def on_command_error(ctx, error):
|
||||||
if isinstance(error, errext.CheckFailure):
|
if isinstance(error, errext.CheckFailure):
|
||||||
await ctx.send('\N{NO ENTRY} **Insufficient permissions.**', delete_after=10)
|
await ctx.send('\N{NO ENTRY} **Insufficient permissions.**', delete_after=10)
|
||||||
await ctx.message.add_reaction('\N{NO ENTRY}')
|
await ctx.message.add_reaction('\N{NO ENTRY}')
|
||||||
elif isinstance(error, errext.CommandNotFound):
|
elif isinstance(error, errext.CommandNotFound):
|
||||||
print('INVALID COMMAND : {}'.format(error), file=sys.stderr)
|
print('INVALID COMMAND : {}'.format(error), file=sys.stderr)
|
||||||
await ctx.message.add_reaction('\N{CROSS MARK}')
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
else:
|
else:
|
||||||
print('\n! ! ! ! ! ! ! ! ! ! ! !\nC O M M A N D E R R O R : {}\n! ! ! ! ! ! ! ! ! ! ! !\n'.format(
|
print('\n! ! ! ! ! ! ! ! ! ! ! !\nC O M M A N D E R R O R : {}\n! ! ! ! ! ! ! ! ! ! ! !\n'.format(
|
||||||
error), file=sys.stderr)
|
error), file=sys.stderr)
|
||||||
tb.print_exception(type(error), error, error.__traceback__, file=sys.stderr)
|
tb.print_exception(type(error), error, error.__traceback__, file=sys.stderr)
|
||||||
await bot.get_user(u.config['owner_id']).send('**COMMAND ERROR** ⚠ `{}`'.format(error))
|
await bot.get_user(u.config['owner_id']).send('**COMMAND ERROR** \N{WARNING SIGN} `{}`'.format(error))
|
||||||
await bot.get_channel(u.config['info_channel']).send('**COMMAND ERROR** ⚠ `{}`'.format(error))
|
await bot.get_channel(u.config['info_channel']).send('**COMMAND ERROR** \N{WARNING SIGN} `{}`'.format(error))
|
||||||
await exc.send_error(ctx, error)
|
await exc.send_error(ctx, error)
|
||||||
await ctx.message.add_reaction('⚠')
|
await ctx.message.add_reaction('\N{WARNING SIGN}')
|
||||||
# u.notify('C O M M A N D E R R O R')
|
# u.notify('C O M M A N D E R R O R')
|
||||||
|
|
||||||
|
|
||||||
async def on_reaction_add(r, u):
|
async def on_reaction_add(r, u):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
async def on_reaction_remove(r, u):
|
async def on_reaction_remove(r, u):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
async def reaction_add(r, u):
|
async def reaction_add(r, u):
|
||||||
bot.add_listener(on_reaction_add)
|
bot.add_listener(on_reaction_add)
|
||||||
print('Reacted')
|
print('Reacted')
|
||||||
bot.remove_listener(on_reaction_remove)
|
bot.remove_listener(on_reaction_remove)
|
||||||
|
|
||||||
|
|
||||||
async def reaction_remove(r, u):
|
async def reaction_remove(r, u):
|
||||||
bot.add_listener(on_reaction_remove)
|
bot.add_listener(on_reaction_remove)
|
||||||
print('Removed')
|
print('Removed')
|
||||||
bot.remove_listener(on_reaction_remove)
|
bot.remove_listener(on_reaction_remove)
|
||||||
|
|
||||||
# d.opus.load_opus('opus')
|
# d.opus.load_opus('opus')
|
||||||
|
|
||||||
|
|
||||||
async def wait(voice):
|
async def wait(voice):
|
||||||
asyncio.sleep(5)
|
asyncio.sleep(5)
|
||||||
await voice.disconnect()
|
await voice.disconnect()
|
||||||
|
|
||||||
|
|
||||||
def after(voice, error):
|
def after(voice, error):
|
||||||
coro = voice.disconnect()
|
coro = voice.disconnect()
|
||||||
future = asyncio.run_coroutine_threadsafe(coro, voice.loop)
|
future = asyncio.run_coroutine_threadsafe(coro, voice.loop)
|
||||||
future.result()
|
future.result()
|
||||||
|
|
||||||
|
|
||||||
@bot.command(name=',test', hidden=True)
|
@bot.command(name=',test', hidden=True)
|
||||||
|
|
Loading…
Reference in a new issue