mirror of
https://github.com/myned/modufur.git
synced 2024-11-01 13:02:38 +00:00
34 lines
691 B
Python
34 lines
691 B
Python
import os
|
|
import hikari
|
|
import lightbulb
|
|
import miru
|
|
|
|
import config as c
|
|
|
|
|
|
# Unix optimizations
|
|
# https://github.com/hikari-py/hikari#uvloop
|
|
if os.name != 'nt':
|
|
import uvloop
|
|
uvloop.install()
|
|
|
|
bot = lightbulb.BotApp(
|
|
token=c.config['token'],
|
|
default_enabled_guilds=c.config['guilds'])
|
|
|
|
|
|
@bot.listen(lightbulb.CommandErrorEvent)
|
|
async def on_error(event):
|
|
await bot.application.owner.send(c.error(event))
|
|
|
|
try:
|
|
await event.context.respond(c.ERROR)
|
|
except:
|
|
pass
|
|
|
|
raise event.exception
|
|
|
|
|
|
miru.load(bot)
|
|
bot.load_extensions_from('tools', 'commands')
|
|
bot.run(activity=hikari.Activity(name=c.config['activity'], type=hikari.ActivityType.LISTENING))
|