Checking roles of user in server from their dm message
i want to check if a user dms and also has a role in the server
i tried this first but then realised if its in a dm you have no roles, is there a way around this?
this bot will only be used in one server
47 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.the bot dms them when they get the role and then i want the reply to change their nickname and remove the role if they have it
Tag suggestion for @fxkitt:
Despite sounding similar there is a distinct difference between users and members in Discord:
• User: global Discord user data (global avatar, username, tag, id)
• GuildMember: user data associated to a guild (guild, nickname, roles, voice, guild avatar, etc.)
• Conversion: User ➞ GuildMember | GuildMember ➞ User
@Deleted User i cant actually use these links
got the url up there but it just takes me to that
and then clicking docs takes me to a page where i cant search anything
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
how would
guild.members.fetch(author.id)
know which guild to check
its only in one server tho so will it just check the one its in?
or do i need to set a variableUnknown User•2y ago
Message Not Public
Sign In & Join Server To View
so i need to do
guild = client.guilds.cache.get('guild id')
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
awesome ty
sumn like this work?
didnt work
hmm
oh
message.author
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
think theres an issue here
as this doesnt work
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
this is an issue before doing fetch tho
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
isnt working
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
oh didnt see that sorry
ill try that
oh wait no
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
ive done that
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
1
got it to work
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
did that
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
idk how that works
but
it did ig
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
thats what im thinking rn
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
oh
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
that right?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
ohh
before guild?
do i also need to put ; at end of each line in if statements?
i dont think i did that either
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
is discord py hard to set up
i realised after getting discord js that theres a python version
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
im very experienced with python so that might be smarter