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 codecs
2- import json
3- import os
4- import random
5- import asyncio
6-
7- from cloudbot import hook
8- from cloudbot .util import textgen
9-
10- @hook .on_start ()
11- def load_clintons (bot ):
12- """
13- :type bot: cloudbot.bot.CloudBot
14- """
15- global clinton_data
16-
17- with codecs .open (os .path .join (bot .data_dir , "clinton.json" ), encoding = "utf-8" ) as f :
18- clinton_data = json .load (f )
19-
20- @asyncio .coroutine
21- @hook .command
22- def clinton (text , action ):
23- """clinton a user."""
24- user = text .strip ()
25- generator = textgen .TextGenerator (clinton_data ["templates" ], clinton_data ["parts" ], variables = {"user" : user })
26- action (generator .generate_string ())
1+ import codecs
2+ import json
3+ import os
4+ import random
5+ import asyncio
6+
7+ from cloudbot import hook
8+ from cloudbot .util import textgen
9+
10+ @hook .on_start ()
11+ def load_clintons (bot ):
12+ """
13+ :type bot: cloudbot.bot.CloudBot
14+ """
15+ global clinton_data
16+
17+ with codecs .open (os .path .join (bot .data_dir , "clinton.json" ), encoding = "utf-8" ) as f :
18+ clinton_data = json .load (f )
19+
20+ @asyncio .coroutine
21+ @hook .command
22+ def clinton (text , action ):
23+ """clinton a user."""
24+ user = text .strip ()
25+ generator = textgen .TextGenerator (clinton_data ["templates" ], clinton_data ["parts" ], variables = {"user" : user })
26+ action (generator .generate_string ())
You can’t perform that action at this time.
0 commit comments