CreateDmsApi

class CreateDmsApi(recipientId: ID, sourceGuildId: ID) : TencentApi<DirectMessageSession>

创建私信会话

接口

POST /users/@me/dms

功能描述

用于机器人和在同一个频道内的成员创建私信会话。

机器人和用户存在共同频道才能创建私信会话。 创建成功后,返回创建成功的频道 id ,子频道 id 和创建时间。

参数

字段名类型描述
recipient_idstring接收者 id
source_guild_idstring源频道 id

Author

ForteScarlet

Constructors

Link copied to clipboard
fun CreateDmsApi(recipientId: ID, sourceGuildId: ID)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend fun doRequest(client: HttpClient, server: Url, token: String, decoder: StringFormat = Json): DirectMessageSession

使用此api发起一次请求,并得到预期中的结果。如果返回了代表错误的响应值

Link copied to clipboard
open fun post(resp: DirectMessageSession)

Do something after resp.

Link copied to clipboard
open override fun route(builder: RouteInfoBuilder)

此请求对应的api路由路径以及路径参数。 例如:/guild/list

Properties

Link copied to clipboard
open override val body: Any

此次请求所发送的数据。为null则代表没有参数。

Link copied to clipboard
open override val method: HttpMethod

此api请求方式

Link copied to clipboard
open override val resultDeserializer: DeserializationStrategy<out DirectMessageSession>

得到响应值的反序列化器.

Extensions

Link copied to clipboard
suspend fun <R> TencentApi<R>.request(client: HttpClient, server: Url, token: String, decoder: StringFormat = defaultJson): R

通过提供的参数,对此api进行请求并得到最终结果。