> For the complete documentation index, see [llms.txt](https://assurancetourix.gitbook.io/assurancetourix/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://assurancetourix.gitbook.io/assurancetourix/customc/dshell/commands/utils.md).

# Utils

### <mark style="color:blue;">random</mark>

<details>

<summary><strong>Parameters</strong></summary>

* <mark style="color:green;">value</mark> ([list](/assurancetourix/customc/dshell/types.md#list-list)) : a list of value

</details>

Get a random [float](/assurancetourix/customc/dshell/types.md#float-floating-number) value \[0;1) if `value` is [none](/assurancetourix/customc/dshell/types.md#none-nothing).\
If `value` is a [list](/assurancetourix/customc/dshell/types.md#list-list), it take randomly one value of her and return it.

```
random   :: return a value [0;1)
sm __ret__

random [1,2,3,4,5,6,7,8,9]   :: return a value from the list
sm __ret__ 
```

### <mark style="color:blue;">name</mark>

<details>

<summary><strong>Parameters</strong></summary>

* <mark style="color:red;">value</mark> ([int](/assurancetourix/customc/dshell/types.md#int-interger)) : an ID of a channel/role/member

</details>

Get the name of the current ID passed in the `value` argument.

Return [none](/assurancetourix/customc/dshell/types.md#none-nothing) if the ID it's not find

### <mark style="color:blue;">id</mark>

<details>

<summary><strong>Parameters</strong></summary>

* <mark style="color:red;">value</mark> ([str](/assurancetourix/customc/dshell/types.md#str-string)) : a name of a channel/role/member

</details>

Get the ID of the current name passed in the `value` argument.

Return [none](/assurancetourix/customc/dshell/types.md#none-nothing) if the name it's not find

### <mark style="color:blue;">has\_perms</mark>

<details>

<summary><strong>Parameters</strong></summary>

* <mark style="color:red;">member</mark> ([int](/assurancetourix/customc/dshell/types.md#int-interger)) : member ID
* <mark style="color:red;">permission</mark> ([perm](/assurancetourix/customc/dshell/discord-keywords.md#perm-permission)) : permission block to compare with permission member

</details>

Checks whether the member has permissions specified in the permission block

```
perm compare
--allow 1024    :: allow view channel
--deny 2048     :: deny send message
#perm

has_perms __author__ compare
```

Return a [bool](/assurancetourix/customc/dshell/types.md#bool-boolean) if the member get specified permissions or not.

### <mark style="color:blue;">update\_perms</mark>

<details>

<summary><strong>Parameters</strong></summary>

* <mark style="color:red;">permission1</mark> ([perm](/assurancetourix/customc/dshell/discord-keywords.md#perm-permission)) : The firs permission block who get the merge (modified)
* <mark style="color:red;">permission2</mark> ([perm](/assurancetourix/customc/dshell/discord-keywords.md#perm-permission)) : The second permission block to merge with the first (not modified)

</details>

Update a permission block with an another permission block.

The first argument take the modification !

```
perm p1
--members 123456789
--allow 1024    :: allow view channel
#perm

perm p2
--roles 9876564321
--deny 2048     :: deny send message
#perm

update_perms p1 p2    :: p1 get permissions of p2
```

### <mark style="color:blue;">gp</mark> (pastbin)

<details>

<summary><strong>Permissions</strong></summary>

* <mark style="color:red;">code</mark> ([str](/assurancetourix/customc/dshell/types.md#str-string)) : pastbin code

</details>

Get pastbin content.

Return a [list](/assurancetourix/customc/dshell/types.md#list-list) of each sentence.

```
gp "azert123"

:: change the list to a string
var pastbin_content ""
loop sentence __ret__
var pastbin_content pastbin_content + sentence
#loop

sm pastbin_content   :: send pastbin content
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://assurancetourix.gitbook.io/assurancetourix/customc/dshell/commands/utils.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
