Hey i tried to add autorole to my discord bot in discordia im working on and im not sure why isnt it working.
also if you have any good docs releated to discordia pls let me know.
local discordia = require("discordia")
local env = require("./env")
local Client = discordia.Client()
local Commands = require("../dependencies/Commands.lua")
local CommandHandler = require("../dependencies/CommandHandler.lua")
local CommandClass = require("../classes/Command.lua")
local function initializeCommands()
for key, callback in pairs(Commands) do
CommandHandler.AddCommand(CommandClass.new(key, function(message, ...)
callback({
CommandHandler = CommandHandler,
Message = message,
args = {...}
})
end))
end
end
initializeCommands()
Client:on("ready", function()
print("Ready!")
end)
Client:on("messageCreate", function(message)
local prefix = "!"
CommandHandler.Parse(message, prefix)
end)
Client:on("memberJoin", function(member)
local autoRoleId = 1244380253690925137
member:addRole(autoRoleId)
print("Autorole added!")
end)
Client:run(string.format("Bot %s", env.TOKEN))
tried to add autorole to my discordia discord bot it’s not working
New contributor
Dr akula is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.