Thanks for the video :) I'm glad it still works in 2023
@theminegineer61703 жыл бұрын
Thanks for the help, took me ages to find a good tutorial for this!
@kaustubhdoval55524 жыл бұрын
I am getting no warnings but just getting an error " Parameter 'payload' value is not used" what can be the cause of this?
@AbhigyanTrips3 жыл бұрын
Well, either you didn't pass payload, or missed it in one of the variables assigned.
@swordgamers83445 жыл бұрын
can someone tell me how I can show back or print the number of members of a role?... I've been looking around but almost everything is either too complicated or out-dated...
@aristology69124 жыл бұрын
For some reason my bot cannot find me, it keeps giving me the "Member not found" message, how do I fix this?
@WolfeWinters4 жыл бұрын
By default bots can't see everyone in guild.members, only themselves. You will want to use Intents to fix this intents = discord.Intents.all() client = discord.Client(intents=intents) You will also need to enable it on the discord application page for your bot, you will get an error starting the bot otherwise. Once that is done, the code he wrote in the video should work. See here for additional details: stackoverflow.com/questions/64148371/discord-bot-can-only-see-itself-and-no-other-users-in-guild
@aristology69124 жыл бұрын
@@WolfeWinters thank you so much!!
@shawnthecreator15813 жыл бұрын
@@WolfeWinters Where would I insert this in the code?
@Spider2B2 жыл бұрын
@@WolfeWinters this man saving lives, ty
@OperatingTired2 жыл бұрын
Thanks for the amzing video! Helped a lot!
@harlekiNN4 жыл бұрын
Helped me a lot. Works as intended. Thanks. :)
@CrafteurZ3 жыл бұрын
Hello i neeed help i'm lost at 11:21 "if role is not None : print(role.name)" With me, the program don't run with that I don't get the answer when i put an emoji reaction Can anybody help me ?
@SatooSatoshi3 жыл бұрын
for me it work perfectly for the on_raw_reaction_add but not for the on_raw_reaction remove, it give me "member not found" help please :( !
@coolerzanu12023 жыл бұрын
same
@coolerzanu12023 жыл бұрын
any luck finding a solution?
@tonycipher50782 жыл бұрын
member = await(await client.fetch_guild(payload.guild_id)).fetch_member(payload.user_id) use this
@SatooSatoshi2 жыл бұрын
@@tonycipher5078 omgggggg tyy after A FUCKING YEAR i can finally do it
@land233 жыл бұрын
when i try to use the remove_roles function it says "AttributeError: 'NoneType' object has no attribute 'remove_roles'"
@joshuam40115 жыл бұрын
Love the tutorials especially the nodejs ones. Helps me out a lot. Ty :)
@ansonthedev5 жыл бұрын
:) Thank you for the feedback.
@aryagummadi41534 жыл бұрын
@@ansonthedev The github link seems broken. Can you please fix it?
@zarkiber4 жыл бұрын
it's not working for me occurs an error: "local variable 'role' referenced before assignment" pls help me
@zarkiber4 жыл бұрын
I mean I just can't get the role I checked my bot's permission it's administrator so he can manage the roles
@devtimm4 жыл бұрын
Just put the bots role over the admin role
@zarkiber4 жыл бұрын
thanks
@devtimm4 жыл бұрын
@@zarkiber no problem
@bepurrlno3 жыл бұрын
@Michael Benedict wdym?
@seldian4 жыл бұрын
I may be wrong here, maybe not. I found though that this didnt work with built in emojis. I had to use custom ones added to the server. Side note, did anyone have issues with it not removing roles? I copy/pasted and changed it to member.remove_roles but to no effect.
@seldian4 жыл бұрын
Another note. Not sure how his remove works, but from what I read myself and others ran into an issue where adding roles worked but not removal. From what I can see, documentation says the remove function doesn't pass in a 'member' object with the payload. I think there are some work around but that's likely beyond me.
@dev.kochevnik3 жыл бұрын
@@seldian yeah i got the same problem, it can't find member through the payload
@spadelaspade3345 Жыл бұрын
to do it with the build in emojis is weird. what you want to do is in the on_raw_reaction_add function, add a line that says print(payload.emoji.name). if you react to the message with the built in emoji's, the output should give you the emoji you could copy and paste into the function
@CrunchySpon2 жыл бұрын
how do you make it so you can only select one role and not multiple of the same message
@churchguy83254 жыл бұрын
Help, my bot can only add roles but not remove them
@ColliefarmerYT Жыл бұрын
by the way if you have probelms with adding roles go to server settings, roles and drag the bot role at the top but below the owner rank if you have one
@zeral131710 ай бұрын
Thank you, this saved me a lot of time!
@ColliefarmerYT10 ай бұрын
@@zeral1317 actually nevermind you need to put it on the top of the highest role of the options of the bot NOT OVER THE OWNER Sorry for miscommunication
@zeral131710 ай бұрын
@@ColliefarmerYT I believe that you don’t need an owner role since the user who owns the server has all the permissions even without any roles anyway
@ColliefarmerYT10 ай бұрын
@@zeral1317 yeah bot if you somehow are coding for a very big server you shouldn't put it above owner and bot
@DylanTheSpud3 жыл бұрын
I've followed the thing using the if statement if the names are different, but it only seems to work with one of the roles I've done this for. Strange 🤔
@KaptainRPG4 жыл бұрын
Is everyone going to ignore how many bots he has in his server?
@jonnylpenman4 жыл бұрын
Its just 15
@Zirzux4 жыл бұрын
and its his tutorial bots..
@KaptainRPG4 жыл бұрын
@@Zirzux Yeah okay smartass. Take a joke lmao
@N1ghtM0ntagna4 жыл бұрын
it's the first thing that i noticed
@KaptainRPG4 жыл бұрын
@@N1ghtM0ntagna Good for you..
@maniccFN2 жыл бұрын
How do i give someone 2 roles with this?
@thepogplay91204 жыл бұрын
its says the role isnt found when the role is found
@kacperkierc92684 жыл бұрын
did u found the resolution for this (having the same problem)
@smallstoriesyoutube73665 жыл бұрын
I keep getting guild references before assignment errors on discord.utils.get(guild.roles, name=payload.emoji.name) UnboundLocalError: Local Variable ‘guild’ referrenced before assignment
@corentinphilys23445 жыл бұрын
guild = guild.member
@aristology69124 жыл бұрын
You're reacting to the wrong message. The if statement defines the variable "guild" *if* the message id is whatever you put there. If the message id *is not* that, then the variable won't get defined.
@coler79754 жыл бұрын
it would be cool if you can do more of a video where you can make your own so you don't have to keep coding it when you want a new one
@CrunchySpon2 жыл бұрын
yeeeees i want one too
@ahgpy3 жыл бұрын
guys i need help in line 24 it shows an error (find missing one positional argument: seq)
@sigurdrolfsnes934 жыл бұрын
Can someone help. the remove_roles(role) doesnt work
@Neoproxy_3 жыл бұрын
use member = await(await client.fetch_guild(payload.guild_id)).fetch_member(payload.user_id)
@stevebesto23 жыл бұрын
@@Neoproxy_ Thanks a lottt
@joshua.s2554 жыл бұрын
In this video he uses custom emotes and when I try to use default emotes it does not work is there a work around for that?
@Gacut2 жыл бұрын
This is awesome! Thanks!
@scienceopolis3902 жыл бұрын
Hey this is very helpful... but I want to know how to make reaction role or level up message or join or leave server message configured by the user... using a website...like we do in MEE6 or Carl or Dyno
@noasymons-lindschouw2 жыл бұрын
mine didn´t work
@steezybeatz._.78463 жыл бұрын
when i run the code it has no errors but when i add a role it says i am missing permissions (error 50013)
@qipy75323 жыл бұрын
Same issue here upd I found a solution. You should check if ur bot role is higher then the role u want to give
@astiir49974 жыл бұрын
It just says "Member not found" for me
@GeorgeMC26104 жыл бұрын
Apparently, when you remove the reaction, it doesn't track you as a member. The only valid way to track the member, is using payload.user_id.
@myjules4 жыл бұрын
@@GeorgeMC2610 did you found any fixes if yes pls dm me on discord TheMeliodas#2779
@jhun-mali99703 жыл бұрын
Keep getting this error :((. : UnboundLocalError: local variable 'discord' referenced before assignment
@halfdan65494 жыл бұрын
It works perfectly to add a role when I replace member = discord.utils.find(lambda m : m.id == payload.user_id, guild.members) by member = payload.member. BUT when I copy-paste the code for remove the role, it don't work. He find the member for adding a role but he says "Member not found" when he try to remove a role. Can someone help me ?
@seldian4 жыл бұрын
Same issue here
@sorenoneil38764 жыл бұрын
@@seldian yeah
@marcorangel19974 жыл бұрын
yeah i got no clue on that, tryna figure it out rn
@sorenoneil38764 жыл бұрын
Make sure if it's in a cog you passed in self everywhere you need it that was my issue
@marcorangel19974 жыл бұрын
@@sorenoneil3876 my solution was to add text to the message saying “if you’d like a role removed please message an admin” LMAO
@Totema.4 жыл бұрын
I always have member not found ...
@Cyrus_FG4 жыл бұрын
Worked fine, thanks
@ROOTBEEROFF5 жыл бұрын
Dont work with the normal emoji
@ROOTBEEROFF5 жыл бұрын
Like :joy:
@ansonthedev5 жыл бұрын
ROOT BEER it should work with normal emojis, they don’t have an ID so you’d have to just include the emoji name with colons in between.
@ROOTBEEROFF5 жыл бұрын
@@ansonthedev I am doing something wrong? elif payload.emoji.name == 'joy':
@ansonthedev5 жыл бұрын
@@ROOTBEEROFF Please join my Discord server, it'll be much easier to help you that way. discord.gg/bZSwjPy
@user-jo6go1hd2b4 жыл бұрын
12:40 you could just use **if member:** instead of **if member is not None:**
@yuugen21993 жыл бұрын
if member: checks if member is True, not not None, It would be correct for if member is not False
@__CodiX__4 жыл бұрын
I got a problem too, if i do @client.event he tells me that a coroutine is not given but i thought on_raw_reaction_add is the coro
@ten-faced-carrot3 жыл бұрын
Did you write @client.event() or @client.event ?
@JR-ub2wt4 жыл бұрын
can someone tell me how to use this but with several message ids
@YTChernovx4 жыл бұрын
A messy way would just to make a different event for each message ID.
@JR-ub2wt4 жыл бұрын
Czar.J that’s what I’m trying to avoid lmao
@YTChernovx4 жыл бұрын
@@JR-ub2wt rip homie. I just spent the last hour trying to figure out why my bot didn't have the right perms to assign roles before I realized the chronological order of the roles actually affects the permissions hierarchy. What a mundane yet important detail.
@JR-ub2wt4 жыл бұрын
Czar.J you could also just use administrator for people you want to use the roles instead of specific role perms
@WolfeWinters4 жыл бұрын
@@JR-ub2wt You could make a list of IDs and check if the payload message_id is in that list using something like if id in list: where id is the payload's message_id and list is the list of allowed IDs
@anirvdh4 жыл бұрын
it didnt work
@313xottic2 жыл бұрын
OMG thank you it worked
@thelonghairedcanadiangamer39194 жыл бұрын
its just straight up not working for me no errors nothing it just isnt assigning the role is this tutorial with rewrite or nah?
@thelonghairedcanadiangamer39194 жыл бұрын
here is my code @client.event async def on_raw_reaction_add(payload): message_id = payload.message_id if message_id == "798520336039149578": guild_id = payload.guild_id guild = discord.utils.find(lambda g : g.id == guild_id, client.guilds) role = discord.utils.get(guild.roles, name=payload.emoji.name) if role: member = discord.utils.find(lambda m : m.id == payload.user_id, guild.members) if member: await member.add_role(role) print('done') else: print('Member not found.') else: print('Role not found.')
@thepogplay91204 жыл бұрын
i cant remove roles its keeping saying member not found
@WolfeWinters4 жыл бұрын
By default bots can't see everyone in guild.members, only themselves. You will want to use Intents to fix this intents = discord.Intents.all() client = discord.Client(intents=intents) You will also need to enable it on the discord application page for your bot, you will get an error starting the bot otherwise. Once that is done, the code he wrote in the video should work. See here for additional details: stackoverflow.com/questions/64148371/discord-bot-can-only-see-itself-and-no-other-users-in-guild
@akhon84525 жыл бұрын
hi man, could you possibly make a tutorial on how to host a java discord bot online 24/7 on site like heroku?
@ansonthedev5 жыл бұрын
Thanks for the suggestion! I'll definitely look into it.
@akhon84525 жыл бұрын
@@ansonthedev nice, i'm really looking forward it as I struggle immensly with trying to host my own bot online
@puddlee5 жыл бұрын
Not too hard really.
@Ransomwave24 жыл бұрын
Could you teach us how to do the same thing but with a command? For example: "!reactionrole (messageID) (@role) (emoji)" Thank you.
@BaroShirts4 жыл бұрын
@Ender777456 you forgot the argument of the emoji
@Ransomwave24 жыл бұрын
@@BaroShirts added it xd
@F8P4 жыл бұрын
Wanting to know the exact same thing! Got any response or answer?
@Ransomwave24 жыл бұрын
@@F8P nope
@juditecavaca4 жыл бұрын
Change the names etc
@sigurdrolfsnes934 жыл бұрын
How do you use intents in this code can someone plz help
@_orca10574 жыл бұрын
Just add intents in the beginning of your code and the rest should be good intents = discord.Intents.default() intents.members = True client = commands.Bot(command_prefix="{bot_prefix}", intents=intents)
@Daiikino3 жыл бұрын
2:16 who else thought the sound came from their own computer?
@jakecake514 жыл бұрын
Thank you sir. I subscribe.
@hgrend4 жыл бұрын
I have : role = discord.utils.get(guild.roles, name=payload.emoji.name) AttributeError: 'NoneType' object has no attribute 'roles' Can you help me ?
@anirvdh4 жыл бұрын
you need to define guild i think its something like payload.guild.roles
@wrenoryx4 жыл бұрын
AttributeError: 'RawReactionActionEvent' object has no attribute 'message' On the "message_id = payload.message.id" line
@zarkiber4 жыл бұрын
It should be: message_id = payload.message_id
@aristology69124 жыл бұрын
@Zarkiber is right, whenever you get the "Attribute" Error message, it's because you put a "." instead of a "_".
@monarcas55024 жыл бұрын
You can do a function to get the role and user you want to add it
@SmonHD3 жыл бұрын
Ehm "Member not Found" why?
@tonycipher50782 жыл бұрын
member = await(await client.fetch_guild(payload.guild_id)).fetch_member(payload.user_id) use this
@ebat35775 жыл бұрын
what did this error mean? emoji = PartialEmoji.with_state(self, animated=emoji_data['animated'], id=emoji_id, name=emoji_data['name']) KeyError: 'animated'
@keyboyice19764 жыл бұрын
Your emoji_data dictionary doesn't have a key named 'animated' in it.
@bitterheat34153 жыл бұрын
What version of VSCode are you using?
@Spiri2rr4 жыл бұрын
So reacting works. My terminal is spitting out this error over and over.. role = discord.utils.get(guild.roles, name = payload.emoji.name) Unboundlocalerror: local variable ‘guild’ referenced before assignment I’ve looked through the comments and tried everything I could find here. Yes, I have intents in the code and enabled in my dev portal. Again, I react and I get the role so it appears to work, but the error just keeps coming up. As for un reacting it doesn’t work. Nothing happens. Had an error say “member not found”
@innuenzeus4 жыл бұрын
The error means that you referenced guild after the guild code ran.
@gewoonsandor91824 жыл бұрын
why does it say member is None type
@dea22154 жыл бұрын
Hey, the code here is a bit outdated. I found the solution. Instead of member = discord.utils.find(lambda m : m.id == payload.user_id, guild.members) use member = payload.member
@WolfeWinters4 жыл бұрын
The above comment will work for adding a role, but to remove the role you will want this: intents = discord.Intents.all() client = discord.Client(intents=intents) You will also need to enable it on the discord application page for your bot, you will get an error starting the bot otherwise. Once that is done, the code he wrote in the video should work. See here for additional details: stackoverflow.com/questions/64148371/discord-bot-can-only-see-itself-and-no-other-users-in-guild
@Totema.4 жыл бұрын
How do i have to do if i want to use discord emojis, not mine
@anirvdh4 жыл бұрын
do a backslash behind the emojis
@Totema.4 жыл бұрын
@@anirvdh thanks
@anirvdh4 жыл бұрын
@@Totema. omg you are still here ok well np
@joshua.s2554 жыл бұрын
@@anirvdh could you explain?
@anirvdh4 жыл бұрын
@@joshua.s255 \:emoji_name:
@tengohamudi3 жыл бұрын
nice video but your voice is so funny lmao
@l3al3ackrad853 жыл бұрын
hi at first let me tnx for your great tutorials but i have a problem when i add reactions i get this error role not found i joined ur server but i diding get help that would be kind of u if you help please
@mrtomblue03 жыл бұрын
by the way, yah code from like a year a go is gonna be a little outdated :/ i also have an error and od so whenever i check out anything that old. but yeah and good luck (:
@hussenalsaigh31554 жыл бұрын
can you give the command
@adianarchived Жыл бұрын
source code?
@ryeen02844 жыл бұрын
what if you want this to work with more than one person?? the on_raw_reaction_add only works when a reaction is added not the 2nd..... time that same reaction is used
@peach_ow80204 жыл бұрын
Not true.
@dawned71974 жыл бұрын
ayyy thanks for the video but u probably shouldn't have revealed the tocken I mean anyone could see it in ur code but hey thanks for the video I was able to improve my friend's server with the bot I made for his server and everyone was able to get the role I wanted them to!
@technowizomc82754 жыл бұрын
You can change the token.. that's what he did lmao
@theminegineer61703 жыл бұрын
A common solution is to make it retrieve it from a .env file so that it stays safe and secure
@namon22873 жыл бұрын
where is a link to github
@Daniel-tm9cg4 жыл бұрын
Does anyone know the theme
@myjules4 жыл бұрын
*hyper i hyper-material-theme* thats the theme from the hyper command promt if you want it
@mrgamesoflive4k2 жыл бұрын
can someone please upload that code somerwhere so i can download it, my code wont work and i didnt know whats the issue. if i join the discord server from the video maker, i cant write in ANY channel and the mod isn responding. Its a Cool video and it helped me out for real
@followmaze3 жыл бұрын
love you!
@Neoproxy_3 жыл бұрын
GUYS use member = await(await client.fetch_guild(payload.guild_id)).fetch_member(payload.user_id) it works better
@ervin74173 жыл бұрын
tysm
@Cdztw3 жыл бұрын
Thanks for that, it solves my problem and works well!
@all0y_3 жыл бұрын
QUE CARA FODA!
@OperatingTired2 жыл бұрын
Thank you!!! This solved my problem!
@CriticalCurves2 жыл бұрын
what the hell thanks man, this is amazing! Why doesnt his code work for this?
@mk98345 жыл бұрын
Thanks so much!
@cpasneedles4 жыл бұрын
How to add several messages?
@JR-ub2wt4 жыл бұрын
@@passi2437 where exaclty??
@myjules4 жыл бұрын
you can just put a comma after the first message id and then another message id
@yonatanklein3 жыл бұрын
ty for the video
@deramazone2764 жыл бұрын
Are this still working ?
@jh1an3944 жыл бұрын
@Mango outdated or something
@Acrissmester4 жыл бұрын
@@jh1an394 not working.
@vincent-thomas4 жыл бұрын
@@Acrissmester not working
@kwilk19844 жыл бұрын
Where's the link to GitHub?
@aristology69124 жыл бұрын
In the description idiot
@siddhantpatel35994 жыл бұрын
@@aristology6912 u don’t have to get mad at that
@churchguy83254 жыл бұрын
@@aristology6912 theres nothing on the description
@zovusspamming83744 жыл бұрын
awesome video
@ha1fdan4 жыл бұрын
Github not working! ;D
@senkusbizarreadventure4944 жыл бұрын
True it show us a 404 error
@senkusbizarreadventure4944 жыл бұрын
True it show us a 404 error
@brownboyfriesrice3 жыл бұрын
I keep getting Role Not Found. Please help
@SamuelCukas3 жыл бұрын
too dont know
@ArtemKovalchukl4 жыл бұрын
Autor thx for tutorial, i work in cogs and have this porblem > all work fine but bot cant find guild member and i have this print "Member not found." can you give me answer what is happen? thx alot
@ArtemKovalchukl4 жыл бұрын
solution is add new discord api intents intents = discord.Intents.all() bot = commands.Bot(command_prefix=settings['prefix'], intents=intents)
@acampinglamp3 жыл бұрын
You have #0001 as your tag? Just how OG are you?
@dev.kochevnik3 жыл бұрын
its nitro lmao
@870.wiktor74 жыл бұрын
Please use node.js
@ansonthedev4 жыл бұрын
I have the same tutorial on my channel using Discord.js & Node.
@JaredVititoe4 жыл бұрын
You are a god! Thank you.
@critcore7364 жыл бұрын
lifesaver c:
@didlex10643 жыл бұрын
@antonkortial46354 жыл бұрын
and this is oudated now ! yes !!
@ansonthedev4 жыл бұрын
nope
@antonkortial46354 жыл бұрын
@@ansonthedev I tried today it told me that "guild_id" is not a part of "Member" class
@heymissbelle4 жыл бұрын
@@antonkortial4635 You probably mistyped, the code works fine. I coded it up today and everything works
@siddhantpatel35994 жыл бұрын
@@ansonthedev it doesn’t work now without intents, RIP
@ugulsen62163 жыл бұрын
is noone gonna speak about how much hes voice cracks
@bluescreenedcanedit2 жыл бұрын
I keep getting member not found when running this.