File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import asyncio
22import socket
3+ from copy import copy
34
45from cloudbot import hook
56
@@ -15,8 +16,12 @@ def invite(irc_paramlist, conn):
1516 :type conn: cloudbot.client.Client
1617 """
1718 invite_join = conn .config .get ('invite_join' , True )
19+ chan = irc_paramlist [- 1 ]
20+ if chan .startswith (':' ):
21+ chan = chan [1 :]
22+
1823 if invite_join :
19- conn .join (irc_paramlist [ - 1 ] )
24+ conn .join (chan )
2025
2126
2227@hook .irc_raw ('JOIN' )
@@ -64,6 +69,7 @@ def onjoin(conn, bot):
6469 :type conn: cloudbot.clients.clients.IrcClient
6570 :type bot: cloudbot.bot.CloudBot
6671 """
72+ chans = copy (conn .channels )
6773 bot .logger .info ("[{}|misc] Bot is sending join commands for network." .format (conn .name ))
6874 nickserv = conn .config .get ('nickserv' )
6975 if nickserv and nickserv .get ("enabled" , True ):
@@ -100,7 +106,7 @@ def onjoin(conn, bot):
100106 # Join config-defined channels
101107 join_throttle = conn .config .get ('join_throttle' , 0.4 )
102108 bot .logger .info ("[{}|misc] Bot is joining channels for network." .format (conn .name ))
103- for channel in conn . channels :
109+ for channel in chans :
104110 conn .join (channel )
105111 yield from asyncio .sleep (join_throttle )
106112
Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ def bot_left_channel(conn, chan):
2424
2525def bot_joined_channel (conn , chan ):
2626 logger .info ("[{}|tracker] Bot joined channel '{}'" .format (conn .name , chan ))
27- conn .channels .append (chan )
27+ if chan not in conn .channels :
28+ conn .channels .append (chan )
29+
2830 conn .history [chan ] = deque (maxlen = 100 )
2931
3032
You can’t perform that action at this time.
0 commit comments