Okay so I was wondering if anyone knew how I'd go about having a bot select a channel. I'm creating a multi-server bot for discord, and was wondering how I'd go about with selecting a role/channel with a command. For example, I have this code that auto roles members:
client.on("guildMemberAdd", member => {
//Change "RoleName" tto the role yoou want to give them
var role = member.guild.roles.find ("name", "RoleName")
member.addRole (role)
if (role = null)
return;
})
Now, obviously not every server is going to have their member role as, "RoleName," so what I was wondering is, how would I make the bot choose the role they wish to be given to new members with a command. So if they were to do: "cb!autorole set Member" it would then make that role be what they automatically give new members, but if someone in a different server did "cb!autorole set Newbie" it would make it that servers auto role, withoout changing or adding a different servers autorole.
And same with channels. Example: "cb!welcome set #welcome" it'd set that servers welcome message channel, without changing or adding a different servers selected channel.
I'd also like to know how to unset them as well. Example: "cb!unset welcome" and "cb!unset autorole" and of course it'd only unset that server's stuff.
If it's too long to explain but you know a link, please do share it with me.
I'm sorry if this is confusing, if you have any questions on what I mean just comment. I'm new to coding and such so I probably got some of the terminology wrong.
Thank you for taking the time to read this.