Skip to content
Snippets Groups Projects
Commit ad98b08f authored by Svetlana Tkachenko's avatar Svetlana Tkachenko
Browse files

Use spaces in place of tabs in plugins/help.py

parent 663e9fc3
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@
@plugin
class Help(object):
'''help module, no params'''
def __init__(self, server):
self.server = server
self.commands = [ "help" ]
......@@ -15,29 +16,31 @@ class Help(object):
self.server.handle("join", self.handle_join)
def handle_command(self, channel, user, cmd, args):
if cmd == "help":
self.server.doMessage(user, "All commands can be sent in a private message to the bot, or a channel message beginning with "
+ self.server.config["comchar"] + " or " + self.server.config["nickname"] + ":")
self.server.doMessage(user, "Commands are:")
lines = (len(self.server.handlers["command"]) / 10) + 1
commandlines = []
commands = list(self.server.handlers["command"].keys())
i = 0
while (i < lines):
line = ""
j = 0
while (j < 10):
try:
command = commands.pop()
line = line + command + " "
j += 1
except IndexError:
break
commandlines.append(line)
i += 1
for commandline in commandlines:
self.server.doMessage(user, commandline)
if cmd == "help":
print(args) # ['FIRST', 'SECOND']
if args == []:
self.server.doMessage(user, "All commands can be sent in a private message to the bot, or a channel message beginning with "
+ self.server.config["comchar"] + " or " + self.server.config["nickname"] + ":")
self.server.doMessage(user, "Commands are:")
lines = (len(self.server.handlers["command"]) / 10) + 1
commandlines = []
commands = list(self.server.handlers["command"].keys())
i = 0
while (i < lines):
line = ""
j = 0
while (j < 10):
try:
command = commands.pop()
line = line + command + " "
j += 1
except IndexError:
break
commandlines.append(line)
i += 1
for commandline in commandlines:
self.server.doMessage(user, commandline)
def handle_join(self, channel, user):
self.server.doNotice(user, "Hello! My name is " + self.server.config["nickname"] + ". If you want a list of commands, type " +
self.server.config["comchar"] + "help")
\ No newline at end of file
self.server.doNotice(user, "Hello! My name is " + self.server.config["nickname"] + ". If you want a list of commands, type " +
self.server.config["comchar"] + "help")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment