Skip to content

Commit 4ca30b6

Browse files
committed
Start work on new FML command
1 parent d792f70 commit 4ca30b6

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

plugins/fmylife_plus.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import requests
2+
3+
from cloudbot import hook
4+
5+
API_BASE = "http://api.fmylife.com/view/{}"
6+
7+
API_SEARCH = API_BASE.format("search")
8+
API_RANDOM = API_BASE.format("random")
9+
API_ID = API_BASE.format("{}/nocomment")
10+
11+
12+
def get_random():
13+
pass
14+
15+
16+
def get_by_id(id):
17+
pass
18+
19+
20+
def get_by_search(query):
21+
pass
22+
23+
24+
def format_fml(fml):
25+
pass
26+
27+
28+
@hook.on_start()
29+
def load_key(bot):
30+
global api_key
31+
api_key = bot.config.get("api_keys", {}).get("fmylife", None)
32+
33+
34+
@hook.command("fmylife", "fml")
35+
def fmylife(text):
36+
""" """
37+
if not api_key:
38+
return "This command requires an API key from fmylife.com."
39+
40+
if text:
41+
if text.isdigit():
42+
pass
43+
# get_by_id
44+
else:
45+
pass
46+
# get_by_search
47+
else:
48+
pass
49+
# get_random
50+
51+
# format_fml

0 commit comments

Comments
 (0)