-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxl_bot.py
58 lines (47 loc) · 1.42 KB
/
xl_bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from lib.command_executor import print_the_help
from lib.command_executor import Formatter
from lib.kinesis import send_chat_to_stream
from lib.morgue_saver import morgue_saver
from lib.character import Character
from flask_app import app
@app.route("/xl-bot/armour/<name>")
def armour(name):
character = Character(name=name)
formatter = Formatter(character)
msg = formatter.print_armour()
if msg:
send_chat_to_stream(msg)
return " ".join(msg)
else:
return "No Armour Found!"
@app.route("/xl-bot/runes/<name>")
def runes(name):
character = Character(name=name)
formatter = Formatter(character)
msg = formatter.print_runes()
if msg:
send_chat_to_stream(msg)
return " ".join(msg)
else:
return "No Runes Found!"
@app.route("/xl-bot/help")
def help():
logger = None
print_the_help(logger)
return "We Helped!"
@app.route("/xl-bot/fetch/<name>")
def fetch(name):
character = Character(name=name)
morgue_saver(character, character.non_saved_morgue_file(), True)
return f"Fetched {name}'s Morgue File!"
# Should we have it /name/command or /command/name
@app.route("/xl-bot/weapons/<name>")
def weapons(name):
character = Character(name=name)
formatter = Formatter(character)
msg = formatter.print_weapons()
if msg:
send_chat_to_stream(msg)
return " ".join(msg)
else:
return "No Weapons Found!"