Browse Source

state listeners should use Priority.BEFORE

pull/81/merge
Andrei 7 years ago
parent
commit
eb6b22d93e
No known key found for this signature in database GPG Key ID: 4D2A02C7D500E9D9
  1. 3
      disco/state.py

3
disco/state.py

@ -3,6 +3,7 @@ import weakref
from collections import deque, namedtuple from collections import deque, namedtuple
from gevent.event import Event from gevent.event import Event
from holster.emitter import Priority
from disco.types.base import UNSET from disco.types.base import UNSET
from disco.util.config import Config from disco.util.config import Config
@ -132,7 +133,7 @@ class State(object):
for event in self.EVENTS: for event in self.EVENTS:
func = 'on_' + underscore(event) func = 'on_' + underscore(event)
self.listeners.append(self.client.events.on(event, getattr(self, func))) self.listeners.append(self.client.events.on(event, getattr(self, func)), priority=Priority.BEFORE)
def fill_messages(self, channel): def fill_messages(self, channel):
for message in reversed(next(channel.messages_iter(bulk=True))): for message in reversed(next(channel.messages_iter(bulk=True))):

Loading…
Cancel
Save