Spaces:
Sleeping
Sleeping
Thibault Duplessis commited on
Commit ·
1e4ba97
1
Parent(s): 874c4f8
add howto/help command
Browse files- conversation.py +3 -1
conversation.py
CHANGED
|
@@ -9,12 +9,14 @@ class Conversation():
|
|
| 9 |
def react(self, line):
|
| 10 |
print("*** {} [{}] {}: {}".format(self.game.url(), line.room, line.username, line.text.encode("utf-8")))
|
| 11 |
if (line.text[0] == self.command_prefix):
|
| 12 |
-
self.command(line, line.text[1:])
|
| 13 |
pass
|
| 14 |
|
| 15 |
def command(self, line, cmd):
|
| 16 |
if cmd == "name" or cmd == "engine":
|
| 17 |
self.send_reply(line, self.engine.name())
|
|
|
|
|
|
|
| 18 |
|
| 19 |
def send_reply(self, line, reply):
|
| 20 |
self.xhr.chat(self.game.id, line.room, reply)
|
|
|
|
| 9 |
def react(self, line):
|
| 10 |
print("*** {} [{}] {}: {}".format(self.game.url(), line.room, line.username, line.text.encode("utf-8")))
|
| 11 |
if (line.text[0] == self.command_prefix):
|
| 12 |
+
self.command(line, line.text[1:].lower())
|
| 13 |
pass
|
| 14 |
|
| 15 |
def command(self, line, cmd):
|
| 16 |
if cmd == "name" or cmd == "engine":
|
| 17 |
self.send_reply(line, self.engine.name())
|
| 18 |
+
if cmd == "howto" or cmd == "help":
|
| 19 |
+
self.send_reply(line, "How to run your own bot: lichess.org/api#tag/Chess-Bot")
|
| 20 |
|
| 21 |
def send_reply(self, line, reply):
|
| 22 |
self.xhr.chat(self.game.id, line.room, reply)
|