File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,13 +77,10 @@ def load_foods(bot):
7777 load_template_data (bot , food .datafile , basic_food_data [food .name ])
7878
7979
80- def basic_format (text , data , food_type , ** kwargs ):
80+ def basic_format (text , data , ** kwargs ):
8181 user = text
8282 kwargs ['user' ] = user
8383
84- if not is_valid (user ):
85- return "I can't give {} to that user." .format (food_type )
86-
8784 generator = textgen .TextGenerator (
8885 data ["templates" ], data ["parts" ], variables = kwargs
8986 )
@@ -99,7 +96,10 @@ def make_cmd_list(value):
9996
10097def basic_food (food ):
10198 def func (text , action ):
102- action (basic_format (text , basic_food_data [food .name ], food .unitname ))
99+ if not is_valid (text ):
100+ return "I can't give {} to that user." .format (food .unitname )
101+
102+ action (basic_format (text , basic_food_data [food .name ]))
103103
104104 func .__name__ = food .name
105105 func .__doc__ = "<user> - gives {} to [user]" .format (food .unitname )
You can’t perform that action at this time.
0 commit comments