C# Class Senparc.Weixin.QY.AdvancedAPIs.ChatApi

Datei anzeigen Open project: JeffreySu/WeiXinMPSDK

Public Methods

Method Description
ClearNotify ( string accessToken, string opUser, Chat_Type type, string chatIdOrUserId, int timeOut = Config.TIME_OUT ) : QyJsonResult

清除消息未读状态

ClearNotifyAsync ( string accessToken, string opUser, Chat_Type type, string chatIdOrUserId, int timeOut = Config.TIME_OUT ) : Task

【异步方法】清除消息未读状态

CreateChat ( string accessToken, string chatId, string name, string owner, string userlist, int timeOut = Config.TIME_OUT ) : QyJsonResult

创建会话

CreateChatAsync ( string accessToken, string chatId, string name, string owner, string userlist, int timeOut = Config.TIME_OUT ) : Task

【异步方法】创建会话

GetChat ( string accessToken, string chatId ) : GetChatResult

获取会话

GetChatAsync ( string accessToken, string chatId ) : Task

【异步方法】获取会话

QuitChat ( string accessToken, string chatId, string opUser, int timeOut = Config.TIME_OUT ) : QyJsonResult

退出会话

QuitChatAsync ( string accessToken, string chatId, string opUser, int timeOut = Config.TIME_OUT ) : Task

【异步方法】退出会话

SendChatMessage ( string accessToken, string sender, Chat_Type type, ChatMsgType msgType, string chatIdOrUserId, string contentOrMediaId, int timeOut = Config.TIME_OUT ) : QyJsonResult

发消息

SendChatMessageAsync ( string accessToken, string sender, Chat_Type type, ChatMsgType msgType, string chatIdOrUserId, string contentOrMediaId, int timeOut = Config.TIME_OUT ) : Task

【异步方法】发消息

SetMute ( string accessToken, List userMuteList, int timeOut = Config.TIME_OUT ) : SetMuteResult

设置成员新消息免打扰

SetMuteAsync ( string accessToken, List userMuteList, int timeOut = Config.TIME_OUT ) : Task

【异步方法】设置成员新消息免打扰

UpdateChat ( string accessToken, string chatId, string opUser, string name = null, string owner = null, string addUserList = null, string delUserList = null, int timeOut = Config.TIME_OUT ) : QyJsonResult

修改会话信息

UpdateChatAsync ( string accessToken, string chatId, string opUser, string name = null, string owner = null, string addUserList = null, string delUserList = null, int timeOut = Config.TIME_OUT ) : Task

【异步方法】修改会话信息

Method Details

ClearNotify() public static method

清除消息未读状态
public static ClearNotify ( string accessToken, string opUser, Chat_Type type, string chatIdOrUserId, int timeOut = Config.TIME_OUT ) : QyJsonResult
accessToken string
opUser string 会话所有者的userid
type Chat_Type 会话类型:single|group,分别表示:群聊|单聊
chatIdOrUserId string 会话值,为userid|chatid,分别表示:成员id|会话id,单聊是userid,群聊是chatid
timeOut int
return Senparc.Weixin.Entities.QyJsonResult

ClearNotifyAsync() public static method

【异步方法】清除消息未读状态
public static ClearNotifyAsync ( string accessToken, string opUser, Chat_Type type, string chatIdOrUserId, int timeOut = Config.TIME_OUT ) : Task
accessToken string
opUser string 会话所有者的userid
type Chat_Type 会话类型:single|group,分别表示:群聊|单聊
chatIdOrUserId string 会话值,为userid|chatid,分别表示:成员id|会话id,单聊是userid,群聊是chatid
timeOut int
return Task

CreateChat() public static method

创建会话
public static CreateChat ( string accessToken, string chatId, string name, string owner, string userlist, int timeOut = Config.TIME_OUT ) : QyJsonResult
accessToken string
chatId string 会话id。字符串类型,最长32个字符。只允许字符0-9及字母a-zA-Z, 如果值内容为64bit无符号整型:要求值范围在[1, 2^63)之间,[2^63, 2^64)为系统分配会话id区间
name string 会话标题
owner string 管理员userid,必须是该会话userlist的成员之一
userlist string 会话成员列表,成员用userid来标识。会话成员必须在3人或以上,1000人以下
timeOut int
return Senparc.Weixin.Entities.QyJsonResult

CreateChatAsync() public static method

