Skip to content

Commit f7f5cc5

Browse files
committed
allow join commands to be throttled using 'join_throttle' in the connection config
1 parent e022de6 commit f7f5cc5

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

plugins/autojoin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ def get_channels(db, conn):
2323
@hook.irc_raw('004')
2424
def do_joins(db, conn, async):
2525
chans = yield from async(get_channels, db, conn)
26+
join_throttle = conn.config.get("join_throttle", 0.4)
2627
for chan in chans:
2728
conn.join(chan[1])
28-
yield from asyncio.sleep(0.4)
29+
yield from asyncio.sleep(join_throttle)
2930

3031

3132
@hook.irc_raw('JOIN', singlethread=True)

plugins/core_misc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,11 @@ def onjoin(conn, bot):
9898
conn.cmd('MODE', conn.nick, mode)
9999

100100
# Join config-defined channels
101+
join_throttle = conn.config.get('join_throttle', 0.4)
101102
bot.logger.info("[{}|misc] Bot is joining channels for network.".format(conn.name))
102103
for channel in conn.channels:
103104
conn.join(channel)
104-
yield from asyncio.sleep(0.4)
105+
yield from asyncio.sleep(join_throttle)
105106

106107
conn.ready = True
107108
bot.logger.info("[{}|misc] Bot has finished sending join commands for network.".format(conn.name))

0 commit comments

Comments
 (0)