-
Notifications
You must be signed in to change notification settings - Fork 5
3.怎么发信息呢?( ω・* )ノ
MessageSendToType分为三类:
{ 好友Friend| 群Group| 私聊(指陌生人)Private}
本框架仅提供了信息的V2接口,在继承特点上实现了以下几类
MsgV2-> 最基础的信息封装类MsgV2_TxtMsg-> 文本信息封装类 简拼:M2TMsgV2_PicMsg-> 图片信息封装类 简拼:M2PMsgV2_VocMsg-> 语音信息封装类 简拼:M2VMsgV2_FwdMsg-> 转发信息封装类 简拼:M2FMsgV2_RplMsg-> 回复信息封装类 简拼:M2RMsgV2_JsnMsg-> JSON信息封装类 简拼:M2JMsgV2_XmlMsg-> XML信息封装类 简拼:M2X
3.1 在您要发送的
定义域内 输入new按空格
3.2 然后输入上面对应的信息类型 (例如:M2T)
3.3 然后按TAB再打上(
3.4 输入一个QQ号的数字,然后点击,
3.5 输入M按回车或者TAB然后输入.
3.6 然后用小键盘上下选择你要发送的对象,例如Friend
3.7 输入,然后输入一个字符串(你要发送的信息)
*一个要发送给好友的文本信息就构造好了
例:new MsgV2_TxtMsg(123456,MessageSendToType.Friend,"123")只选用picUrl参数:
new MsgV2_PicMsg( 123, MessageSendToType.Friend, picUrl:"http://..." )
4.1 在消息后面调用
.Send();方法 d(´ω`*)
4.2 将方法前面添加await算符 ヽ(・ω・´メ)
4.3 将定义域方法改为async void(不获取返回值)
4.3.1 将定义域方法改为async Task<string>并且return刚才的值 (获取返回值)
例:await new MsgV2_TxtMsg(123456,MessageSendToType.Friend,"123").Send();
5.1 如果您不需要检测发送状态,那么您可以空掉
await算符前面的内容,也可以使用弃元_来丢弃参数;φ(>ω<)
5.2 您可以使用JObject.Parse方法来高效的判断内部的序列内容,(框架自带Newtonsoft)(/ω\*)
5.3 关于返回的序列内容请参见IOT/OPQ官方wiki的信息返回内容 点这
属性组
+ long ToUserUid -- [long SendTo]
+ int SendToType -- [MessageSendToType sendToType]
+ string SendMsgType -- [MessageSendType sendMsgType]
+ string Content -- [string Content]
+ long GroupID -- [long GroupId]
方法组
+ 构造(long,MessageSendToType,MessageSendType,string,long)
+ Task<string> Send()
属性组
属组没有公开的或私有的属性
方法组
+ 构造(long,MessageSendToType,string,GroupId*,atqq*)
属性组(任选其一)
+ string PicUrl -- [string picUrl]
+ string PicPath -- [string picPath]
+ string PicMd5s -- [string PicMd5s]
方法组
+ 构造(long,MessageSendToType,string*,string*,string*,string*,long*,long*)
属性组(任选其一)
+ string VoiceUrl -- [string voiceUrl]
+ string VoicePath -- [string voicePath]
方法组
+ 构造(long,MessageSendToType,string*,string*,long*,long*)
属性组
+ string ForwordBuf -- [string forwordBuf]
+ string ForwordField -- [string forwordField]
方法组
+ 构造(long,MessageSendToType,string,string,long*,long*)
属性组
::inner Class replayInfo::
+ long MsgSeq -- [string msgSeq]
+ long MsgTime -- [string msgTime]
+ long UserID -- [string userID]
+ string rawContent -- [string rawContent]
::outer Class::
方法组
+ 构造(long,replayInfo)
+ 构造(long,long,long,long,string)
属性组
属组没有公开的或私有的属性
方法组
+ 构造(long,MessageSendToType,string,long*,long*)
属性组
属组没有公开的或私有的属性
方法组
+ 构造(long,MessageSendToType,string,long*,long*)
@Copyright 2020 Electronicute *
萌喵电子(青岛)有限公司
萌喵电子信息技术组 [总组]
