What is Voyager?
Voyager is a Discord webhook API wrapper for Roblox.
Why should I use Voyager?
Voyager makes interacting with Discord webhooks much easier, as you not only write less code but the code you do write is much more readable too, this results in a much better developer experience. Voyager also has very good API coverage over Discord’s webhook API, so no matter how niche your use case is, Voyager can most likely help you out!
How can I start using Voyager?
Creator Marketplace
-
Get Voyager off the creator marketplace.
-
Open the toolbox and drag the Voyager into your project.
-
Move Voyager into ServerScriptService or ServerStorage.
-
Enable “Allow HTTP Requests” in Game Settings > Security.
Model File
-
Go to the releases page and download the latest version of Voyager.
-
Drag the model file into your project.
-
Move Voyager into ServerScriptService or ServerStorage.
-
Enable “Allow HTTP Requests” in Game Settings > Security.
Wally
-
Go to Voyager’s wally page and copy the install string found underneath the metadata section.
-
Open your wally.toml file and underneath
[server-dependencies]
paste the string you got from the previous step. -
Open your preferred cli and run
wally install
in your projects directory. -
Enable “Allow HTTP Requests” in Game Settings > Security.
Code examples
Example 1: Sending a message
local voyager = require(path_here.Voyager)
local webhook = voyager.Webhook.new("webhookId", "webhookToken")
webhook:SendMessage("Hello, World!")
Example 2: Sending a message with embedded content
local voyager = require(path_here.Voyager)
local webhook = voyager.Webhook.new("webhookId", "webhookToken")
local embed = voyager.Embed.new("Voyager is really useful!")
webhook:SendMessage(nil, { embed })
Example 3: Sending a message to a thread
local voyager = require(path_here.Voyager)
local webhook = voyager.Webhook.new("webhookId", "webhookToken")
webhook:SendMessageInThread("threadId", "Nice thread 👌")
Example 4: Sending a TTS message
local voyager = require(path_here.Voyager)
local webhook = voyager.Webhook.new("webhookId", "webhookToken")
local optionalInfo = voyager.OptionalSendMessageInfo.new(true)
webhook:SendMessage("This is a tts message!", nil, nil, nil, optionalInfo)
Note: Keep in mind that you have to be in the channel before the message is sent, otherwise it will not play for you.
Example 5: Obtaining a Message instance
local voyager = require(path_here.Voyager)
local webhook = voyager.Webhook.new("webhookId", "webhookToken")
local message, requestStatus = webhook:SendMessage("Hello, World!", nil, false, true)
if requestStatus.Success then
print(message.Id)
end
Can Voyager do more than just send messeges?
Yes! Voyager can also edit and delete messeges sent by the webhook.
How can I edit a message with Voyager?
local voyager = require(path_here.Voyager)
local webhook = voyager.Webhook.new("webhookId", "webhookToken")
webhook:EditMessage("messageId", "Hello, there!")
Before:
After:
How can I delete a message with Voyager?
local voyager = require(path_here.Voyager)
local webhook = voyager.Webhook.new("webhookId", "webhookToken")
webhook:DeleteMessage("messageId")
With Voyager vs without Voyager
Curious to see the difference Voyager makes? check it out here.
Credit
Huge thanks to @lewisakura for creating and hosting the proxy used in this library. Without them this project wouldn’t have been possible. Support them here!