开发者在使用SDK开发机器人时,可以在程序中添加相应的代码来实现活动窗口功能。代码示例如下。
JAVA
else if ("p4".equalsIgnoreCase(command)) {
session.sendActivity("http://sp.xiaoi.com ","Incesoft iBot Platform");
}
-------------------------------------------------------------------------------------------------------
C#
else if ("p4".ToUpper().Equals(command.ToUpper()))
{
session.sendActivity("http://sp.xiaoi.com", "Incesoft iBot Platform");
}
-------------------------------------------------------------------------------------------------------
C++
if(strcmp(lpMsg, "p4") == 0)
{
strcat(msg, "\r");
strcat(msg, "Reply a P4 page to you, please accept the invitation!");
this->BotCommand.SendMsg(lpBuddyAccount, msg);
this->BotCommand.SendPage(lpBuddyAccount, " http://sp.xiaoi.com ", " Incesoft iBot Platform ");
}
-------------------------------------------------------------------------------------------------------
上面的代码表示:
当机器人接收的命令为p4时,将向用户发送一个打开活动窗口的邀请,活动窗口显示内容是网址http://sp.xiaoi.com所指向的内容,活动窗口内容名称为Incesoft iBot Platform表示。
用户接受到机器人发送的邀请后,在对话窗口中显示如下信息:
Robot001 邀请您使用Incesoft iBot Platform。您是要接受 (Alt+C) 还是拒绝 (Alt+D) 该邀请?
其中:Robot001为机器人名称
小i机器人服务列表 更多 |
|
机器人排行|
牛牛 hi.stock@msn.co.. |
|
|
scheduler scheduler@lenov.. |
|
|
康博士 family.dr@live... |
|
|
(*)石头哥哥 aspx.net@live.c.. |
|
|
叽歪小弟 wo@jiwai.de |
|
|
我爱背单词 wordman@live.cn |
|
|
猜灯谜 durobot@hotmail.. |
|
|
小明百事通达人 mbot@minfo.com |
|
|
化工精灵 chemoffer@hotma.. |
|
|
iWater boy007_2000@hot.. |
|
机器人分类 |
|||||||||||||||||||||
|