Merge pull request #195 from daboross/patch-2
Add support for multiple channels to .join and .leave
This commit is contained in:
commit
efef951501
1 changed files with 12 additions and 6 deletions
|
@ -138,8 +138,11 @@ def clearlogs(inp, input=None):
|
||||||
@hook.command(permissions=["botcontrol"])
|
@hook.command(permissions=["botcontrol"])
|
||||||
def join(inp, conn=None, notice=None):
|
def join(inp, conn=None, notice=None):
|
||||||
"""join <channel> -- Joins <channel>."""
|
"""join <channel> -- Joins <channel>."""
|
||||||
notice("Attempting to join {}...".format(inp))
|
for target in inp.split(" "):
|
||||||
conn.join(inp)
|
if not target.startswith("#"):
|
||||||
|
target = "#{}".format(target)
|
||||||
|
notice("Attempting to join {}...".format(target))
|
||||||
|
conn.join(target)
|
||||||
|
|
||||||
|
|
||||||
@hook.command(autohelp=False, permissions=["botcontrol"])
|
@hook.command(autohelp=False, permissions=["botcontrol"])
|
||||||
|
@ -148,9 +151,12 @@ def part(inp, conn=None, chan=None, notice=None):
|
||||||
If [channel] is blank the bot will leave the
|
If [channel] is blank the bot will leave the
|
||||||
channel the command was used in."""
|
channel the command was used in."""
|
||||||
if inp:
|
if inp:
|
||||||
target = inp
|
targets = inp
|
||||||
else:
|
else:
|
||||||
target = chan
|
targets = chan
|
||||||
|
for target in targets.split(" "):
|
||||||
|
if not target.startswith("#"):
|
||||||
|
target = "#{}".format(target)
|
||||||
notice("Attempting to leave {}...".format(target))
|
notice("Attempting to leave {}...".format(target))
|
||||||
conn.part(target)
|
conn.part(target)
|
||||||
|
|
||||||
|
|
Reference in a new issue