Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
HaloDragon7410 authored Sep 25, 2019
1 parent eebf32e commit 4602ad3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion userbot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,16 @@ def remove_plugin(shortname):
for i in LOAD_PLUG[shortname]:
bot.remove_event_handler(i)
del LOAD_PLUG[shortname]

except:
name = f"userbot/plugins/{shortname}.py"

for i in reversed(range(len(bot._event_builders))):
ev, cb = bot._event_builders[i]
if cb.__module__ == name:
del bot._event_builders[i]
except:
print(i)
else:
raise ValueError

def admin_cmd(pattern=None, **args):
Expand Down

0 comments on commit 4602ad3

Please sign in to comment.