¶
botcity.plugins.discord.BotDiscordPlugin
¶
webhook
property
¶
Returns the discord-webhook instance.
Returns:
| Type | Description |
|---|---|
DiscordWebhook
|
discord-webhook: The discord-webhook instance. |
__init__(urls, username=None, **kwargs)
¶
BotDiscordPlugin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
urls
|
list or str
|
Webhook urls. |
required |
username
|
str
|
The bot username |
None
|
delete_message(message_response, **kwargs)
¶
Delete the message based on the response passed as argument.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message_response
|
Response or list
|
webhook.execute() response |
required |
Returns:
| Name | Type | Description |
|---|---|---|
response |
Union[Response, List[Response]]
|
Webhook response. |
delete_message_edited(message_response_edited)
¶
Delete the message edited based on the response passed as argument.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message_response_edited
|
Response or list
|
webhook.execute() response |
required |
Returns:
| Name | Type | Description |
|---|---|---|
response |
Union[Response, List[Response]]
|
Response of message deleted. |
edit_message(message_response, new_content_message, **kwargs)
¶
Edits the message based on the response passed as argument.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message_response
|
Response or list
|
webhook.execute() response |
required |
new_content_message
|
str
|
The new message content. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
response |
Union[Response, List[Response]]
|
Webhook response. |
send_embedded_message(message, **kwargs)
¶
Discord Embed Message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
EmbeddedMessage
|
The message content. See EmbeddedMessage |
required |
Returns:
| Name | Type | Description |
|---|---|---|
response |
Union[Response, List[Response]]
|
Webhook response. |
send_file(files, **kwargs)
¶
Upload file to the webhook.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
files
|
list
|
The file paths. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
response |
Webhook response. |
send_message(content, rate_limit_retry=False, allowed_mentions=None, files=None, **kwargs)
¶
Send a simple message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
str
|
The message content. |
required |
rate_limit_retry
|
bool
|
if rate_limit_retry is True then in the event that you are being rate limited by Discord your webhook will automatically be sent once the rate limit has been lifted |
False
|
allowed_mentions
|
list
|
The list of users to ping. |
None
|
files
|
str
|
Add files. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
response |
Response
|
Webhook response. |
botcity.plugins.discord.models.Color
¶
Bases: Enum
The color type.
Attributes:
| Name | Type | Description |
|---|---|---|
RED |
str
|
The red color in hexadecimal. |
GRAY |
str
|
The gray color in hexadecimal. |
BLUE |
str
|
The blue color in hexadecimal. |
GREEN |
str
|
The green color in hexadecimal. |
WHITE |
str
|
The white color in hexadecimal. |
BLACK |
str
|
The black color in hexadecimal. |
BROWN |
str
|
The brown color in hexadecimal. |
YELLOW |
str
|
The yellow color in hexadecimal. |
PURPLE |
str
|
The purple color in hexadecimal. |
ORANGE |
str
|
The orange color in hexadecimal. |
botcity.plugins.discord.models.Author
dataclass
¶
Author info.
Attributes:
| Name | Type | Description |
|---|---|---|
url |
str
|
Profile url. |
name |
str
|
Author name. |
icon_url |
str
|
URL to author profile picture. |
botcity.plugins.discord.models.Footer
dataclass
¶
Footer info.
Attributes:
| Name | Type | Description |
|---|---|---|
text |
str
|
Footer text. |
icon_url |
str
|
URL to footer icon. |
botcity.plugins.discord.models.Field
dataclass
¶
Field info.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Name of field. |
value |
str
|
Value of field. |
inline |
bool
|
True if the embed fields are placed side by side, False the field are placed in new line. |
botcity.plugins.discord.models.EmbeddedMessage
dataclass
¶
The embedded message.
Attributes:
| Name | Type | Description |
|---|---|---|
title |
str
|
Title of embed. |
description |
str
|
Description body of embed. |
color |
Union[str, Color]
|
Color code of the embed as hexadecimal string or Color enum. |
image |
str
|
Your image url here. |
author |
Author
|
Author information. |
footer |
Footer
|
Footer texts. |
thumbnail |
str
|
Your thumbnail url here. |
fields |
List[Field]
|
List of Field information. |
timestamp |
float
|
Timestamp of embed content. |
files |
Union[List[str], Dict[str, bytes]]
|
Send files in embedded message. |