Resources¶
webhook
¶
Webhook
dataclass
¶
Bases: BaseResource
flowchart TD
scurrypy.resources.webhook.Webhook[Webhook]
scurrypy.resources.base_resource.BaseResource[BaseResource]
scurrypy.resources.base_resource.BaseResource --> scurrypy.resources.webhook.Webhook
click scurrypy.resources.webhook.Webhook href "" "scurrypy.resources.webhook.Webhook"
click scurrypy.resources.base_resource.BaseResource href "" "scurrypy.resources.base_resource.BaseResource"
Represents a webhook resource.
create
async
¶
Create a webhook to be sent to a channel.
Permissions
Requires MANAGE_WEBHOOKS
Parameters:
-
channel_id(Snowflake) –channel ID to send webhook messages
-
webhook(WebhookPart) –the webhook to create
Returns:
-
JsonQuery–created webhook
fetch_guild
async
¶
fetch_webhooks
async
¶
fetch
async
¶
edit
async
¶
delete
async
¶
Delete a webhook.
Permissions
Requires MANAGE_WEBHOOKS
Parameters:
-
webhook_id(Snowflake) –ID of the webhook to delete
execute
async
¶
Execute a webhook.
Parameters:
-
webhook_id(Snowflake) –ID of the webhook to send message
-
token(str) –token of the webhook to send message
-
message(WebhookMessagePart | str) –webhook message
-
wait(bool, default:False) –whether to return message. Defaults to
False. -
thread_id(Snowflake, default:None) –thread ID to send message
Note
Thread will also be unarchived.
-
with_components(bool, default:False) –Whether to respect the
componentsfield. Defaults toFalse. -
suppress_embeds(bool, default:False) –whether to suppress embeds. Defaults to
False. -
is_components_v2(bool, default:False) –whether V2 components are in this message. Defaults to
False. -
suppress_notifications(bool, default:False) –whether to suppress notifications. Defaults to
False.
Returns:
-
JsonQuery | None–webhook message if
wait = TrueelseNone