NIMRobotObject.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //
  2. // NIMRobotObject.h
  3. // NIMLib
  4. //
  5. // Created by Netease.
  6. // Copyright © 2017年 Netease. All rights reserved.
  7. //
  8. #import "NIMMessageObjectProtocol.h"
  9. NS_ASSUME_NONNULL_BEGIN
  10. /**
  11. * 机器人消息附件实例对象
  12. */
  13. @interface NIMRobotObject : NSObject<NIMMessageObject>
  14. /**
  15. * 机器人消息附件对象构造方法
  16. *
  17. * @param content 机器人识别内容
  18. *
  19. * @param robotId 机器人 Id
  20. *
  21. * @discussion content 参数不是用来做 UI 显示的, 显示 (如对话气泡) 请用 message.text 字段
  22. *
  23. * @return 机器人消息附件对象实例
  24. */
  25. - (instancetype)initWithRobot:(NSString *)content
  26. robotId:(NSString *)robotId;
  27. /**
  28. * 机器人消息附件对象构造方法
  29. *
  30. * @param robotId 机器人 Id
  31. *
  32. * @param target 模块 Id
  33. *
  34. * @param param 模块跳转参数
  35. *
  36. * @return 机器人消息附件对象实例
  37. */
  38. - (instancetype)initWithRobotId:(NSString *)robotId
  39. target:(NSString *)target
  40. param:(NSString *)param;
  41. /**
  42. * 判断此消息是否是属于机器人回复的消息
  43. */
  44. @property (nonatomic, assign, readonly) BOOL isFromRobot;
  45. /**
  46. * 当该消息为用户上行发送给机器人时,此字段为目标机器人 Id,
  47. * 当该消息为机器人回复的消息时, 此字段为本消息所属机器人 Id
  48. */
  49. @property (nullable, nonatomic, copy, readonly) NSString *robotId;
  50. /**
  51. * 机器人回复的消息结果,只在机器人下行消息,此字段有效
  52. */
  53. @property (nullable, nonatomic, copy, readonly) NSDictionary *response;
  54. /**
  55. * 机器人回复的消息所属的提问消息 Id ,只在机器人下行消息,此字段有效
  56. */
  57. @property (nullable, nonatomic, copy, readonly) NSString *responseForMessageId;
  58. @end
  59. NS_ASSUME_NONNULL_END