forked from uniborg/uniborg
Don't allow unloading _core
Prevents getting stuck with no way of administrating the bot
This commit is contained in:
parent
f1141aa24f
commit
c1e3b2f3c3
|
@ -37,9 +37,7 @@ async def handler(event):
|
|||
|
||||
The core features offered by the custom `TelegramClient` live under the
|
||||
[`uniborg/`](https://github.com/uniborg/uniborg/tree/master/uniborg)
|
||||
directory, with some utilities, enhancements and the core plugin, which
|
||||
can be unloaded in itself (something fun to do, but you will probably
|
||||
want to restart your borg after).
|
||||
directory, with some utilities, enhancements and the core plugin.
|
||||
|
||||
## learning
|
||||
|
||||
|
|
|
@ -36,7 +36,9 @@ async def remove(event):
|
|||
await event.delete()
|
||||
shortname = event.pattern_match["shortname"]
|
||||
|
||||
if shortname in borg._plugins:
|
||||
if shortname == "_core":
|
||||
msg = await event.respond(f"Not removing {shortname}")
|
||||
elif shortname in borg._plugins:
|
||||
borg.remove_plugin(shortname)
|
||||
msg = await event.respond(f"Removed plugin {shortname}")
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue