def stateful_create_channel(self, call):
if isinstance(call.func, ast.Attribute):
if call.func.attr == 'create_channel':
if self.interactive and not prompt_change(
'A possible change was found to make {} stateful.'.format(call.func.attr)
):
return call
for kw in list(call.keywords):
if isinstance(kw.value, ast.Attribute):
channel_type = kw.value.attr
call.keywords.remove(kw)
break
else:
channel_type = 'text'
call.func.attr = 'create_{}_channel'.format(channel_type)
guild = call.args[0]
call.func.value = guild
stats_counter['call_changes'] += 1
return call
评论列表
文章目录