forked from Pavel_Durov/python_bot
#11 fixxxx scary bug
This commit is contained in:
parent
192687a5ea
commit
a571709afa
29
bot.py
29
bot.py
@ -7,18 +7,23 @@ from global_conf import CONFIG
|
||||
|
||||
|
||||
|
||||
def remake_field_generator(d, field='text'):
|
||||
for k, v in d.items():
|
||||
if k == field:
|
||||
d[k] = '<blank!>'
|
||||
yield v
|
||||
elif isinstance(v, list):
|
||||
for k2 in v:
|
||||
for id_val in remake_field_generator(k2):
|
||||
yield id_val
|
||||
elif isinstance(v, dict):
|
||||
for id_val in remake_field_generator(v):
|
||||
yield id_val
|
||||
def remake_field_generator(d, field='text'):
|
||||
if isinstance(d, list):
|
||||
for k2 in d:
|
||||
for id_val in remake_field_generator(k2):
|
||||
yield id_val
|
||||
elif isinstance(d, dict):
|
||||
for k, v in d.items():
|
||||
if k == field:
|
||||
d[k] = '<blank!>'
|
||||
yield v
|
||||
elif isinstance(v, list):
|
||||
for k2 in v:
|
||||
for id_val in remake_field_generator(k2):
|
||||
yield id_val
|
||||
elif isinstance(v, dict):
|
||||
for id_val in remake_field_generator(v):
|
||||
yield id_val
|
||||
|
||||
def filter_grammar_messages(record):
|
||||
if record.args and (not None in record.args):
|
||||
|
Loading…
Reference in New Issue
Block a user