How to use the aiocqhttp.ApiError function in aiocqhttp

To help you get started, we’ve selected a few aiocqhttp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github richardchien / python-aiocqhttp / demo.py View on Github external
async def handle_msg(context):
    # 下面这句等价于 bot.send_private_msg(user_id=context['user_id'], message='你好呀,下面一条是你刚刚发的:')
    try:
        await bot.send(context, '你好呀,下面一条是你刚刚发的:')
    except ApiError:
        pass
    return {'reply': context['message'],
            'at_sender': False}  # 返回给 HTTP API 插件,走快速回复途径