Welcome to Chatterbot, the resource for your automated chat needs! Chatterbot is a small module where you can create a bot, customize it and allow it to send messages!
NOTE - This is my first time doing something like this, feedback is appreciated!
How To Use (New Version):
- Place the ModuleScript in ServerScriptService.
- Require it from the script you need.
Example:
local bot = require(game.ServerScriptService.ChatterbotModule)
- Create a new bot with the bot.New() function. The chatbot’s name is a required parameter and must be provided for the bot to function properly.
Example:
local bot = require(game.ServerScriptService.ChatterbotModule)
newbot = bot.New("Bot")
This will create a new bot named Bot.
However, your bot will not send messages until you call 2 main functions coming in step 4.
4a. Use newbot:JoinChannel() to allow the bot to send messages in provided channel. The channel is a required parameter and will error out if not provided.
Example:
local bot = require(game.ServerScriptService.ChatterbotModule)
newbot = bot.New("Bot", "Developer", Color3.fromRGB(170, 0, 127), 12)
newbot:JoinChannel("All")
4b. Use newbot:SendMsg() to allow the bot to send messages in provided channel. The message is a required parameter and will error out if not provided.
Example:
local bot = require(game.ServerScriptService.ChatterbotModule)
newbot = bot.New("Bot")
newbot:JoinChannel("All")
newbot:SendMsg("Howdy!")
That’s the basics! There are more things you can do to customize your bot though.
Example:
local bot = require(script.Parent.ChatterbotModule)
local newbot = bot.New("Bot")
newbot:JoinChannel("All")
newbot:AddTag("Developer", Color3.fromRGB(170, 0, 127))
newbot:Font(Enum.Font.FredokaOne)
newbot:ChatColor(Color3.fromRGB(255, 255, 255))
newbot:NameColor(Color3.fromRGB(85, 170, 127))
newbot:SendMsg("I'm a chat bot!")
FUNCTIONS:
:JoinChannel(string) - Allows the chatbot to join a chat channel and send messages. Channel param required.
:LeaveChannel(string) - Allows the chatbot to leave a chat channel. Channel param required.
:AddTag(string, Color3) - Adds a tag to the chatbot from the given data used when constructing a new chatterbot. Text to be displayed on tag and the color of the tag are required params.
:NameColor(Color3) - Changes the color of the given name. Color3 param required.
:ChatColor(Color3) - Changes the color of sent messages. Color3 param required.
:Font(Enum.Font.(Whichever font you chose)) - Changes the font of sent messages. Enum.Font param required.
:TextSize(number) - Changes the size of the text from sent messages. number param required.
:SendMsg(string) - Sends a message. Bot must be in appropriate channel or message sending will fail. Message param required.
:Nyani() - Sends a premade message. Bot must be in appropriate channel or message sending will fail. No param required.
:Destroy(string) - Destroys the chatterbot. The name of the chatbot is a required parameter (with appropriate casing).
How To Use (Legacy Version):
- Place the ModuleScript in ServerScriptService.
- Require it from the script you need.
Example:
local bot = require(game.ServerScriptService.ChatterbotModule)
- Create a new bot with the bot.New() and newbot:Create() function. The chatbot’s name, tag data, and text size are required parameters and must be provided to function properly.
Example:
local bot = require(game.ServerScriptService.ChatterbotModule)
newbot = bot.New("Bot", "Developer", Color3.fromRGB(170, 0, 127), 12)
newbot:Create()
This will create a new bot named Bot.
However, your bot will not send messages until you call 2 main functions coming in step 4.
4a. Use newbot:JoinChannel() to allow the bot to send messages in provided channel. The channel is a required parameter and will error out if not provided.
Example:
local bot = require(game.ServerScriptService.ChatterbotModule)
newbot = bot.New("Bot", "Developer", Color3.fromRGB(170, 0, 127), 12)
newbot:Create()
newbot:JoinChannel("All")
4b. Use newbot:SendMsg() to allow the bot to send messages in provided channel. The channel and message are required parameters and will error out if not provided.
Example:
local bot = require(game.ServerScriptService.ChatterbotModule)
newbot = bot.New("Bot", "Developer", Color3.fromRGB(170, 0, 127), 12)
newbot:Create()
newbot:JoinChannel("All")
newbot:SendMsg("Howdy!", "All")
That’s the basics! There are more things you can do to customize your bot though.
Example:
local bot = require(script.Parent.ChatterbotModule)
local newbot = bot.New("Bot", "Developer", Color3.fromRGB(170, 0, 127), 12)
newbot:Create()
newbot:JoinChannel("All")
newbot:AddTag()
newbot:Font(Enum.Font.FredokaOne)
newbot:ChatColor(Color3.fromRGB(255, 255, 255))
newbot:NameColor(Color3.fromRGB(85, 170, 127))
newbot:SendMsg("I'm a chat bot!", "All")
FUNCTIONS:
:Create() - Initiates a new chatbot. No params required.
:JoinChannel() - Allows the chatbot to join a chat channel and send messages. Channel param required.
:LeaveChannel() - Allows the chatbot to leave a chat channel. Channel param required.
:AddTag() - Adds a tag to the chatbot from the given data used when constructing a new chatterbot. No params required.
:NameColor() - Changes the color of the given name. Color3 param required.
:ChatColor() - Changes the color of sent messages. Color3 param required.
:Font() - Changes the font of sent messages. Enum.Font param required.
:TextSize() - Changes the size of the text from sent messages. Provided when constructing a new chatterbot. No params required.
:SendMsg() - Sends a message. Bot must be in provided channel or message sending will fail. Message and channel params required.
:Nyani() - Sends a premade message. Bot must be in provided channel or message sending will fail. Channel param required.
:Destroy() - Destroys the chatterbot. No params required.
Getting the Module:
(V2.0) READ How To Use (New Version) for this version and more to function properly.
ChatV2.0.rbxl (38.8 KB)
(V3.0) READ How To Use (Legacy Version) for this version to function properly.
ChatV3.0.rbxl (47.2 KB)
NOTE: I won’t mind if you use it for your games and don’t credit me. However, if you get the code and edit it, you must credit me with a link.
If you want to help with this, reply down below.
New Version Video Demonstration:
robloxapp-20221127-2149479.wmv (419.5 KB)