DisWebHooks - module script that allows you to manage discord webhooks on the go! (Updated)

DisWebHooks

DisWebHooks - A free and easy to use module script that allows you to manage discord webhooks on the go!

Features:

  • Easy to use :sparkles:
  • Automatic error catching :name_badge:
  • Requests are sent directly to Discord API (v10) :robot:

:question: Tutorial :mag_right:

  1. Enable game http requests (Security section)
  2. Get script and place into ServerScriptService:
local dishooks = require(game.ServerScriptService.DisWebHooks)
  1. Get webhook:
local webhook = dishooks.GetWebhook("webhook-url")
  1. Execute, delete or modify webhook:
-- Send message to webhook channel
local message = require(game.ServerScriptService.DisWebHooks.Message)
local msg = message.new("Hello, World!")
webhook:SendMessage(msg)

-- Modify webhook
local body = {
    ["name"] = "Rbx WebHook"
}
webhook:Modify(body)

-- Delete webhook
webhook:Delete()

Example

Simple chat-logger server script:

local dishooks = require(game.ServerScriptService.DisWebHooks)
local message = require(game.ServerScriptService.DisWebHooks.Message)
local embed = require(game.ServerScriptService.DisWebHooks.Embed)
local webhook = nil

game.Players.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(content, _r)
		if webhook ~= nil then
			local msg = message.new()
			msg:SetContent(content)
			msg:SetUsername(plr.Name)
			
			webhook:SendMessage(msg)
		end
	end)
end)

webhook = dishooks.GetWebhook("webhook-url")

Embed-Example

Chat-logger embed edition:

local dishooks = require(game.ServerScriptService.DisWebHooks)
local message = require(game.ServerScriptService.DisWebHooks.Message)
local embed = require(game.ServerScriptService.DisWebHooks.Embed)
local webhook = nil

game.Players.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(content, _r)
		if webhook ~= nil then
			local msg = message.new()
			msg:SetUsername(plr.Name)
			
			local emb = embed.new()
			emb:SetTitle("Message sent!")
			emb:SetDescription("Content: "..content)
			emb:SetColor(Color3.fromRGB(math.random(0, 255), math.random(0, 255), math.random(0, 255)))
			emb:SetAuthor(plr.Name)
			msg:AddEmbed(emb)

			webhook:SendMessage(msg)
		end
	end)
end)

webhook = dishooks.GetWebhook("webhook-url")

:mag_right: Documentation :mag:

DisWebHooks

.GetWebhook(id: string, token: string): Webhook

Webhook

:SendMessage(msg: {}, thread_id: string?) - Send a message to a webhook channel
:Modify(body: {}): boolean - Change the name or avatar of the webhook. Returns whether the action was successful or not
:Delete(reason: string?) - Delete webhook.
:GetId(): string - Returns webhook ID
:GetToken(): string - Returns webhook token
:GetType(): string - Returns webhook type
:GetGuildId(): string - The guild id this webhook is for, if any
:GetChannelId(): string - The channel id this webhook is for, if any
:GetName(): string - The default name of the webhook
:GetAvatarUrl(): string - Returns webhook avatar url

Message

:SetContent(content: string) - set message content
:SetUsername(username: string) - override the default username of the webhook
:SetAvatarUrl(avatarUrl: string) - override the default avatar of the webhook
:SetTts(tts: boolean) - true if this is a TTS (TextToSpeech) message
:AddEmbed(embed: {}) - add embed to the message
:SetThreadName(thread_name: string) - name of thread to create (requires the webhook channel to be a forum or media channel)
:ApplyTag(tagId: string) - add tag to apply to the thread (requires the webhook channel to be a forum or media channel)

Embed

:SetTitle(title: string) - set title of embed
:SetDescription(description: string) - set description of embed
:SetFooter(text: string, iconUrl: string?) - set footer information
:SetImageUrl(url: string) - set embed big image
:SetThumbnailUrl(url: string) - set small right-top embed image
:SetAuthor(name: string, avatarUrl: string?, url: string?) - set author information
:AddField(name: string, val: string, inline: boolean?)
:SetColor(color: Color3) - set color of embed

5 Likes

Nice! Can u add a message reply thing?

1 Like

Of course! Iโ€™m working on an update that will make it easy to send embeds, replies and much more!

1 Like

Nice module. Finally I can send exploit reports without messing with proxys and HTTPService. :+1:

2 Likes

Feature request: getting RBLX images via module
(Like for example avatar headshots(

1 Like

game.Players:GetUserThumbnailAsync()

I donโ€™t recommend using discord for chat logs. Itโ€™s literally one of the reasons we arenโ€™t allowed to directly post requests anymore.

Doesnโ€™t exist anymore
50 words omgggggg