Created
February 23, 2020 23:37
-
-
Save iggyvolz/dddbb80372d59133d3ea1102b5fe43b2 to your computer and use it in GitHub Desktop.
Pronouns bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local client = require('discordia').Client() | |
local allowableRoles = {{"681281731869147208", "He/Him"}, {"681281755080294443", "She/Her"}, {"681281780220690520", "They/Them"}} | |
client:on('messageCreate', function(message) | |
for i=1,3 do | |
local id, name = unpack(allowableRoles[i]) | |
if message.content == "!pronouns "..name then | |
local member = message.member | |
if not member then break end | |
if member:hasRole(id) then | |
member:removeRole(id) | |
message:reply("Removed role "..name) | |
else | |
member:addRole(id) | |
message:reply("Added role "..name) | |
end | |
end | |
end | |
end) | |
client:run('Bot (BOT TOKEN)') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment