https://github.com/thelsbt/godotdiscordwebhooks
A Godot api to send messages via a discord web hook
https://github.com/thelsbt/godotdiscordwebhooks
discord discord-webhook easy-to-use godot-addon godot-engine godot4 godotengine script webhook-api
Last synced: 7 months ago
JSON representation
A Godot api to send messages via a discord web hook
- Host: GitHub
- URL: https://github.com/thelsbt/godotdiscordwebhooks
- Owner: TheLsbt
- License: mit
- Created: 2024-06-10T21:03:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-01T14:00:57.000Z (almost 2 years ago)
- Last Synced: 2025-01-31T04:24:38.313Z (over 1 year ago)
- Topics: discord, discord-webhook, easy-to-use, godot-addon, godot-engine, godot4, godotengine, script, webhook-api
- Language: GDScript
- Homepage:
- Size: 50.8 KB
- Stars: 9
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Welcome to GodotDiscordWebHooks
> [!WARNING]
> Be sure to check the [unsupported features](https://github.com/TheLsbt/GodotDiscordWebHooks/wiki/Features#unsupported-features) to ensure that you can use this plugin efficiently.
Checkout the [api in action](https://github.com/TheLsbt/GodotDiscordWebHooks#api-in-action)
## Check the docs
Check the [docs](https://github.com/TheLsbt/GodotDiscordWebHooks/wiki/Docs)
## Getting started
1. To get started with GodotDiscordWebHooks install this plugin either from downloading / cloning the GitHub repository.
3. Get a [webhook url](https://github.com/TheLsbt/GodotDiscordWebHooks#get-a-webhook-url) if you haven't already.
4. Next you can [create your first message](https://github.com/TheLsbt/GodotDiscordWebHooks#my-first-message)
## My first message
1. After installing the files for GodotDiscordWebHooks, create a scene and attach a node to the root.
2. Open the script and create a _ready() function.
```gdscript
# In res://Node.gd
func _ready() -> void:
pass
```
3. Create a webhook object to send content and change the webhooks username. Remember to replace `WEBHOOK_URL` with your webhook's url. Get a [webhook url](https://github.com/TheLsbt/GodotDiscordWebHooks/wiki/Home/_edit#get-a-webhook-url) if you haven't already.
```gdscript
# In res://Node.gd
func _read() -> void:
var webhook := DiscordWebHook.new(WEBHOOK_URL)
webhook.message("Hello from godot!")
webhook.username("A robot")
# DiscordWebHook allows chaining so the above code can also be written as:
# webhook.message("Hello from godot!").username("A robot")
```
4. Finally, we post the message, for this introduction we won't be doing anything with the response so we won't cast it
```gdscript
# In res://Node.gd
func _read() -> void:
var webhook := DiscordWebHook.new(WEBHOOK_URL)
webhook.message("Hello from godot!")
webhook.username("A robot")
# Post the message
await webhook.post()
```
## Get a webhook url
1. 
2. 
3. 
## Api in action

