Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

Commit

Permalink
Update Plugin.destroy to work w/ the latest stuffs
Browse files Browse the repository at this point in the history
  • Loading branch information
b1naryth1ef committed Oct 7, 2016
1 parent 37a37fc commit c297d45
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions disco/bot/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,17 @@ def repeat():

def destroy(self):
"""
Destroys the plugin (removing all listeners)
Destroys the plugin, removing all listeners and schedules. Called after
unload.
"""
map(lambda k: k.remove(), self._events)
for listener in self.listeners:
listener.remove()

for schedule in self.schedules.values():
schedule.kill()

self.listeners = []
self.schedules = {}

def load(self):
"""
Expand Down

0 comments on commit c297d45

Please sign in to comment.