I have created this module [OPEN SOURCE] that will allow you to use Discord bots from Roblox, this module already brings some functions such as sending messages, embeds, react messages, reply messages, kick or ban a member of a server, and send direct messages (DM). (this module does not use discordia)
NOTE: the bot does not need to be online.
This module is very easy to setup, here are the steps:
→ Module Link: DisBot Module
-Step1:
Create a script.
-Step2:
Require the module in the script:
local DisBot = require(13165754449)
-Step3:
You have to set the Token of the bot, and the Id of a server where the bot is located:
local DisBot = require(13165754449)
DisBot:SetBot("BotName", "BotTokenGoesHere")
DisBot:SetServer("ServerIdGoesHere")
and that’s it!
-SEND MESSAGE:
local DisBot = require(13165754449)
DisBot:SetBot("BotName", "BotTokenGoesHere")
DisBot:SetServer("ServerIdGoesHere")
local channelId = "ChannelIdGoesHere" --> where you want to send the message.
local message = "this is the message"
DisBot:Message("BotName", channelId, message)
-SEND EMBED:
local DisBot = require(13165754449)
DisBot:SetBot("BotName", "BotTokenGoesHere")
DisBot:SetServer("ServerIdGoesHere")
local channelId = "ChannelIdGoesHere" --> where you want to send the embed.
local embedExample = {
title = "Title of the Embed",
description = "Description of the Embed",
color = 65280, -- green color
thumbnail = {
url = "https://www.roblox.com/asset-thumbnail/image?assetId=102611803"
},
author = {
name = "Author of the Embed",
url = "https://www.roblox.com/users/123456/profile"
},
footer = {
text = "Footer Text",
icon_url = "https://www.roblox.com/asset-thumbnail/image?assetId=102611803"
},
fields = {
{
name = "Field 1",
value = "Value of Field 1"
},
{
name = "Field 2",
value = "Value of Field 2"
}
}
}
DisBot:Embed("BotName", channelId, embedExample)
-REACT TO MESSAGE:
local DisBot = require(13165754449)
DisBot:SetBot("BotName", "BotTokenGoesHere")
DisBot:SetServer("ServerIdGoesHere")
local channelId = "ChannelIdGoesHere" --> where you want to send the embed.
local messageId = "MessageIdGoesHere" --> which message you want to react
local emoji = "Emoji or emoji id (for nitro emojis)"
DisBot:ReactToMessage("BotName", channelId, messageId, emoji)
-KICK OR BAN MEMBER:
local DisBot = require(13165754449)
DisBot:SetBot("BotName", "BotTokenGoesHere")
DisBot:SetServer("ServerIdGoesHere")
local memberId = "MemberIdGoesHere" --> member to kick or ban
---[Kick]---
DisBot:KickMember("BotName", memberId)
---[Ban]---
DisBot:BanMember("BotName", memberId)
-DIRECT MESSAGE (DM):
local DisBot = require(13165754449)
DisBot:SetBot("BotName", "BotTokenGoesHere")
DisBot:SetServer("ServerIdGoesHere")
local embedExample = {
title = "Title of the Embed",
description = "Description of the Embed",
color = 65280, -- green color
thumbnail = {
url = "https://www.roblox.com/asset-thumbnail/image?assetId=102611803"
},
author = {
name = "Author of the Embed",
url = "https://www.roblox.com/users/123456/profile"
},
footer = {
text = "Footer Text",
icon_url = "https://www.roblox.com/asset-thumbnail/image?assetId=102611803"
},
fields = {
{
name = "Field 1",
value = "Value of Field 1"
},
{
name = "Field 2",
value = "Value of Field 2"
}
}
}
local ExampleArgs = {
["BotName"] = "BotName", --1st *
["UserId"] = "UserIdGoesHere", --2th *
["Message"] = "MessageGoesHere",
["Embed"] = embedExample,
}
local function SendDM(Channel:string, Args:{})
---[DM | Message Example]---
DisBot:Message(Args["BotName"], Channel, Args["Message"])
---[DM | Embed Example]---
DisBot:Embed(Args["BotName"], Channel, Args["Embed"])
end
DisBot:DM("BotName", ExampleArgs, SendDM)
-REPLY MESSAGES:
local DisBot = require(13165754449)
DisBot:SetBot("BotName", "BotTokenGoesHere")
DisBot:SetServer("ServerIdGoesHere")
local replyMessage = "This is the message" --> the reply message
local channelId = "ChannelIdGoesHere" --> where is the message to reply
local messageId = "MessageIdGoesHere" --> message to reply id
DisBot:ReplyMessage("BotName", replyMessage, channelId, messageId)
UPDATE#2: Now you can add more than one Discord Bot and use it with just one module or module id.