Archived
94 lines
59 KiB
HTML
94 lines
59 KiB
HTML
<!DOCTYPE html><html class="default no-js"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>CommandManager | commandbot</title><meta name="description" content="Documentation for commandbot"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">commandbot</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">commandbot</a></li><li><a href="CommandManager.html">CommandManager</a></li></ul><h1>Class CommandManager</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Object that stores the registered commands and is responsible for data exchanging with the Discord API</p>
|
|
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">CommandManager</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Constructors</h3><ul class="tsd-index-list"><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="CommandManager.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="CommandManager.html#_commands" class="tsd-kind-icon">_commands</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="CommandManager.html#_globalEntryName" class="tsd-kind-icon">_global<wbr/>Entry<wbr/>Name</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="CommandManager.html#_registerCache" class="tsd-kind-icon">_register<wbr/>Cache</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CommandManager.html#argumentSeparator" class="tsd-kind-icon">argument<wbr/>Separator</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CommandManager.html#client" class="tsd-kind-icon">client</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CommandManager.html#commandSeparator" class="tsd-kind-icon">command<wbr/>Separator</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CommandManager.html#help" class="tsd-kind-icon">help</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CommandManager.html#prefix" class="tsd-kind-icon">prefix</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="CommandManager.html#baseApiUrl" class="tsd-kind-icon">base<wbr/>Api<wbr/>Url</a></li></ul></section><section class="tsd-index-section "><h3>Accessors</h3><ul class="tsd-index-list"><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="CommandManager.html#cache" class="tsd-kind-icon">cache</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="CommandManager.html#commandsCount" class="tsd-kind-icon">commands<wbr/>Count</a></li></ul></section><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="CommandManager.html#add" class="tsd-kind-icon">add</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="CommandManager.html#arrayToMap" class="tsd-kind-icon">array<wbr/>To<wbr/>Map</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CommandManager.html#fetch" class="tsd-kind-icon">fetch</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="CommandManager.html#get" class="tsd-kind-icon">get</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CommandManager.html#getApi" class="tsd-kind-icon">get<wbr/>Api</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="CommandManager.html#getCache" class="tsd-kind-icon">get<wbr/>Cache</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CommandManager.html#getIdApi" class="tsd-kind-icon">get<wbr/>Id<wbr/>Api</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CommandManager.html#getPermissionsApi" class="tsd-kind-icon">get<wbr/>Permissions<wbr/>Api</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CommandManager.html#list" class="tsd-kind-icon">list</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CommandManager.html#listApi" class="tsd-kind-icon">list<wbr/>Api</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CommandManager.html#register" class="tsd-kind-icon">register</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CommandManager.html#setPermissionsApi" class="tsd-kind-icon">set<wbr/>Permissions<wbr/>Api</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="CommandManager.html#updateCache" class="tsd-kind-icon">update<wbr/>Cache</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="CommandManager.html#isCommand" class="tsd-kind-icon">is<wbr/>Command</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class"><a name="constructor" class="tsd-anchor"></a><h3>constructor</h3><ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">new <wbr/>Command<wbr/>Manager<span class="tsd-signature-symbol">(</span>client<span class="tsd-signature-symbol">: </span><a href="Bot.html" class="tsd-signature-type" data-tsd-kind="Class">Bot</a>, helpMsg<span class="tsd-signature-symbol">: </span><a href="../interfaces/HelpMessageParams.html" class="tsd-signature-type" data-tsd-kind="Interface">HelpMessageParams</a>, prefix<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, argSep<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, cmdSep<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="CommandManager.html" class="tsd-signature-type" data-tsd-kind="Class">CommandManager</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L99">src/structures/CommandManager.ts:99</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>client: <a href="Bot.html" class="tsd-signature-type" data-tsd-kind="Class">Bot</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>client that this manager belongs to</p>
|
|
</div></div></li><li><h5>helpMsg: <a href="../interfaces/HelpMessageParams.html" class="tsd-signature-type" data-tsd-kind="Interface">HelpMessageParams</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>parameters defining appearance of the help message</p>
|
|
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> prefix: <span class="tsd-signature-type">string</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> argSep: <span class="tsd-signature-type">string</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> cmdSep: <span class="tsd-signature-type">string</span></h5></li></ul><h4 class="tsd-returns-title">Returns <a href="CommandManager.html" class="tsd-signature-type" data-tsd-kind="Class">CommandManager</a></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private"><a name="_commands" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagPrivate">Private</span> <span class="tsd-flag ts-flagReadonly">Readonly</span> _commands</h3><div class="tsd-signature tsd-kind-icon">_commands<span class="tsd-signature-symbol">:</span> <a href="Command.html" class="tsd-signature-type" data-tsd-kind="Class">Command</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L31">src/structures/CommandManager.ts:31</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>List of commands registered in the manager</p>
|
|
</div><dl class="tsd-comment-tags"><dt>readonly</dt><dd></dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private"><a name="_globalEntryName" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagPrivate">Private</span> <span class="tsd-flag ts-flagReadonly">Readonly</span> _global<wbr/>Entry<wbr/>Name</h3><div class="tsd-signature tsd-kind-icon">_global<wbr/>Entry<wbr/>Name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = "global"</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L39">src/structures/CommandManager.ts:39</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private"><a name="_registerCache" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagPrivate">Private</span> <span class="tsd-flag ts-flagReadonly">Readonly</span> _register<wbr/>Cache</h3><div class="tsd-signature tsd-kind-icon">_register<wbr/>Cache<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L38">src/structures/CommandManager.ts:38</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Cache of Discord API commands data</p>
|
|
</div><dl class="tsd-comment-tags"><dt>readonly</dt><dd></dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a name="argumentSeparator" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> argument<wbr/>Separator</h3><div class="tsd-signature tsd-kind-icon">argument<wbr/>Separator<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L71">src/structures/CommandManager.ts:71</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>A string used to split all incoming input data from Discord messages</p>
|
|
</div><dl class="tsd-comment-tags"><dt>readonly</dt><dd></dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a name="client" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> client</h3><div class="tsd-signature tsd-kind-icon">client<span class="tsd-signature-symbol">:</span> <a href="Bot.html" class="tsd-signature-type" data-tsd-kind="Class">Bot</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L47">src/structures/CommandManager.ts:47</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Client connected to this manager</p>
|
|
</div><dl class="tsd-comment-tags"><dt>readonly</dt><dd></dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a name="commandSeparator" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> command<wbr/>Separator</h3><div class="tsd-signature tsd-kind-icon">command<wbr/>Separator<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L79">src/structures/CommandManager.ts:79</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>A string used to separate subcommand groups and subcommands</p>
|
|
</div><dl class="tsd-comment-tags"><dt>readonly</dt><dd></dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a name="help" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> <span class="tsd-flag ts-flagReadonly">Readonly</span> help</h3><div class="tsd-signature tsd-kind-icon">help<span class="tsd-signature-symbol">?:</span> <a href="HelpMessage.html" class="tsd-signature-type" data-tsd-kind="Class">HelpMessage</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L55">src/structures/CommandManager.ts:55</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Help command associated with this manager</p>
|
|
</div><dl class="tsd-comment-tags"><dt>readonly</dt><dd></dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"><a name="prefix" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> prefix</h3><div class="tsd-signature tsd-kind-icon">prefix<span class="tsd-signature-symbol">:</span> <a href="PrefixManager.html" class="tsd-signature-type" data-tsd-kind="Class">PrefixManager</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L63">src/structures/CommandManager.ts:63</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>A manager holding all guild-specific prefixes and a global prefix</p>
|
|
</div><dl class="tsd-comment-tags"><dt>readonly</dt><dd></dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static"><a name="baseApiUrl" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-flagReadonly">Readonly</span> base<wbr/>Api<wbr/>Url</h3><div class="tsd-signature tsd-kind-icon">base<wbr/>Api<wbr/>Url<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = "https://discord.com/api/v8"</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L88">src/structures/CommandManager.ts:88</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Discord API URL</p>
|
|
</div><dl class="tsd-comment-tags"><dt>static</dt><dd></dd><dt>readonly</dt><dd></dd></dl></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Accessors</h2><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a name="cache" class="tsd-anchor"></a><h3>cache</h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> cache<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L120">src/structures/CommandManager.ts:120</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Discord API commands cache</p>
|
|
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a name="commandsCount" class="tsd-anchor"></a><h3>commands<wbr/>Count</h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> commandsCount<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L128">src/structures/CommandManager.ts:128</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Number of commands registered in this manager</p>
|
|
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a name="add" class="tsd-anchor"></a><h3>add</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><li class="tsd-signature tsd-kind-icon">add<T><span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span>, options<span class="tsd-signature-symbol">: </span><a href="../modules.html#CommandInit" class="tsd-signature-type" data-tsd-kind="Type alias">CommandInit</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../modules.html#Commands" class="tsd-signature-type" data-tsd-kind="Type alias">Commands</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L145">src/structures/CommandManager.ts:145</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Creates and registers command in the manager based on the given options</p>
|
|
</div><dl class="tsd-comment-tags"><dt>remarks</dt><dd><p>All commands have to be added to the instance <strong>before starting the bot</strong>. Adding commands while the bot is running is not possible and can cause issues.</p>
|
|
<p>Command types</p>
|
|
<ul>
|
|
<li><a href="https://grz4na.github.io/commandbot-docs/interfaces/ChatCommandInit.html">CHAT</a> - message interactions using command prefixes or slash commands</li>
|
|
<li><a href="https://grz4na.github.io/commandbot-docs/interfaces/ContextMenuCommandInit.html">USER</a> - right-click context menu interactions on users</li>
|
|
<li><a href="https://grz4na.github.io/commandbot-docs/interfaces/ContextMenuCommandInit.html">MESSAGE</a> - right-click context menu interactions on messages</li>
|
|
</ul>
|
|
</dd></dl></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>T<span class="tsd-signature-symbol">: </span><a href="../modules.html#CommandType" class="tsd-signature-type" data-tsd-kind="Type alias">CommandType</a></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>type: <span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>a type of command that will be created and added to this manager</p>
|
|
</div></div></li><li><h5>options: <a href="../modules.html#CommandInit" class="tsd-signature-type" data-tsd-kind="Type alias">CommandInit</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">></span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>an object containing all properties required to create this type of command</p>
|
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="../modules.html#Commands" class="tsd-signature-type" data-tsd-kind="Type alias">Commands</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">></span></h4><div><p>A computed command object that inherits from <a href="Command.html">Command</a></p>
|
|
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private"><a name="arrayToMap" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagPrivate">Private</span> array<wbr/>To<wbr/>Map</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private"><li class="tsd-signature tsd-kind-icon">array<wbr/>To<wbr/>Map<span class="tsd-signature-symbol">(</span>a<span class="tsd-signature-symbol">: </span><a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L556">src/structures/CommandManager.ts:556</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Performs internal data type conversions</p>
|
|
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>a: <a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a><span class="tsd-signature-symbol">[]</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a><span class="tsd-signature-symbol">></span></h4><div></div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a name="fetch" class="tsd-anchor"></a><h3>fetch</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">fetch<span class="tsd-signature-symbol">(</span>i<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Message</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Interaction</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="InputManager.html" class="tsd-signature-type" data-tsd-kind="Class">InputManager</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L314">src/structures/CommandManager.ts:314</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Process an interaction</p>
|
|
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>i: <span class="tsd-signature-type">Message</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Interaction</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>interaction object to fetch a command from</p>
|
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="InputManager.html" class="tsd-signature-type" data-tsd-kind="Class">InputManager</a></h4><div><p>An InputManager containing all input data (command, arguments, target etc.)</p>
|
|
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a name="get" class="tsd-anchor"></a><h3>get</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><li class="tsd-signature tsd-kind-icon">get<T><span class="tsd-signature-symbol">(</span>q<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, t<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="../modules.html#Commands" class="tsd-signature-type" data-tsd-kind="Type alias">Commands</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L175">src/structures/CommandManager.ts:175</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Get command registered in this manager</p>
|
|
</div></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>T<span class="tsd-signature-symbol">: </span><a href="../modules.html#CommandType" class="tsd-signature-type" data-tsd-kind="Type alias">CommandType</a></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>q: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>command name or alias</p>
|
|
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> t: <span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="../modules.html#Commands" class="tsd-signature-type" data-tsd-kind="Type alias">Commands</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">></span></h4><div><p>A command object</p>
|
|
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a name="getApi" class="tsd-anchor"></a><h3>get<wbr/>Api</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">get<wbr/>Api<span class="tsd-signature-symbol">(</span>id<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, guild<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Guild</span>, noCache<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L214">src/structures/CommandManager.ts:214</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Fetches command object from the Discord API</p>
|
|
</div><dl class="tsd-comment-tags"><dt>async</dt><dd></dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>id: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Discord command ID</p>
|
|
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> guild: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Guild</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> noCache: <span class="tsd-signature-type">boolean</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a><span class="tsd-signature-symbol">></span></h4><div><p>Discord command object</p>
|
|
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private"><a name="getCache" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagPrivate">Private</span> get<wbr/>Cache</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private"><li class="tsd-signature tsd-kind-icon">get<wbr/>Cache<span class="tsd-signature-symbol">(</span>q<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, guildId<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L547">src/structures/CommandManager.ts:547</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Retrieves cache from the manager</p>
|
|
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>q: <span class="tsd-signature-type">string</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> guildId: <span class="tsd-signature-type">string</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a></h4><div></div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a name="getIdApi" class="tsd-anchor"></a><h3>get<wbr/>Id<wbr/>Api</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">get<wbr/>Id<wbr/>Api<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, type<span class="tsd-signature-symbol">: </span><a href="../modules.html#APICommandType" class="tsd-signature-type" data-tsd-kind="Type alias">APICommandType</a>, guild<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Guild</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L249">src/structures/CommandManager.ts:249</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Fetches command ID by name from the Discord APi</p>
|
|
</div><dl class="tsd-comment-tags"><dt>async</dt><dd></dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>name of the command</p>
|
|
</div></div></li><li><h5>type: <a href="../modules.html#APICommandType" class="tsd-signature-type" data-tsd-kind="Type alias">APICommandType</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>command type you want to get ID for</p>
|
|
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> guild: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Guild</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h4><div><p>Command ID from the Discord API</p>
|
|
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a name="getPermissionsApi" class="tsd-anchor"></a><h3>get<wbr/>Permissions<wbr/>Api</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">get<wbr/>Permissions<wbr/>Api<span class="tsd-signature-symbol">(</span>id<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, g<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Guild</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/CommandPermission.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandPermission</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L509">src/structures/CommandManager.ts:509</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Get permissions from Discord Permissions API for a specified command</p>
|
|
</div><dl class="tsd-comment-tags"><dt>async</dt><dd></dd><dt>experimental</dt><dd><p>This functionality hasn't been polished and fully tested yet. Using it might lead to errors and application crashes.</p>
|
|
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>id: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>command ID</p>
|
|
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> g: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Guild</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/CommandPermission.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandPermission</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a name="list" class="tsd-anchor"></a><h3>list</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">list<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">readonly </span><a href="Command.html" class="tsd-signature-type" data-tsd-kind="Class">Command</a><span class="tsd-signature-symbol">[]</span></li><li class="tsd-signature tsd-kind-icon">list<span class="tsd-signature-symbol">(</span>f<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"CHAT"</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">readonly </span><a href="ChatCommand.html" class="tsd-signature-type" data-tsd-kind="Class">ChatCommand</a><span class="tsd-signature-symbol">[]</span></li><li class="tsd-signature tsd-kind-icon">list<span class="tsd-signature-symbol">(</span>f<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"CONTEXT"</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">readonly </span><a href="ContextMenuCommand.html" class="tsd-signature-type" data-tsd-kind="Class">ContextMenuCommand</a><span class="tsd-signature-symbol">[]</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L267">src/structures/CommandManager.ts:267</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Lists all commands in the manager</p>
|
|
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">readonly </span><a href="Command.html" class="tsd-signature-type" data-tsd-kind="Class">Command</a><span class="tsd-signature-symbol">[]</span></h4><div><p>An array of commands registered in this manager</p>
|
|
</div></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L268">src/structures/CommandManager.ts:268</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>f: <span class="tsd-signature-type">"CHAT"</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">readonly </span><a href="ChatCommand.html" class="tsd-signature-type" data-tsd-kind="Class">ChatCommand</a><span class="tsd-signature-symbol">[]</span></h4></li><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L269">src/structures/CommandManager.ts:269</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>f: <span class="tsd-signature-type">"CONTEXT"</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">readonly </span><a href="ContextMenuCommand.html" class="tsd-signature-type" data-tsd-kind="Class">ContextMenuCommand</a><span class="tsd-signature-symbol">[]</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a name="listApi" class="tsd-anchor"></a><h3>list<wbr/>Api</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">list<wbr/>Api<span class="tsd-signature-symbol">(</span>g<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Guild</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L288">src/structures/CommandManager.ts:288</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Lists commands registered in the Discord API</p>
|
|
</div><dl class="tsd-comment-tags"><dt>async</dt><dd></dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> g: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Guild</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><div><p>List of commands from Discord API</p>
|
|
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a name="register" class="tsd-anchor"></a><h3>register</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">register<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L420">src/structures/CommandManager.ts:420</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Register all commands in this manager in the Discord API</p>
|
|
</div><dl class="tsd-comment-tags"><dt>async</dt><dd></dd></dl></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a name="setPermissionsApi" class="tsd-anchor"></a><h3>set<wbr/>Permissions<wbr/>Api</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">set<wbr/>Permissions<wbr/>Api<span class="tsd-signature-symbol">(</span>id<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, permissions<span class="tsd-signature-symbol">: </span><a href="../interfaces/CommandPermission.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandPermission</a><span class="tsd-signature-symbol">[]</span>, g<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Guild</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L483">src/structures/CommandManager.ts:483</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>Set permissions using Discord Permissions API</p>
|
|
</div><dl class="tsd-comment-tags"><dt>async</dt><dd></dd><dt>experimental</dt><dd><p>This functionality hasn't been polished and fully tested yet. Using it might lead to errors and application crashes.</p>
|
|
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>id: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>command ID</p>
|
|
</div></div></li><li><h5>permissions: <a href="../interfaces/CommandPermission.html" class="tsd-signature-type" data-tsd-kind="Interface">CommandPermission</a><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>permissions to set</p>
|
|
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> g: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Guild</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private"><a name="updateCache" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagPrivate">Private</span> update<wbr/>Cache</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private"><li class="tsd-signature tsd-kind-icon">update<wbr/>Cache<span class="tsd-signature-symbol">(</span>commands<span class="tsd-signature-symbol">: </span><a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a><span class="tsd-signature-symbol"> | </span><a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a><span class="tsd-signature-symbol">[]</span>, guildId<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L532">src/structures/CommandManager.ts:532</a></li></ul></aside><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>commands: <a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a><span class="tsd-signature-symbol"> | </span><a href="../interfaces/RegisteredCommandObject.html" class="tsd-signature-type" data-tsd-kind="Interface">RegisteredCommandObject</a><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>list of commands to cache</p>
|
|
</div></div></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> guildId: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>guild ID</p>
|
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-static"><a name="isCommand" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagStatic">Static</span> is<wbr/>Command</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-static"><li class="tsd-signature tsd-kind-icon">is<wbr/>Command<span class="tsd-signature-symbol">(</span>c<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">c</span><span class="tsd-signature-symbol"> is </span><a href="Command.html" class="tsd-signature-type" data-tsd-kind="Class">Command</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/GRZ4NA/DiscordCommands/blob/71b0f28/src/structures/CommandManager.ts#L570">src/structures/CommandManager.ts:570</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>static</dt><dd></dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>c: <span class="tsd-signature-type">any</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
<p>object to check</p>
|
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">c</span><span class="tsd-signature-symbol"> is </span><a href="Command.html" class="tsd-signature-type" data-tsd-kind="Class">Command</a></h4><div><p>Whether this object is a <a href="Command.html">Command</a> object</p>
|
|
</div></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-class"><a href="CommandManager.html" class="tsd-kind-icon">Command<wbr/>Manager</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="CommandManager.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="CommandManager.html#_commands" class="tsd-kind-icon">_commands</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="CommandManager.html#_globalEntryName" class="tsd-kind-icon">_global<wbr/>Entry<wbr/>Name</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="CommandManager.html#_registerCache" class="tsd-kind-icon">_register<wbr/>Cache</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CommandManager.html#argumentSeparator" class="tsd-kind-icon">argument<wbr/>Separator</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CommandManager.html#client" class="tsd-kind-icon">client</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CommandManager.html#commandSeparator" class="tsd-kind-icon">command<wbr/>Separator</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CommandManager.html#help" class="tsd-kind-icon">help</a></li><li class="tsd-kind-property tsd-parent-kind-class"><a href="CommandManager.html#prefix" class="tsd-kind-icon">prefix</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><a href="CommandManager.html#baseApiUrl" class="tsd-kind-icon">base<wbr/>Api<wbr/>Url</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="CommandManager.html#cache" class="tsd-kind-icon">cache</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="CommandManager.html#commandsCount" class="tsd-kind-icon">commands<wbr/>Count</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="CommandManager.html#add" class="tsd-kind-icon">add</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="CommandManager.html#arrayToMap" class="tsd-kind-icon">array<wbr/>To<wbr/>Map</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CommandManager.html#fetch" class="tsd-kind-icon">fetch</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter"><a href="CommandManager.html#get" class="tsd-kind-icon">get</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CommandManager.html#getApi" class="tsd-kind-icon">get<wbr/>Api</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="CommandManager.html#getCache" class="tsd-kind-icon">get<wbr/>Cache</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CommandManager.html#getIdApi" class="tsd-kind-icon">get<wbr/>Id<wbr/>Api</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CommandManager.html#getPermissionsApi" class="tsd-kind-icon">get<wbr/>Permissions<wbr/>Api</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CommandManager.html#list" class="tsd-kind-icon">list</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CommandManager.html#listApi" class="tsd-kind-icon">list<wbr/>Api</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CommandManager.html#register" class="tsd-kind-icon">register</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="CommandManager.html#setPermissionsApi" class="tsd-kind-icon">set<wbr/>Permissions<wbr/>Api</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><a href="CommandManager.html#updateCache" class="tsd-kind-icon">update<wbr/>Cache</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><a href="CommandManager.html#isCommand" class="tsd-kind-icon">is<wbr/>Command</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html> |