Skip to main content
Module

x/bcdeno_api/mod.ts>default

🎲 Use BCDice-API from Deno easily
Latest
class default
import { default } from "https://deno.land/x/bcdeno_api@v1.1.1/mod.ts";

BCDice-APIと通信するためのクライアント

Constructors

new
default(webClient: WebClient)

Properties

private
readonly
webClient: WebClient
readonly
prefixUrl: string | URL

Methods

private
checkType(
result: boolean,
target: unknown,
targetName?,
): void

resultがfalseだった場合に、コード INCORRECT_RESPONSE の BCDiceErrorをthrowする

private
get(path: string, options?: Options): Promise<any>

WebClientからGETリクエストを送信し、エラー時にBCDiceErrorをthrowする

diceRoll(id: string, command: string): Promise<CommandResult>

ダイスを振る

getAPIAdmin(): Promise<APIAdmin>

BCDice-APIの管理者情報を取得する

BCDiceとBCDice-API自身のバージョンを取得

使用可能なゲームシステムを取得する

getGameSystem(id: string): Promise<GameSystem>

指定されたゲームシステムの情報を取得する

BCDiceのオリジナル表を実行する 詳しくは https://docs.bcdice.org/original_table.html を参照。

Static Methods

create(prefixUrl: string): BCDiceAPIClient

サーバーURLからBCDiceWebClientのインスタンスを作成する