> For the complete documentation index, see [llms.txt](https://bdfd-support.gitbook.io/bdfd-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bdfd-support.gitbook.io/bdfd-en/open-source/find-function.md).

# Find function

Search for a BDFD function by name or by its index. Source Code from December 31, 2023

## Versions

* [BDFD Function Search (V2.0)](#bdfd-function-search-version-2.0)
* [BDFD Function Search (Old)](#bdfd-function-search)

{% hint style="warning" %}
You must choose **BDScript 2** for the command to work correctly.
{% endhint %}

{% hint style="info" %}
Links:\
[https://botdesignerdiscord.com/public/api/](https://botdesignerdiscord.com/public/api/function_tag_list)\
<https://nilpointer-software.github.io/bdfd-wiki/nightly/>\
[https://nilpointer-software.github.io/bdfd-wiki/](https://nilpointer-software.github.io/bdfd-wiki/nightly/)
{% endhint %}

## BDFD Function Search (Version 2.0)

| Trigger | Script Language | Characters | Functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------- | --------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `!find` | `BDScript 2`    | 8438       | <p><a href="https://nilpointer-software.github.io/bdfd-wiki/nightly/guides/general/httpRequests.html">HTTP Requests</a><br><a href="https://nilpointer-software.github.io/bdfd-wiki/nightly/guides/general/jsonFunctions.html">JSON Functions</a><br><a href="https://nilpointer-software.github.io/bdfd-wiki/nightly/guides/general/textSplitting.html">Text Splitting</a><br><a href="https://nilpointer-software.github.io/bdfd-wiki/nightly/guides/general/bds2/errorHandling.html">Error Handling</a><br><a href="https://nilpointer-software.github.io/bdfd-wiki/nightly/guides/general/ifStatements.html">If Statements</a><br><a href="https://nilpointer-software.github.io/bdfd-wiki/nightly/guides/other/characterEscaping.html">Character Escaping</a><br><a href="https://nilpointer-software.github.io/bdfd-wiki/nightly/guides/other/arguments.html">Arguments Flags & Types</a><br><a href="https://nilpointer-software.github.io/bdfd-wiki/nightly/guides/other/hyperlinks.html">Hyperlinks</a><br><a href="https://nilpointer-software.github.io/bdfd-wiki/nightly/resources/api.html">API</a></p> |

````php
$c[Thanks for rainbow_key & kitomanari]
$nomention

$var[color;748ad2] $c[<-------- Success embed color]
$var[errorColor;ff335c] $c[<-------- Fail embed color]
$var[error;false]  $c[<-------- Don't change it]
$var[msg;$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$toLowercase[$message];%{DOL}%;];`;];-;];,;;-1];.;]]  $c[<-------- Function Search request]

$c[↓-------- Emojis for parameters]
$var[?mark;❓]
$var[!mark;‼️]

$httpGet[https://botdesignerdiscord.com/public/api/function_tag_list]

$if[$isNumber[$var[msg]]==true] $c[<-------- Search by function index]
  $textSplit[$httpResult;,]
  $var[func;$replaceText[$replaceText[$replaceText[$splitText[$var[msg]];[";];"%ESCAPED%;];";]]
  $var[mdTag;$replaceText[$replaceText[$var[func];[\];];$;]]
$else $c[<-------- Search by function name]
  $if[$checkContains[$var[msg];[;%ESCAPED%]==true] $var[breadcrumbs;[%ESCAPED%] $endif
  $var[msg;$replaceText[$replaceText[%{DOL}%$var[msg];[;];\];]]
  $textSplit[$toLowercase[$httpResult];"$var[msg]]
  $textSplit[$splitText[2];"]
  $var[func;$replaceText[$var[msg]$splitText[1]$var[breadcrumbs];[%ESCAPED%[%ESCAPED%;[%ESCAPED%]]
  $var[funcType;function]
  $if[$checkContains[$toLowercase[$httpResult];$var[func]]==false]  $c[<-------- Search by callback name]
    $if[$checkContains[$var[msg];[;%ESCAPED%]==true]
      $var[breadcrumbs;[%ESCAPED%]
    $endif
    $httpGet[https://botdesignerdiscord.com/public/api/callback_tag_list]
    $var[msg;%{DOL}%$replaceText[$var[msg];%{DOL}%;;-1]]
    $textSplit[$toLowercase[$httpResult];"$var[msg]]
    $textSplit[$splitText[2];"]
    $var[func;$replaceText[$var[msg]$splitText[1]$var[breadcrumbs];[%ESCAPED%[%ESCAPED%;[%ESCAPED%]]
    $var[funcType;callback]
  $endif
  $if[$var[funcType]==callback]
    $httpGet[https://botdesignerdiscord.com/public/api/callback_tag_list]
  $else
    $httpGet[https://botdesignerdiscord.com/public/api/function_tag_list]
  $endif
  $textSplit[$replaceText[$replaceText[$toLowercase[$optOff[$httpResult]];[";];"%ESCAPED%;];","]
  $var[func-number;$optOff[$getTextSplitIndex[$var[func]]]]
  $textSplit[$httpResult;","]
  $try
    $var[func;$replaceText[$replaceText[$splitText[$var[func-number]];[";];"%ESCAPED%;]]
    $var[mdTag;$replaceText[$replaceText[$var[func];[\];];$;]]
  $catch
    $var[func;none]
    $var[mdTag;none]
  $endtry
$endif

$httpGet[https://botdesignerdiscord.com/public/api/function_tag_list]
$jsonParse[{"f": $httpResult}]
$var[index;$jsonArrayIndex[f;$var[func]]]

$textSplit[$httpResult;,]
$var[ftl;$joinSplitText[
]]
$var[ftl;$replaceText[$var[ftl];"$c["];]]
$textSplit[$var[ftl];
]
$var[Count;$getTextSplitLength]  $c[<-------- Command count calculator]
$var[FunctionPosition;$sum[$var[index];1]]  $c[<-------- Command position (Index)]

$if[$or[$var[msg]==;$var[index]==-1]==true]
  $var[error;true]
$endif

$if[$var[error]==true]  $c[<-------- Function not found]
  $color[#$var[errorColor]]
  $author[Function not found]
  $authorIcon[$userAvatar[$botID]]
  $description[**Error:** Function not found. Correct the errors in the function name!]
$else

$if[$var[funcType]==callback]
  $httpGet[https://botdesignerdiscord.com/public/api/callback/$var[func]]
  $var[f_type;$replaceText[$replaceText[$httpResult[is_premium];true;premium];false;callbacks]]
$else
  $httpGet[https://botdesignerdiscord.com/public/api/function/$var[func]]
  $var[f_type;$replaceText[$replaceText[$httpResult[premium];true;premium];false;bdscript]]
$endif

$jsonParse[$httpResult]

$color[$var[color]]
$title[Command Information]
$embeddedURL[https://nilpointer-software.github.io/bdfd-wiki/nightly/$var[f_type]/$var[mdTag].html]
$footer[BDFD have $var[Count] commands!]

$if[$var[funcType]==callback] $description[```$httpResult[name]```] $else $description[```$httpResult[tag]```] $endif
$if[$httpResult[shortDescription]!=] $addField[Description;```$httpResult[shortDescription]```] $elseif[$httpResult[description]!=] $addField[Description;```$httpResult[description]```] $endif
$addField[Available for:;$if[$var[f_type]==premium]Premium users $else Everyone$endif;yes]
$if[$httpResult[arguments;0;name]!=]
$var[total;$jsonArrayCount[arguments]]
$addField[Parameters - $var[total]:;** **]

$c[↓-------- Parameters]

$if[$httpResult[arguments;0;name]!=]$addField[$httpResult[arguments;0;name]; 
Type: `$httpResult[arguments;0;type]` | Status: $if[$httpResult[arguments;0;required]==true]$var[!mark]Required$elseif[$httpResult[arguments;0;empty]==true]$var[?mark]Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;1;name]!=]$addField[$httpResult[arguments;1;name]; 
Type: `$httpResult[arguments;1;type]` | Status: $if[$httpResult[arguments;1;required]==true]$var[!mark]Required$elseif[$httpResult[arguments;1;empty]==true]$var[?mark]Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;2;name]!=]$addField[$httpResult[arguments;2;name]; 
Type: `$httpResult[arguments;2;type]` | Status: $if[$httpResult[arguments;2;required]==true]$var[!mark]Required$elseif[$httpResult[arguments;2;empty]==true]$var[?mark]Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;3;name]!=]$addField[$httpResult[arguments;3;name]; 
Type: `$httpResult[arguments;3;type]` | Status: $if[$httpResult[arguments;3;required]==true]$var[!mark]Required$elseif[$httpResult[arguments;3;empty]==true]$var[?mark]Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;4;name]!=]$addField[$httpResult[arguments;4;name]; 
Type: `$httpResult[arguments;4;type]` | Status: $if[$httpResult[arguments;4;required]==true]$var[!mark]Required$elseif[$httpResult[arguments;4;empty]==true]$var[?mark]Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;5;name]!=]$addField[$httpResult[arguments;5;name]; 
Type: `$httpResult[arguments;5;type]` | Status: $if[$httpResult[arguments;5;required]==true]$var[!mark]Required$elseif[$httpResult[arguments;5;empty]==true]$var[?mark]Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;6;name]!=]$addField[$httpResult[arguments;6;name]; 
Type: `$httpResult[arguments;6;type]` | Status: $if[$httpResult[arguments;6;required]==true]$var[!mark]Required$elseif[$httpResult[arguments;6;empty]==true]$var[?mark]Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;7;name]!=]$addField[$httpResult[arguments;7;name]; 
Type: `$httpResult[arguments;7;type]` | Status: $if[$httpResult[arguments;7;required]==true]$var[!mark]Required$elseif[$httpResult[arguments;7;empty]==true]$var[?mark]Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;8;name]!=]$addField[$httpResult[arguments;8;name]; 
Type: `$httpResult[arguments;8;type]` | Status: $if[$httpResult[arguments;8;required]==true]$var[!mark]Required$elseif[$httpResult[arguments;8;empty]==true]$var[?mark]Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;9;name]!=]$addField[$httpResult[arguments;9;name]; 
Type: `$httpResult[arguments;9;type]` | Status: $if[$httpResult[arguments;9;required]==true]$var[!mark]Required$elseif[$httpResult[arguments;9;empty]==true]$var[?mark]Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;10;name]!=]$addField[$httpResult[arguments;10;name]; 
Type: `$httpResult[arguments;10;type]` | Status: $if[$httpResult[arguments;10;required]==true]$var[!mark]Required$elseif[$httpResult[arguments;10;empty]==true]$var[?mark]Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;11;name]!=]$addField[$httpResult[arguments;11;name]; 
Type: `$httpResult[arguments;11;type]` | Status: $if[$httpResult[arguments;11;required]==true]$var[!mark]Required$elseif[$httpResult[arguments;11;empty]==true]$var[?mark]Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;12;name]!=]$addField[$httpResult[arguments;12;name]; 
Type: `$httpResult[arguments;12;type]` | Status: $if[$httpResult[arguments;12;required]==true]$var[!mark]Required$elseif[$httpResult[arguments;12;empty]==true]$var[?mark]Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;13;name]!=]$addField[$httpResult[arguments;13;name]; 
Type: `$httpResult[arguments;13;type]` | Status: $if[$httpResult[arguments;13;required]==true]$var[!mark]Required$elseif[$httpResult[arguments;13;empty]==true]$var[?mark]Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;14;name]!=]$addField[$httpResult[arguments;14;name]; 
Type: `$httpResult[arguments;14;type]` | Status: $if[$httpResult[arguments;14;required]==true]$var[!mark]Required$elseif[$httpResult[arguments;14;empty]==true]$var[?mark]Vacantable$elseNot defined$endif]$endif
$endif
````

<figure><img src="https://media.discordapp.net/attachments/1011682358031826994/1235212848490348647/image.png?ex=66338d1c&#x26;is=66323b9c&#x26;hm=246d94acddb222d1b9dfcf2a42e2244c1714001db7f85347b57153e649871788&#x26;=&#x26;format=webp&#x26;quality=lossless&#x26;width=521&#x26;height=401" alt="Find function by name or index."><figcaption><p>!find $message[] - preview</p></figcaption></figure>

## BDFD Function Search

| Trigger | Script Language | Characters | Functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------- | --------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `!find` | `BDScript 2`    | 7471       | <p><a href="https://nilpointer-software.github.io/bdfd-wiki/nightly/guides/general/httpRequests.html">HTTP Requests</a><br><a href="https://nilpointer-software.github.io/bdfd-wiki/nightly/guides/general/textSplitting.html">Text Splitting</a><br><a href="https://nilpointer-software.github.io/bdfd-wiki/nightly/guides/general/bds2/errorHandling.html">Error Handling</a><br><a href="https://nilpointer-software.github.io/bdfd-wiki/nightly/guides/general/ifStatements.html">If Statements</a><br><a href="https://nilpointer-software.github.io/bdfd-wiki/nightly/guides/other/characterEscaping.html">Character Escaping</a><br><a href="https://nilpointer-software.github.io/bdfd-wiki/nightly/resources/api.html">API</a></p> |

````php
$c[Thanks for RainbowKey & NightNutSky]
$c[Made with NightNutSky country without Mental Health]
 
$nomention
$reply
$var[msg;$message]
$try
$if[$isNumber[$var[msg]]==true]
$httpGet[https://botdesignerdiscord.com/public/api/function_tag_list]
    $c[Formatting]
        $textSplit[$httpResult;,]
        $var[ftl;$joinSplitText[
]]
        $var[ftl;$replaceText[$var[ftl];"$c["];]]  $textSplit[$var[ftl];
]
$var[msg;$trimSpace[$if[$message==$getTextSplitLength]$replaceText[$splitText[$message];%ESCAPED%;;1]$elseif[$message==1]$replaceText[$splitText[$message];[;;1]$else $splitText[$message]$endif]]
$else
 
    $c[Optional dollar]
        $textSplit[$var[msg];]
            $if[$splitText[1]!=$]
                $var[msg;%{DOL}%$joinSplitText[]]
            $endif
    $c[Optional brackets]
    $c[Exceptions]
        $var[exceptions;addTimestamp, allowMention, alternativeParsing, authorAvatar, authorID, autoCompleteOptionName, autoCompleteOptionValue, ban, banID, botID, botLeave, botListHide, botNode, botTyping, catch, channelCount, channelID, channelTopic, clear, commandsCount, customID, date, day, defer, deletecommand, disableSpecialEscaping, dm, else, emoteCount, endasync, endif, endtry, ephemeral, executionTime, getBotInvite, getServerInvite, getTextSplitLength, getTimestamp, guildID, highestRole, hostingExpireTime, hour, httpResult, ignoreLinks, ignoreTriggerCase, isSlash, kick, kickMention, lowestRole, membersCount, message, messageID, minute, month, nickname, noMentionMessage, nomention, pinMessage, ping, premiumExpireTime, random, randomChannelID, randomMention, randomUser, randomUserID, registerGuildCommands, removeButtons, removeLinks, reply, roleCount, roleNames, scriptLanguage, second, serverCount, serverDescription, serverIcon, serverNames, serverOwner, serverRegion, serverVerificationLvl, shardID, slashCommandsCount, stop, suppressErrors, try, tts, unban, unbanID, unregisterGuildCommands, uptime, usedEmoji, username, year, alwaysReply, ignoreTriggerCase]
    $textSplit[$var[exceptions];, ]
        $if[$checkContains[$var[msg];$unescape[$joinSplitText[;]]]!=true]
            $textSplit[$var[msg];]
                $if[$and[$splitText[>]!=[;$splitText[>]!=\]]]
                    $var[msg;$var[msg][\]]
                $elseif[$splitText[>]==[]
                    $var[msg;$var[msg]\]]
                $elseif[$and[$splitText[>]==\];$splitText[$sub[$getTextSplitLength;1]]!=[]]
                    $var[msg;$replaceText[$var[msg];\];[\]]]
                $endif
        $endif
$endif
    $httpGet[https://botdesignerdiscord.com/public/api/function/$var[msg]]
$color[#85b4ff]
$if[$httpResult[tag]!=]$title[Command info]$endif
$description[```$httpResult[tag]```]
$addField[Description:;
```$replaceText[$httpResult[shortDescription];ONLY FOR PREMIUM BOTS.;;1]```]
$addField[Available for:;$if[$httpResult[premium]==true]Premium bots$else@everyone$endif]
$addField[Arguments:;$if[$httpResult[arguments;0;name]==]Absent$else** **$endif]
$if[$httpResult[arguments;0;name]!=]$addField[$httpResult[arguments;0;name]; 
Type: `$httpResult[arguments;0;type]` | Status: $if[$httpResult[arguments;0;required]==true]‼️Required$elseif[$httpResult[arguments;0;empty]==true]❓Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;1;name]!=]$addField[$httpResult[arguments;1;name]; 
Type: `$httpResult[arguments;1;type]` | Status: $if[$httpResult[arguments;1;required]==true]‼️Required$elseif[$httpResult[arguments;1;empty]==true]❓Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;2;name]!=]$addField[$httpResult[arguments;2;name]; 
Type: `$httpResult[arguments;2;type]` | Status: $if[$httpResult[arguments;2;required]==true]‼️Required$elseif[$httpResult[arguments;2;empty]==true]❓Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;3;name]!=]$addField[$httpResult[arguments;3;name]; 
Type: `$httpResult[arguments;3;type]` | Status: $if[$httpResult[arguments;3;required]==true]‼️Required$elseif[$httpResult[arguments;3;empty]==true]❓Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;4;name]!=]$addField[$httpResult[arguments;4;name]; 
Type: `$httpResult[arguments;4;type]` | Status: $if[$httpResult[arguments;4;required]==true]‼️Required$elseif[$httpResult[arguments;4;empty]==true]❓Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;5;name]!=]$addField[$httpResult[arguments;5;name]; 
Type: `$httpResult[arguments;5;type]` | Status: $if[$httpResult[arguments;5;required]==true]‼️Required$elseif[$httpResult[arguments;5;empty]==true]❓Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;6;name]!=]$addField[$httpResult[arguments;6;name]; 
Type: `$httpResult[arguments;6;type]` | Status: $if[$httpResult[arguments;6;required]==true]‼️Required$elseif[$httpResult[arguments;6;empty]==true]❓Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;7;name]!=]$addField[$httpResult[arguments;7;name]; 
Type: `$httpResult[arguments;7;type]` | Status: $if[$httpResult[arguments;7;required]==true]‼️Required$elseif[$httpResult[arguments;7;empty]==true]❓Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;8;name]!=]$addField[$httpResult[arguments;8;name]; 
Type: `$httpResult[arguments;8;type]` | Status: $if[$httpResult[arguments;8;required]==true]‼️Required$elseif[$httpResult[arguments;8;empty]==true]❓Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;9;name]!=]$addField[$httpResult[arguments;9;name]; 
Type: `$httpResult[arguments;9;type]` | Status: $if[$httpResult[arguments;9;required]==true]‼️Required$elseif[$httpResult[arguments;9;empty]==true]❓Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;10;name]!=]$addField[$httpResult[arguments;10;name]; 
Type: `$httpResult[arguments;10;type]` | Status: $if[$httpResult[arguments;10;required]==true]‼️Required$elseif[$httpResult[arguments;10;empty]==true]❓Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;11;name]!=]$addField[$httpResult[arguments;11;name]; 
Type: `$httpResult[arguments;11;type]` | Status: $if[$httpResult[arguments;11;required]==true]‼️Required$elseif[$httpResult[arguments;11;empty]==true]❓Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;12;name]!=]$addField[$httpResult[arguments;12;name]; 
Type: `$httpResult[arguments;12;type]` | Status: $if[$httpResult[arguments;12;required]==true]‼️Required$elseif[$httpResult[arguments;12;empty]==true]❓Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;13;name]!=]$addField[$httpResult[arguments;13;name]; 
Type: `$httpResult[arguments;13;type]` | Status: $if[$httpResult[arguments;13;required]==true]‼️Required$elseif[$httpResult[arguments;13;empty]==true]❓Vacantable$elseNot defined$endif]$endif
$if[$httpResult[arguments;14;name]!=]$addField[$httpResult[arguments;14;name]; 
Type: `$httpResult[arguments;14;type]` | Status: $if[$httpResult[arguments;14;required]==true]‼️Required$elseif[$httpResult[arguments;14;empty]==true]❓Vacantable$elseNot defined$endif]$endif
$httpGet[https://botdesignerdiscord.com/public/api/function_tag_list]
    $textSplit[$httpResult;,]
    $var[ftl;$joinSplitText[
]]
    $var[ftl;$replaceText[$var[ftl];"$c["];]]  $textSplit[$var[ftl];
]
    $var[Count;$getTextSplitLength]
    $footer[This is only one command out of $var[Count]!]
$catch
$color[#ff335c]
$author[Function not found]
$authorIcon[$userAvatar[$botID]]
$description[The specified function was not found. Perhaps you made a mistake in spelling.]
$endtry
````
