我目前正在开发一个不和谐的机器人,我想“翻译”这个:
[
{
"command" : "ping",
"response" : "pong"
},
{
"command" : "hi",
"response" : "hello"
}
]
.net 代码看起来像这样
private void RegisterPingCommand()
{
commands.CreateCommand("ping")
.Do(async (e) =>
{
await e.Channel.SendMessage("pong");
});
} }
private void RegisterHiCommand()
{
commands.CreateCommand("Hi")
.Do(async (e) =>
{
await e.Channel.SendMessage("Hello");
});
} }