mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-20 07:20:59 +01:00
Irc: make throttle time configurable per server (defaults to 0.01s)
This commit is contained in:
parent
7a5b64bdc9
commit
a546bae341
@ -172,7 +172,8 @@ class Irc():
|
|||||||
if self.queue: # Only process if there's data.
|
if self.queue: # Only process if there's data.
|
||||||
data = self.queue.popleft()
|
data = self.queue.popleft()
|
||||||
self._send(data)
|
self._send(data)
|
||||||
time.sleep(0.01)
|
throttle_time = self.serverdata.get('throttle_time', 0.01)
|
||||||
|
time.sleep(throttle_time)
|
||||||
|
|
||||||
def connect(self):
|
def connect(self):
|
||||||
"""
|
"""
|
||||||
|
@ -274,6 +274,11 @@ servers:
|
|||||||
# Autoconnect works like usual.
|
# Autoconnect works like usual.
|
||||||
autoconnect: 30
|
autoconnect: 30
|
||||||
|
|
||||||
|
# Message throttling: when set to a non-zero value, only one message will be sent every X
|
||||||
|
# seconds. If your bot is constantly running into Excess Flood errors, raising this to
|
||||||
|
# something like 0.5 or 1.0 should help. Defaults to 0.01 if not set.
|
||||||
|
throttle_time: 0.3
|
||||||
|
|
||||||
# Plugins to load (omit the .py extension)
|
# Plugins to load (omit the .py extension)
|
||||||
plugins:
|
plugins:
|
||||||
# Commands plugin: Provides core commands such as logging in, shutting down
|
# Commands plugin: Provides core commands such as logging in, shutting down
|
||||||
|
Loading…
x
Reference in New Issue
Block a user