KookComponentGuildBot

abstract class KookComponentGuildBot : KookComponentBot, GuildBot

Kook 组件中针对于 GuildBot 的实现类型。

实现 KookComponentBotGuildBot, 代表一个bot在某个频道服务器中所扮演的成员。

See also

Constructors

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
abstract suspend override fun asMember(): KookGuildMember

得到当前组织中的 Kook bot在当前组织中所扮演的成员对象。

Link copied to clipboard
abstract suspend override fun cancel(reason: Throwable?): Boolean

终止当前bot。

Link copied to clipboard
Link copied to clipboard
open fun cancelBlocking(reason: Throwable?): Boolean
Link copied to clipboard
open suspend override fun contact(id: ID): KookUserChat
Link copied to clipboard
open fun delay(duration: JavaDuration, runnable: Runnable): DelayableCompletableFuture<Void?>
open fun delay(millis: Long, runnable: Runnable): DelayableCompletableFuture<Void?>
open fun delay(time: Long, timeUnit: TimeUnit, runnable: Runnable): DelayableCompletableFuture<Void?>
Link copied to clipboard
open fun <V> delayAndCompute(duration: JavaDuration, supplier: Supplier<V>): DelayableCompletableFuture<V>
open fun <V> delayAndCompute(millis: Long, supplier: Supplier<V>): DelayableCompletableFuture<V>
open fun <V> delayAndCompute(time: Long, timeUnit: TimeUnit, supplier: Supplier<V>): DelayableCompletableFuture<V>
Link copied to clipboard
open fun getContact(id: ID): Contact?
Link copied to clipboard
open fun getContactAsync(id: ID): CompletableFuture<out Contact?>
Link copied to clipboard
open fun getGroup(id: ID): Group?
Link copied to clipboard
open fun getGroupAsync(id: ID): CompletableFuture<out Group?>
Link copied to clipboard
open fun getGuild(id: ID): Guild?
Link copied to clipboard
open fun getGuildAsync(id: ID): CompletableFuture<out Guild?>
Link copied to clipboard
open suspend override fun group(id: ID): Group?
Link copied to clipboard
open suspend override fun guild(id: ID): KookGuild?
Link copied to clipboard
open override fun invokeOnCompletion(handler: CompletionHandler)
Link copied to clipboard
abstract infix override fun isMe(id: ID): Boolean

判断此ID是否代表当前bot。可能代表bot的id有可能是 clientId, 也有可能是此bot在系统中作为User时候的 user id.

Link copied to clipboard
abstract suspend override fun join()

挂起直到当前bot被关闭。

Link copied to clipboard
open fun joinBlocking()
Link copied to clipboard
open suspend override fun resolveImage(id: ID): KookAssetImage
Link copied to clipboard
open fun resolveImageAsync(id: ID): CompletableFuture<out Image<*>>
Link copied to clipboard
open fun resolveImageBlocking(id: ID): Image<*>
Link copied to clipboard
open fun sendIfSupportBlocking(message: Message): MessageReceipt?
Link copied to clipboard
abstract suspend override fun start(): Boolean

启动此bot。

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun toMember(): GuildMember
Link copied to clipboard
open override fun toMemberAsync(): CompletableFuture<out GuildMember>
Link copied to clipboard
abstract suspend fun uploadAsset(resource: Resource, type: Int): KookSimpleAssetMessage
open suspend fun uploadAsset(resource: Resource, type: MessageType): KookSimpleAssetMessage

上传一个资源并得到一个 KookAssetMessage.

Link copied to clipboard
abstract suspend fun uploadAssetImage(resource: Resource): KookAssetImage

提供一个资源类型并将其上传后作为 KookAssetImage 使用。

Link copied to clipboard
open suspend fun uploadImage(resource: Resource): Image<*>
Link copied to clipboard
open fun uploadImageBlocking(resource: Resource): Image<*>
Link copied to clipboard
open fun waiting()

Properties

Link copied to clipboard
abstract override val avatar: String
Link copied to clipboard
open override val bot: KookComponentBot

bot自身。

Link copied to clipboard
open val category: Category?
Link copied to clipboard
abstract override val component: KookComponent

得到对应的组件实例。

Link copied to clipboard
abstract override val contacts: Items<KookUserChat>

查询当前存在的所有 聊天会话

Link copied to clipboard
abstract override val coroutineContext: CoroutineContext
Link copied to clipboard
abstract override val eventProcessor: EventProcessor
Link copied to clipboard
open override val groups: Items<Group>
Link copied to clipboard
abstract val guildList: List<KookGuild>

直接获取当前bot存在的频道服务器列表。

Link copied to clipboard
abstract override val guilds: Items<KookGuild>

获取当前bot存在的频道服务器序列。

Link copied to clipboard
open override val id: ID

botID。此id通常代表 client id, 即 KookBot.Ticket.clientId.

Link copied to clipboard
abstract override val isActive: Boolean
Link copied to clipboard
abstract override val isCancelled: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract override val isStarted: Boolean
Link copied to clipboard
abstract override val logger: Logger
Link copied to clipboard
abstract override val manager: KookBotManager
Link copied to clipboard
abstract val sourceBot: KookBot

得到在stdlib标准库模块下所提供的 Kook bot实例。

Link copied to clipboard
abstract override val username: String

Extensions

Link copied to clipboard
inline suspend fun KookComponentBot.request(api: KookApiRequest<*>): ApiResult

通过指定Bot,利用其token和client发起请求并得到对应的ApiResult

Link copied to clipboard

通过指定Bot,利用其token和client发起请求并得到对应的ApiResult

Link copied to clipboard
inline suspend fun <T> KookComponentBot.requestData(api: KookApiRequest<T>): T

通过指定Bot,利用其token和client发起请求并得到对应的data响应值。

Link copied to clipboard

通过指定Bot,利用其token和client发起请求并得到对应的data响应值。