Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
at_sender = kwargs.pop('at_sender', False) and 'user_id' in context
context = context.copy()
context['message'] = message
context.update(kwargs)
if 'message_type' not in context:
if 'group_id' in context:
context['message_type'] = 'group'
elif 'discuss_id' in context:
context['message_type'] = 'discuss'
elif 'user_id' in context:
context['message_type'] = 'private'
if at_sender and context['message_type'] != 'private':
context['message'] = MessageSegment.at(context['user_id']) + \
MessageSegment.text(' ') + context['message']
return await self.send_msg(**context)