【异步方法】创建会话
public static CreateChatAsync ( string accessToken, string chatId, string name, string owner, string userlist, int timeOut = Config.TIME_OUT ) : Task
accessToken string
chatId string 会话id。字符串类型,最长32个字符。只允许字符0-9及字母a-zA-Z, 如果值内容为64bit无符号整型:要求值范围在[1, 2^63)之间,[2^63, 2^64)为系统分配会话id区间
name string 会话标题
owner string 管理员userid,必须是该会话userlist的成员之一
userlist string 会话成员列表,成员用userid来标识。会话成员必须在3人或以上,1000人以下
timeOut int
return Task

GetChat() public static method

获取会话
public static GetChat ( string accessToken, string chatId ) : GetChatResult
accessToken string
chatId string
return Senparc.Weixin.QY.AdvancedAPIs.Chat.GetChatResult

GetChatAsync() public static method

【异步方法】获取会话
public static GetChatAsync ( string accessToken, string chatId ) : Task
accessToken string
chatId string
return Task

QuitChat() public static method

退出会话
public static QuitChat ( string accessToken, string chatId, string opUser, int timeOut = Config.TIME_OUT ) : QyJsonResult
accessToken string
chatId string
opUser string
timeOut int
return Senparc.Weixin.Entities.QyJsonResult

QuitChatAsync() public static method

【异步方法】退出会话
public static QuitChatAsync ( string accessToken, string chatId, string opUser, int timeOut = Config.TIME_OUT ) : Task
accessToken string
chatId string
opUser string
timeOut int
return Task

SendChatMessage() public static method

发消息
public static SendChatMessage ( string accessToken, string sender, Chat_Type type, ChatMsgType msgType, string chatIdOrUserId, string contentOrMediaId, int timeOut = Config.TIME_OUT ) : QyJsonResult
accessToken string
sender string 发送人的userId
type Chat_Type 接收人类型:single|group,分别表示:群聊|单聊
msgType ChatMsgType 消息类型,text|image|file
chatIdOrUserId string 会话值,为userid|chatid,分别表示:成员id|会话id,单聊是userid,群聊是chatid
contentOrMediaId string 文本消息是content,图片或文件是mediaId
timeOut int
return Senparc.Weixin.Entities.QyJsonResult

SendChatMessageAsync() public static method

【异步方法】发消息
public static SendChatMessageAsync ( string accessToken, string sender, Chat_Type type, ChatMsgType msgType, string chatIdOrUserId, string contentOrMediaId, int timeOut = Config.TIME_OUT ) : Task
accessToken string
sender string 发送人的userId
type Chat_Type 接收人类型:single|group,分别表示:群聊|单聊
msgType ChatMsgType 消息类型,text|image|file
chatIdOrUserId string 会话值,为userid|chatid,分别表示:成员id|会话id,单聊是userid,群聊是chatid
contentOrMediaId string 文本消息是content,图片或文件是mediaId
timeOut int
return Task

SetMute() public static method

设置成员新消息免打扰
public static SetMute ( string accessToken, List userMuteList, int timeOut = Config.TIME_OUT ) : SetMuteResult
accessToken string
userMuteList List 成员新消息免打扰参数,数组,最大支持10000个成员
timeOut int
return Senparc.Weixin.QY.AdvancedAPIs.Chat.SetMuteResult

SetMuteAsync() public static method

【异步方法】设置成员新消息免打扰
public static SetMuteAsync ( string accessToken, List userMuteList, int timeOut = Config.TIME_OUT ) : Task
accessToken string
userMuteList List 成员新消息免打扰参数,数组,最大支持10000个成员
timeOut int
return Task

UpdateChat() public static method

修改会话信息
public static UpdateChat ( string accessToken, string chatId, string opUser, string name = null, string owner = null, string addUserList = null, string delUserList = null, int timeOut = Config.TIME_OUT ) : QyJsonResult
accessToken string
chatId string 会话id
opUser string 操作人userid
name string 会话标题
owner string 管理员userid,必须是该会话userlist的成员之一
addUserList string 会话新增成员列表,成员用userid来标识
delUserList string 会话退出成员列表,成员用userid来标识
timeOut int
return Senparc.Weixin.Entities.QyJsonResult

UpdateChatAsync() public static method

【异步方法】修改会话信息
public static UpdateChatAsync ( string accessToken, string chatId, string opUser, string name = null, string owner = null, string addUserList = null, string delUserList = null, int timeOut = Config.TIME_OUT ) : Task
accessToken string
chatId string 会话id
opUser string 操作人userid
name string 会话标题
owner string 管理员userid,必须是该会话userlist的成员之一
addUserList string 会话新增成员列表,成员用userid来标识
delUserList string 会话退出成员列表,成员用userid来标识
timeOut int
return Task