File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments