DmsSendApi

发送私信

接口

POST /dms/{guild_id}/messages

功能描述

用于发送私信消息,前提是已经创建了私信会话。

  • 私信的 guild_id 在创建私信会话时以及私信消息事件中获取。

  • 私信场景下,每个机器人每天可以对一个用户发 2 条主动消息。

  • 私信场景下,每个机器人每天累计可以发 200 条主动消息。

  • 私信场景下,被动消息没有条数限制。

参数

发送消息 参数一致。

返回

发送消息 返回一致。

Author

ForteScarlet

See also

Types

Link copied to clipboard

Properties

Link copied to clipboard
open override val headers: Headers
Link copied to clipboard
protected open override val path: Array<String>

Inherited properties

Link copied to clipboard
open override val body: Any?
Link copied to clipboard
open override val method: HttpMethod
Link copied to clipboard
open override val url: Url

最终用于请求的目标地址。 默认会使用 QQGuild.URL 作为其域名地址。

Functions

Link copied to clipboard
protected open override fun createBody(): Any

Inherited functions

Link copied to clipboard
protected open fun URLBuilder.buildUrl()

已经完成 path 拼接后、追加其他额外内容(例如parameter)时使用

Link copied to clipboard
suspend fun <R : Any> QQGuildApi<R>.request(client: HttpClient, token: String? = null, server: Url? = null, appId: String? = null): HttpResponse

使用 client 向当前目标 API QQGuildApi 发起请求。

Link copied to clipboard
fun QQGuildApi<*>.requestAsync(client: HttpClient, token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, appId: String? = null): CompletableFuture<HttpResponse>
Link copied to clipboard
fun QQGuildApi<*>.requestBlocking(client: HttpClient, token: String?, server: Url = QQGuild.URL, appId: String? = null): HttpResponse
Link copied to clipboard
suspend fun <R : Any> QQGuildApi<R>.requestData(client: HttpClient, token: String?, server: Url? = QQGuild.URL, decoder: Json = QQGuild.DefaultJson, appId: String? = null): R

使用此api发起一次请求,并得到预期中的结果。

Link copied to clipboard
fun <R : Any> QQGuildApi<R>.requestDataAsync(client: HttpClient, token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, appId: String? = null): CompletableFuture<R>
Link copied to clipboard
fun <R : Any> QQGuildApi<R>.requestDataBlocking(client: HttpClient, token: String?, server: Url = QQGuild.URL, appId: String? = null): R
Link copied to clipboard
fun <R : Any> QQGuildApi<R>.requestDataReserve(client: HttpClient, token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, appId: String? = null): SuspendReserve<R>
Link copied to clipboard
fun QQGuildApi<*>.requestReserve(client: HttpClient, token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, appId: String? = null): SuspendReserve<HttpResponse>
Link copied to clipboard
inline suspend fun <R : Any> QQGuildApi<R>.requestText(client: HttpClient, token: String?, server: Url? = QQGuild.URL, appId: String? = null, useResp: (HttpResponse) -> Unit = {}): String

通过 request 得到响应,读取为文本并输出debug日志后返回。 不会进行校验。

Link copied to clipboard
fun QQGuildApi<*>.requestTextAsync(client: HttpClient, token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, appId: String? = null): CompletableFuture<String>
Link copied to clipboard
fun QQGuildApi<*>.requestTextBlocking(client: HttpClient, token: String?, server: Url = QQGuild.URL, appId: String? = null): String
Link copied to clipboard
fun QQGuildApi<*>.requestTextReserve(client: HttpClient, token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, appId: String? = null): SuspendReserve<String>