stranger_handler.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:RandTalkBot 作者: quasiyoke 项目源码 文件源码
def on_inline_query(self, query):
        query_id, from_id, query_string = telepot.glance(query, flavor='inline_query')
        LOGGER.debug('Inline query from %d: \"%s\"', self._stranger.id, query_string)
        response = [{
            'type': 'article',
            'id': 'invitation_link',
            'title': _('Rand Talk Invitation Link'),
            'description': _('The more friends\'ll use your link -- the faster the search will be'),
            'thumb_url': 'http://randtalk.ml/static/img/logo-500x500.png',
            'message_text': (
                _('Do you want to talk with somebody, practice in foreign languages or you just want '
                    'to have some fun? Rand Talk will help you! It\'s a bot matching you with '
                    'a random stranger of desired sex speaking on your language. {0}'),
                self._stranger.get_invitation_link(),
                ),
            'parse_mode': 'Markdown',
            }]
        await self._sender.answer_inline_query(query_id, response)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号