Client
Client
Represents a client for interacting with the Discord API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token |
str
|
The token of the bot. |
required |
application_id |
int
|
The ID of the application that the bot is associated with. |
required |
public_key |
str
|
The public key of the application. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
http |
HttpClient
|
The HTTP client that will be used to make requests to Discord. |
Source code in dismake/client.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
parse_interaction_create
async
parse_interaction_create(data: InteractionData) -> None
Parse and execute the appropriate action for an incoming interaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data |
InteractionData
|
The incoming interaction data. |
required |
Source code in dismake/client.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
verify
verify(signature: str, timestamp: str, body: bytes) -> bool
Verify the incoming signature from Discord.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signature |
str
|
The signature from Discord. |
required |
timestamp |
str
|
The timestamp from Discord. |
required |
body |
bytes
|
The body of the request from Discord. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the signature is valid, False otherwise. |
Source code in dismake/client.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |