import OlivOS
import json

with open(‘plugin\app\xlb\json\test.json’, ‘r’,encoding=‘utf-8’) as f:
x = json.load(f)

class Event(object):
def init(plugin_event, Proc):
pass

def private_message(plugin_event, Proc):#私聊消息事件
    unity_reply(plugin_event, Proc)

def group_message(plugin_event, Proc):#群聊消息事件
    unity_reply(plugin_event, Proc)

def save(plugin_event, Proc):
    pass

def menu(plugin_event, Proc):
    pass

def unity_reply(plugin_event, Proc):
if plugin_event.data.message == ‘/bot’ or plugin_event.data.message == ‘.bot’ or plugin_event.data.message == ‘[CQ:at,qq=’ + str(plugin_event.base_info[‘self_id’]) + ‘] .bot’:
plugin_event.reply(str(x))

以上是我的代码,最后机器人发出来的消息是如下图这样的
Image description
研究半天也没搞明白怎么让dodo机器人发送卡片消息,就来论坛问问,求解答
卡片的样子如下图
Image description

7 天 后
说点什么吧...