#11 fixxxx scary bug
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
Simple_Not 2024-03-19 14:12:14 +10:00
parent 192687a5ea
commit a571709afa

29
bot.py
View File

@ -7,18 +7,23 @@ from global_conf import CONFIG
def remake_field_generator(d, field='text'): def remake_field_generator(d, field='text'):
for k, v in d.items(): if isinstance(d, list):
if k == field: for k2 in d:
d[k] = '<blank!>' for id_val in remake_field_generator(k2):
yield v yield id_val
elif isinstance(v, list): elif isinstance(d, dict):
for k2 in v: for k, v in d.items():
for id_val in remake_field_generator(k2): if k == field:
yield id_val d[k] = '<blank!>'
elif isinstance(v, dict): yield v
for id_val in remake_field_generator(v): elif isinstance(v, list):
yield id_val 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): def filter_grammar_messages(record):
if record.args and (not None in record.args): if record.args and (not None in record.args):