join

Privateunrated

Content

195 lines
{=(COMMENT):--- CUSTOM SETTINGS ---}
{=(COMMENT):Your server's main prefix and the name used for this tag.
They will appear dynamically in the command's instructions for the user.}
{=(prefix):!}
{=(tagname):join}

{=(COMMENT):The role IDs and channels IDs required to use the tag, and the error message to display if a user without the roles or outside of the channel uses the command.
Separate each ID's element with a space or a comma.
If you want no error message to be sent and not even the default Carl-bot's ⚠ reaction when used outside of the required channel, simply put a space as the message.}
{=(required.elements):690453035616436224}
{=(required.message):Groups joining can only be done in the <#{required.elements}> channel!}

{=(COMMENT):Output management.
I added custom placeholder words that will dynamically be replaced in your outputs with the actual content it should hold.
For example, can add the word "GROUP" in all caps if you'd like it to be replaced by the actual group name they tried to join.}

{=(COMMENT):The title the embed will have. Change it as you wish.}
{=(embed.title):Group Join Request}

{=(COMMENT):Message that is displayed when the user gave the correct password for the specified group, along with receiving their group role.
For that message, you can type "ROLE" in all caps if you wish for it to be replaced with the role mention.}
{=(success.message):{user(mention)}, you successfully joined the **GROUP** group and received the ROLE role!}

{=(COMMENT):Error message that will be sent/displayed when the user specifies a group keyword that couldn't be found. No need for you to actually include the list of available groups here, as it's also done for you later in the code. That's moreso the "header" of what's displayed before the groups list, if you prefer.}
{=(wrong.keyword.error):{user(mention)}, the group you specified could not be found. Please try again.

Here's a list of available groups to join:}

{=(COMMENT):Error message that will be sent/displayed when the user specifies the wrong password, even if the group name was correct.}
{=(wrong.password.error):{user(mention)}, the password you provided for **GROUP** is wrong. Make sure you spelled it correctly.}

{=(COMMENT):Message to return when the user tries to join a group they're already in/they already have a role for.}
{=(already.group):{user(mention}, you already joined the **GROUP** group!}

{=(COMMENT):The roles that will be pinged along with the no-password output.}
{=(roles.to.ping):449440158924931082 334409918503452674}

{=(COMMENT):Message to display when the user specified a group name but no password.
Don't include the roles to ping above or the name of a group. That'll be managed for you automatically in the code.}
{=(no.password.message):{user(mention)} is looking to join the guild for **GROUP**.}

{=(COMMENT):Instructions output. Returned when the user either didn't specify a group name, or if it was invalid, or if the first argument was "help".
Will display a list of the groups available, as well as command usage.}
{=(help.message):This command allows you to join a specific group among the available ones below, granted you provide the correct password.

If a group name but no password is provided, a looking-to-join request will be sent to the Community Managers.}

{=(COMMENT):The list of available passwords separated by spaces. There's only one currently, but it is possible to add more, as I made it so each group requires their specific password from the variable below.}
{=(password):ETM}

{=(COMMENT):Should it DM the user the available groups keywords when no password is given?
Accepts "yes", "no", "true", "false".
Defaults to false, even if empty.}
{=(should.it.DM):no}

{=(COMMENT):--- ACTUAL CODE --- No need to touch unless you want to edit something more in depth.}
{=(COMMENT):Case insensitivity}
{=(largs):{lower:{args}}}
{=(COMMENT):Lowercase version of the first and second argument. A list block was used to return nothing if the argument doesn't exist.}
{=(l1):{lower:{list(0):{join(~):{args}}}}}
{=(l2):{lower:{list(1):{join(~):{args}}}}}

{=(COMMENT):Puts the password above in settings as lowercase.}
{=(pw):{lower:{password}}}

{=(COMMENT):password~RoleID~Group/Game Name}
{=(COMMENT):The two lines below are actually never used, but I left them just in case.}
{=(g.{l1}):{wrong.keyword.error}~~}
{=(g.help):{g.{l1}}}

{=(COMMENT):All groups variables, with their required password, role ID, and name.
When you see re-assignment of variables, it's just a way/workaround to add keywords/aliases to the original variable.}
{=(g.bdm):{pw(1)}~654228591252340736~Black Desert Mobile}
{=(g.blackdesert):{g.bdm}}

{=(g.bu):{pw(1)}~458733609206153216~Bless Unleashed}
{=(g.bless):{g.bu}}
{=(g.unleashed):{g.bu}}

{=(g.eveechoes):{pw(1)}~546936030108844054~Eve Echoes}
{=(g.ee):{g.eveechoes}}
{=(g.eve):{g.eveechoes}}

{=(g.newworld):{pw(1)}~766032195063644218~New World}
{=(g.nw):{g.newworld}}

{=(g.ffxiv):{pw(1)}~708885837823344640~Final Fantasy XIV}
{=(g.ff):{g.ffxiv}}
{=(g.xiv):{g.ffxiv}}
{=(g.final):{f.ffxiv}}
{=(g.finalfantasy):{g.ffxiv}}
{=(g.finalfantasyxiv):{g.ffxiv}}

{=(g.warframe):{pw(1)}~510777688915705867~Warframe}
{=(g.wf):{g.warframe}}

{=(g.genshinimpact):{pw(1)}~617296597969141780~Genshin Impact}
{=(g.genshin):{g.genshinimpact}}

{=(g.ashesofcreation):{pw(1)}~430261119374983168~Ashes of Creation}
{=(g.ashes):{g.ashesofcreation}}
{=(g.aoc):{g.ashesofcreation}}

{=(g.friend):{pw(1)}~606667180817252352~Friend}

{=(g.guest):~790751383467982918~Guest}

{=(COMMENT):Keywords}
{=(keywords):bdm~bu bless unleashed~eveechoes ee eve~newworld nw~ffxiv ff xiv final finalfantasy finalfantasyxiv~warframe wf~genshinimpact genshin~ashesofcreation ashes aoc~friend~guest}
{=(kw):`{join(`, `):{replace(~,`~`):{keywords}}}`}

{=(COMMENT):Right arrow emoji to display before each new group in the groups list.}
{=(twr):<:twright:739824939124785174>}

{=(COMMENT):ROLEID
keyword, keyword, keyword}
{=(groups.list):{twr} <@&{g.bdm(2):~}>
{kw(1):~}
{twr} <@&{g.bu(2):~}>
{kw(2):~}
{twr} <@&{g.ee(2):~}>
{kw(3):~}
{twr} <@&{g.nw(2):~}>
{kw(4):~}
{twr} <@&{g.ff(2):~}>
{kw(5):~}
{twr} <@&{g.wf(2):~}>
{kw(6):~}
{twr} <@&{g.genshin(2):~}>
{kw(7):~}
{twr} <@&{g.ashes(2):~}>
{kw(8):~}
{twr} <@&{g.friend(2):~}>
{kw(9):~}
{twr} <@&{g.guest(2):~}>
{kw(10):~}}

{=(COMMENT):Re-defining the wrong keyword error message to include the groups list above.}
{=(wrong.keyword.error):{wrong.keyword.error}

{groups.list}}

{=(COMMENT):Same as above but for the "help" header message.}
{=(help.message):{help.message}

{groups.list}}

{=(COMMENT):Puts the data to return from the user input in separate variables for practicality.}
{=(u.pw):{g.{l1}(1):~}}
{=(u.role):{g.{l1}(2):~}}
{=(u.name):{g.{l1}(3):~}}

{=(COMMENT):Blank variable to do nothing if conditional behavior blocks evaluate to false.}
{=():}

{=(isHelp):{any({l1}==|{l1}==help):true|false}}
{=(isPW):{if({l2}!=):true|false}}
{=(isValidPW):{if({l2}=={u.pw}):true|false}}

{=(isAlready):{contains({u.role}):{user(roleids)}}}

{=(COMMENT):Checks if the user specified a valid keyword.}
{=(isValidName):{in({l1}):{replace(~,):{keywords}}}}

{=(COMMENT):Giving the role to the user if the password for the specified group was correct.}
{{all({isValidPW}==true|{isAlready}==false):c:role add {user(id)} {u.role}}}
{override} {silence} {delete}

{=(COMMENT):Booleans for when the Community Managers' roles should be mentioned.}
{=(shouldPing):{isHelp}==false|{isPW}==false|{l1}!=guest|{isValidName}==true}

{=(roles.pings):{and({shouldPing}):<@&{join(> <@&):{roles.to.ping}}>}}
{roles.pings}

{=(COMMENT):Embed Output Management}
{=(COMMENT):Embed Title, grabbed from the custom settings}
{=(em.title):{embed.title}}

{=(COMMENT):Embed description, conditional depending on all the conditional statements above.}
{=(em.desc):{if({isAlready}==true):{already.group}|{if({isHelp}==true):{help.message}|{if({isValidName}==false):{wrong.keyword.error}|{replace(GROUP,{u.name}):{if({isValidPW}==true):{replace(ROLE,<@&{u.role}>):{success.message}}|{if({isPW}==false):{no.password.message}|{if({isValidPW}==false):{wrong.password.error}}}}}}}}}

{=(COMMENT):Embed's footer. Returns the user ID if the request is pending/pinged the CMs, or the command's input instructions.}
{=(em.footer):{and({shouldPing}==true):{user(id)}|{any({isHelp}==true|{isValidName}==false):{prefix}{tagname} [<keyword>|help] <password>}}}

{=(COMMENT):Sets the embed's side color to the user color.
Actually nevermind, this got removed by Carl without notice.}
{embed(color):{user(color)}}

{=(COMMENT):That's the part that actually allows and replaces "yes" and "no" with their boolean equivalent.}
{=(shouldDM):{replace(yes,true):{replace(no,false):{lower:{should.it.DM}}}}}
{=(COMMENT):Conditionally DMs the user the success message (when they should get the role), depending on the user settings at the top of the command.}
{{and({isValidPW}==true):{if({shouldDM}==true):dm}}}

{=(COMMENT):Requiring the specified channel(s) and role(s) if any in the custom settings, as well as the custom error message.}
{require({required.message}):{required.role}}

Embed

1 line
{"color": 5198940, "title": "{em.title}", "footer": {"text": "{em.footer}"}, "description": "{em.desc}"}
Raw JSON
{
  "id": 497217,
  "created_at": "2020-12-22T16:43:16.000Z",
  "tag_name": "join",
  "nsfw": false,
  "owner_id": "149926720114262016",
  "uses": 2,
  "description": null,
  "restricted": false,
  "shared": false,
  "deleted": false,
  "safe": "unrated",
  "hidden": false,
  "guild_id": "314660900302749696",
  "sharer": "149926720114262016",
  "content": "{=(COMMENT):--- CUSTOM SETTINGS ---}\n{=(COMMENT):Your server's main prefix and the name used for this tag.\nThey will appear dynamically in the command's instructions for the user.}\n{=(prefix):!}\n{=(tagname):join}\n\n{=(COMMENT):The role IDs and channels IDs required to use the tag, and the error message to display if a user without the roles or outside of the channel uses the command.\nSeparate each ID's element with a space or a comma.\nIf you want no error message to be sent and not even the default Carl-bot's ⚠ reaction when used outside of the required channel, simply put a space as the message.}\n{=(required.elements):690453035616436224}\n{=(required.message):Groups joining can only be done in the <#{required.elements}> channel!}\n\n{=(COMMENT):Output management.\nI added custom placeholder words that will dynamically be replaced in your outputs with the actual content it should hold.\nFor example, can add the word \"GROUP\" in all caps if you'd like it to be replaced by the actual group name they tried to join.}\n\n{=(COMMENT):The title the embed will have. Change it as you wish.}\n{=(embed.title):Group Join Request}\n\n{=(COMMENT):Message that is displayed when the user gave the correct password for the specified group, along with receiving their group role.\nFor that message, you can type \"ROLE\" in all caps if you wish for it to be replaced with the role mention.}\n{=(success.message):{user(mention)}, you successfully joined the **GROUP** group and received the ROLE role!}\n\n{=(COMMENT):Error message that will be sent/displayed when the user specifies a group keyword that couldn't be found. No need for you to actually include the list of available groups here, as it's also done for you later in the code. That's moreso the \"header\" of what's displayed before the groups list, if you prefer.}\n{=(wrong.keyword.error):{user(mention)}, the group you specified could not be found. Please try again.\n\nHere's a list of available groups to join:}\n\n{=(COMMENT):Error message that will be sent/displayed when the user specifies the wrong password, even if the group name was correct.}\n{=(wrong.password.error):{user(mention)}, the password you provided for **GROUP** is wrong. Make sure you spelled it correctly.}\n\n{=(COMMENT):Message to return when the user tries to join a group they're already in/they already have a role for.}\n{=(already.group):{user(mention}, you already joined the **GROUP** group!}\n\n{=(COMMENT):The roles that will be pinged along with the no-password output.}\n{=(roles.to.ping):449440158924931082 334409918503452674}\n\n{=(COMMENT):Message to display when the user specified a group name but no password.\nDon't include the roles to ping above or the name of a group. That'll be managed for you automatically in the code.}\n{=(no.password.message):{user(mention)} is looking to join the guild for **GROUP**.}\n\n{=(COMMENT):Instructions output. Returned when the user either didn't specify a group name, or if it was invalid, or if the first argument was \"help\".\nWill display a list of the groups available, as well as command usage.}\n{=(help.message):This command allows you to join a specific group among the available ones below, granted you provide the correct password.\n\nIf a group name but no password is provided, a looking-to-join request will be sent to the Community Managers.}\n\n{=(COMMENT):The list of available passwords separated by spaces. There's only one currently, but it is possible to add more, as I made it so each group requires their specific password from the variable below.}\n{=(password):ETM}\n\n{=(COMMENT):Should it DM the user the available groups keywords when no password is given?\nAccepts \"yes\", \"no\", \"true\", \"false\".\nDefaults to false, even if empty.}\n{=(should.it.DM):no}\n\n{=(COMMENT):--- ACTUAL CODE --- No need to touch unless you want to edit something more in depth.}\n{=(COMMENT):Case insensitivity}\n{=(largs):{lower:{args}}}\n{=(COMMENT):Lowercase version of the first and second argument. A list block was used to return nothing if the argument doesn't exist.}\n{=(l1):{lower:{list(0):{join(~):{args}}}}}\n{=(l2):{lower:{list(1):{join(~):{args}}}}}\n\n{=(COMMENT):Puts the password above in settings as lowercase.}\n{=(pw):{lower:{password}}}\n\n{=(COMMENT):password~RoleID~Group/Game Name}\n{=(COMMENT):The two lines below are actually never used, but I left them just in case.}\n{=(g.{l1}):{wrong.keyword.error}~~}\n{=(g.help):{g.{l1}}}\n\n{=(COMMENT):All groups variables, with their required password, role ID, and name.\nWhen you see re-assignment of variables, it's just a way/workaround to add keywords/aliases to the original variable.}\n{=(g.bdm):{pw(1)}~654228591252340736~Black Desert Mobile}\n{=(g.blackdesert):{g.bdm}}\n\n{=(g.bu):{pw(1)}~458733609206153216~Bless Unleashed}\n{=(g.bless):{g.bu}}\n{=(g.unleashed):{g.bu}}\n\n{=(g.eveechoes):{pw(1)}~546936030108844054~Eve Echoes}\n{=(g.ee):{g.eveechoes}}\n{=(g.eve):{g.eveechoes}}\n\n{=(g.newworld):{pw(1)}~766032195063644218~New World}\n{=(g.nw):{g.newworld}}\n\n{=(g.ffxiv):{pw(1)}~708885837823344640~Final Fantasy XIV}\n{=(g.ff):{g.ffxiv}}\n{=(g.xiv):{g.ffxiv}}\n{=(g.final):{f.ffxiv}}\n{=(g.finalfantasy):{g.ffxiv}}\n{=(g.finalfantasyxiv):{g.ffxiv}}\n\n{=(g.warframe):{pw(1)}~510777688915705867~Warframe}\n{=(g.wf):{g.warframe}}\n\n{=(g.genshinimpact):{pw(1)}~617296597969141780~Genshin Impact}\n{=(g.genshin):{g.genshinimpact}}\n\n{=(g.ashesofcreation):{pw(1)}~430261119374983168~Ashes of Creation}\n{=(g.ashes):{g.ashesofcreation}}\n{=(g.aoc):{g.ashesofcreation}}\n\n{=(g.friend):{pw(1)}~606667180817252352~Friend}\n\n{=(g.guest):~790751383467982918~Guest}\n\n{=(COMMENT):Keywords}\n{=(keywords):bdm~bu bless unleashed~eveechoes ee eve~newworld nw~ffxiv ff xiv final finalfantasy finalfantasyxiv~warframe wf~genshinimpact genshin~ashesofcreation ashes aoc~friend~guest}\n{=(kw):`{join(`, `):{replace(~,`~`):{keywords}}}`}\n\n{=(COMMENT):Right arrow emoji to display before each new group in the groups list.}\n{=(twr):<:twright:739824939124785174>}\n\n{=(COMMENT):ROLEID\nkeyword, keyword, keyword}\n{=(groups.list):{twr} <@&{g.bdm(2):~}>\n{kw(1):~}\n{twr} <@&{g.bu(2):~}>\n{kw(2):~}\n{twr} <@&{g.ee(2):~}>\n{kw(3):~}\n{twr} <@&{g.nw(2):~}>\n{kw(4):~}\n{twr} <@&{g.ff(2):~}>\n{kw(5):~}\n{twr} <@&{g.wf(2):~}>\n{kw(6):~}\n{twr} <@&{g.genshin(2):~}>\n{kw(7):~}\n{twr} <@&{g.ashes(2):~}>\n{kw(8):~}\n{twr} <@&{g.friend(2):~}>\n{kw(9):~}\n{twr} <@&{g.guest(2):~}>\n{kw(10):~}}\n\n{=(COMMENT):Re-defining the wrong keyword error message to include the groups list above.}\n{=(wrong.keyword.error):{wrong.keyword.error}\n\n{groups.list}}\n\n{=(COMMENT):Same as above but for the \"help\" header message.}\n{=(help.message):{help.message}\n\n{groups.list}}\n\n{=(COMMENT):Puts the data to return from the user input in separate variables for practicality.}\n{=(u.pw):{g.{l1}(1):~}}\n{=(u.role):{g.{l1}(2):~}}\n{=(u.name):{g.{l1}(3):~}}\n\n{=(COMMENT):Blank variable to do nothing if conditional behavior blocks evaluate to false.}\n{=():}\n\n{=(isHelp):{any({l1}==|{l1}==help):true|false}}\n{=(isPW):{if({l2}!=):true|false}}\n{=(isValidPW):{if({l2}=={u.pw}):true|false}}\n\n{=(isAlready):{contains({u.role}):{user(roleids)}}}\n\n{=(COMMENT):Checks if the user specified a valid keyword.}\n{=(isValidName):{in({l1}):{replace(~,):{keywords}}}}\n\n{=(COMMENT):Giving the role to the user if the password for the specified group was correct.}\n{{all({isValidPW}==true|{isAlready}==false):c:role add {user(id)} {u.role}}}\n{override} {silence} {delete}\n\n{=(COMMENT):Booleans for when the Community Managers' roles should be mentioned.}\n{=(shouldPing):{isHelp}==false|{isPW}==false|{l1}!=guest|{isValidName}==true}\n\n{=(roles.pings):{and({shouldPing}):<@&{join(> <@&):{roles.to.ping}}>}}\n{roles.pings}\n\n{=(COMMENT):Embed Output Management}\n{=(COMMENT):Embed Title, grabbed from the custom settings}\n{=(em.title):{embed.title}}\n\n{=(COMMENT):Embed description, conditional depending on all the conditional statements above.}\n{=(em.desc):{if({isAlready}==true):{already.group}|{if({isHelp}==true):{help.message}|{if({isValidName}==false):{wrong.keyword.error}|{replace(GROUP,{u.name}):{if({isValidPW}==true):{replace(ROLE,<@&{u.role}>):{success.message}}|{if({isPW}==false):{no.password.message}|{if({isValidPW}==false):{wrong.password.error}}}}}}}}}\n\n{=(COMMENT):Embed's footer. Returns the user ID if the request is pending/pinged the CMs, or the command's input instructions.}\n{=(em.footer):{and({shouldPing}==true):{user(id)}|{any({isHelp}==true|{isValidName}==false):{prefix}{tagname} [<keyword>|help] <password>}}}\n\n{=(COMMENT):Sets the embed's side color to the user color.\nActually nevermind, this got removed by Carl without notice.}\n{embed(color):{user(color)}}\n\n{=(COMMENT):That's the part that actually allows and replaces \"yes\" and \"no\" with their boolean equivalent.}\n{=(shouldDM):{replace(yes,true):{replace(no,false):{lower:{should.it.DM}}}}}\n{=(COMMENT):Conditionally DMs the user the success message (when they should get the role), depending on the user settings at the top of the command.}\n{{and({isValidPW}==true):{if({shouldDM}==true):dm}}}\n\n{=(COMMENT):Requiring the specified channel(s) and role(s) if any in the custom settings, as well as the custom error message.}\n{require({required.message}):{required.role}}",
  "embed": "{\"color\": 5198940, \"title\": \"{em.title}\", \"footer\": {\"text\": \"{em.footer}\"}, \"description\": \"{em.desc}\"}",
  "last_fetched": "2026-10-20T23:34:46.953Z"
}