How to write a Discord Role Reaction Bot in Python w/ Discord.py

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ธ.ค. 2024

ความคิดเห็น • 210

  • @drama_lvl1
    @drama_lvl1 ปีที่แล้ว +1

    Thanks for the video :)
    I'm glad it still works in 2023

  • @theminegineer6170
    @theminegineer6170 3 ปีที่แล้ว +2

    Thanks for the help, took me ages to find a good tutorial for this!

  • @OperatingTired
    @OperatingTired 2 ปีที่แล้ว +1

    Thanks for the amzing video! Helped a lot!

  • @swordgamers8344
    @swordgamers8344 5 ปีที่แล้ว +6

    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...

  • @KaptainRPG
    @KaptainRPG 4 ปีที่แล้ว +101

    Is everyone going to ignore how many bots he has in his server?

    • @jonnylpenman
      @jonnylpenman 4 ปีที่แล้ว

      Its just 15

    • @Zirzux
      @Zirzux 4 ปีที่แล้ว

      and its his tutorial bots..

    • @KaptainRPG
      @KaptainRPG 4 ปีที่แล้ว +4

      @@Zirzux Yeah okay smartass. Take a joke lmao

    • @N1ghtM0ntagna
      @N1ghtM0ntagna 4 ปีที่แล้ว +1

      it's the first thing that i noticed

    • @KaptainRPG
      @KaptainRPG 4 ปีที่แล้ว

      @@N1ghtM0ntagna Good for you..

  • @joshuam4011
    @joshuam4011 5 ปีที่แล้ว +9

    Love the tutorials especially the nodejs ones. Helps me out a lot. Ty :)

    • @ansonthedev
      @ansonthedev  5 ปีที่แล้ว +2

      :) Thank you for the feedback.

    • @aryagummadi4153
      @aryagummadi4153 4 ปีที่แล้ว

      @@ansonthedev The github link seems broken. Can you please fix it?

  • @user-jo6go1hd2b
    @user-jo6go1hd2b 4 ปีที่แล้ว +3

    12:40 you could just use **if member:** instead of **if member is not None:**

    • @yuugen2199
      @yuugen2199 3 ปีที่แล้ว +1

      if member: checks if member is True, not not None, It would be correct for if member is not False

  • @kaustubhdoval5552
    @kaustubhdoval5552 4 ปีที่แล้ว +8

    I am getting no warnings but just getting an error " Parameter 'payload' value is not used" what can be the cause of this?

    • @AbhigyanTrips
      @AbhigyanTrips 3 ปีที่แล้ว

      Well, either you didn't pass payload, or missed it in one of the variables assigned.

  • @Neoproxy_
    @Neoproxy_ 3 ปีที่แล้ว +9

    GUYS use member = await(await client.fetch_guild(payload.guild_id)).fetch_member(payload.user_id) it works better

    • @ervin7417
      @ervin7417 3 ปีที่แล้ว +1

      tysm

    • @Cdztw
      @Cdztw 2 ปีที่แล้ว +1

      Thanks for that, it solves my problem and works well!

    • @all0y_
      @all0y_ 2 ปีที่แล้ว +1

      QUE CARA FODA!

    • @OperatingTired
      @OperatingTired 2 ปีที่แล้ว +1

      Thank you!!! This solved my problem!

    • @davenavy9960
      @davenavy9960 2 ปีที่แล้ว +1

      what the hell thanks man, this is amazing! Why doesnt his code work for this?

  • @harlekiNN
    @harlekiNN 4 ปีที่แล้ว +1

    Helped me a lot. Works as intended. Thanks. :)

  • @aristology6912
    @aristology6912 4 ปีที่แล้ว +6

    For some reason my bot cannot find me, it keeps giving me the "Member not found" message, how do I fix this?

    • @WolfeWinters
      @WolfeWinters 4 ปีที่แล้ว +2

      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

    • @aristology6912
      @aristology6912 4 ปีที่แล้ว

      @@WolfeWinters thank you so much!!

    • @shawnthecreator1581
      @shawnthecreator1581 3 ปีที่แล้ว

      @@WolfeWinters Where would I insert this in the code?

    • @Spider2B
      @Spider2B 2 ปีที่แล้ว

      @@WolfeWinters this man saving lives, ty

  • @land23
    @land23 3 ปีที่แล้ว +2

    when i try to use the remove_roles function it says "AttributeError: 'NoneType' object has no attribute 'remove_roles'"

  • @SatooSatoshi
    @SatooSatoshi 3 ปีที่แล้ว +3

    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 :( !

    • @coolerzanu1202
      @coolerzanu1202 3 ปีที่แล้ว +1

      same

    • @coolerzanu1202
      @coolerzanu1202 3 ปีที่แล้ว +1

      any luck finding a solution?

    • @tonycipher5078
      @tonycipher5078 2 ปีที่แล้ว +1

      member = await(await client.fetch_guild(payload.guild_id)).fetch_member(payload.user_id)
      use this

    • @SatooSatoshi
      @SatooSatoshi 2 ปีที่แล้ว

      @@tonycipher5078 omgggggg tyy after A FUCKING YEAR i can finally do it

  • @zarkiber
    @zarkiber 4 ปีที่แล้ว +5

    it's not working for me occurs an error: "local variable 'role' referenced before assignment"
    pls help me

    • @zarkiber
      @zarkiber 4 ปีที่แล้ว

      I mean I just can't get the role
      I checked my bot's permission it's administrator so he can manage the roles

    • @devtimm
      @devtimm 4 ปีที่แล้ว

      Just put the bots role over the admin role

    • @zarkiber
      @zarkiber 4 ปีที่แล้ว

      thanks

    • @devtimm
      @devtimm 4 ปีที่แล้ว

      @@zarkiber no problem

    • @bepurrlno
      @bepurrlno 3 ปีที่แล้ว

      @Michael Benedict wdym?

  • @CrafteurZ
    @CrafteurZ 3 ปีที่แล้ว

    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 ?

  • @seldian
    @seldian 4 ปีที่แล้ว +3

    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.

    • @seldian
      @seldian 4 ปีที่แล้ว +1

      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.kochevnik
      @dev.kochevnik 3 ปีที่แล้ว

      @@seldian yeah i got the same problem, it can't find member through the payload

    • @spadelaspade3345
      @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

  • @ColliefarmerYT
    @ColliefarmerYT 11 หลายเดือนก่อน +1

    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

    • @zeral1317
      @zeral1317 8 หลายเดือนก่อน

      Thank you, this saved me a lot of time!

    • @ColliefarmerYT
      @ColliefarmerYT 8 หลายเดือนก่อน

      @@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

    • @zeral1317
      @zeral1317 8 หลายเดือนก่อน

      @@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

    • @ColliefarmerYT
      @ColliefarmerYT 8 หลายเดือนก่อน

      @@zeral1317 yeah bot if you somehow are coding for a very big server you shouldn't put it above owner and bot

  • @Gacut
    @Gacut 2 ปีที่แล้ว

    This is awesome! Thanks!

  • @coler7975
    @coler7975 4 ปีที่แล้ว +6

    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

    • @CrunchySpon
      @CrunchySpon ปีที่แล้ว

      yeeeees i want one too

  • @churchguy8325
    @churchguy8325 4 ปีที่แล้ว +1

    Help, my bot can only add roles but not remove them

  • @313xottic
    @313xottic 2 ปีที่แล้ว

    OMG thank you it worked

  • @CrunchySpon
    @CrunchySpon ปีที่แล้ว

    how do you make it so you can only select one role and not multiple of the same message

  • @scienceopolis390
    @scienceopolis390 2 ปีที่แล้ว +1

    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

  • @smallstoriesyoutube7366
    @smallstoriesyoutube7366 4 ปีที่แล้ว +2

    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

    • @corentinphilys2344
      @corentinphilys2344 4 ปีที่แล้ว

      guild = guild.member

    • @aristology6912
      @aristology6912 4 ปีที่แล้ว

      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.

  • @Cyrus_FG
    @Cyrus_FG 4 ปีที่แล้ว

    Worked fine, thanks

  • @jakecake51
    @jakecake51 4 ปีที่แล้ว +1

    Thank you sir. I subscribe.

  • @maniccFN
    @maniccFN 2 ปีที่แล้ว

    How do i give someone 2 roles with this?

  • @DylanTheSpud
    @DylanTheSpud 3 ปีที่แล้ว

    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 🤔

  • @Daiikino
    @Daiikino 3 ปีที่แล้ว +1

    2:16
    who else thought the sound came from their own computer?

  • @thepogplay9120
    @thepogplay9120 4 ปีที่แล้ว +2

    its says the role isnt found when the role is found

    • @kacperkierc9268
      @kacperkierc9268 4 ปีที่แล้ว

      did u found the resolution for this (having the same problem)

  • @Ransomwave
    @Ransomwave 4 ปีที่แล้ว +10

    Could you teach us how to do the same thing but with a command? For example: "!reactionrole (messageID) (@role) (emoji)"
    Thank you.

    • @BaroShirts
      @BaroShirts 4 ปีที่แล้ว

      @Ender777456 you forgot the argument of the emoji

    • @Ransomwave
      @Ransomwave 4 ปีที่แล้ว

      @@BaroShirts added it xd

    • @F8P
      @F8P 4 ปีที่แล้ว +2

      Wanting to know the exact same thing! Got any response or answer?

    • @Ransomwave
      @Ransomwave 4 ปีที่แล้ว +1

      @@F8P nope

    • @juditecavaca
      @juditecavaca 4 ปีที่แล้ว

      Change the names etc

  • @joshua.s255
    @joshua.s255 3 ปีที่แล้ว

    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?

  • @ahgpy
    @ahgpy 3 ปีที่แล้ว

    guys i need help
    in line 24
    it shows an error (find missing one positional argument: seq)

  • @bitterheat3415
    @bitterheat3415 3 ปีที่แล้ว

    What version of VSCode are you using?

  • @jhun-mali9970
    @jhun-mali9970 3 ปีที่แล้ว +1

    Keep getting this error :((. : UnboundLocalError: local variable 'discord' referenced before assignment

  • @followmaze
    @followmaze 3 ปีที่แล้ว

    love you!

  • @ROOTBEEROFF
    @ROOTBEEROFF 5 ปีที่แล้ว +3

    Dont work with the normal emoji

    • @ROOTBEEROFF
      @ROOTBEEROFF 5 ปีที่แล้ว

      Like :joy:

    • @ansonthedev
      @ansonthedev  5 ปีที่แล้ว

      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.

    • @ROOTBEEROFF
      @ROOTBEEROFF 5 ปีที่แล้ว

      @@ansonthedev I am doing something wrong?
      elif payload.emoji.name == 'joy':

    • @ansonthedev
      @ansonthedev  5 ปีที่แล้ว

      @@ROOTBEEROFF Please join my Discord server, it'll be much easier to help you that way. discord.gg/bZSwjPy

  • @Totema.
    @Totema. 3 ปีที่แล้ว

    I always have member not found ...

  • @akhon8452
    @akhon8452 5 ปีที่แล้ว +3

    hi man, could you possibly make a tutorial on how to host a java discord bot online 24/7 on site like heroku?

    • @ansonthedev
      @ansonthedev  5 ปีที่แล้ว +3

      Thanks for the suggestion! I'll definitely look into it.

    • @akhon8452
      @akhon8452 5 ปีที่แล้ว +1

      @@ansonthedev nice, i'm really looking forward it as I struggle immensly with trying to host my own bot online

    • @puddlee
      @puddlee 5 ปีที่แล้ว +1

      Not too hard really.

  • @dawned7197
    @dawned7197 4 ปีที่แล้ว

    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!

    • @technowizomc8275
      @technowizomc8275 4 ปีที่แล้ว +1

      You can change the token.. that's what he did lmao

    • @theminegineer6170
      @theminegineer6170 3 ปีที่แล้ว

      A common solution is to make it retrieve it from a .env file so that it stays safe and secure

  • @astiir4997
    @astiir4997 4 ปีที่แล้ว +1

    It just says "Member not found" for me

    • @GeorgeMC2610
      @GeorgeMC2610 4 ปีที่แล้ว

      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.

    • @Sortexx
      @Sortexx 4 ปีที่แล้ว

      @@GeorgeMC2610 did you found any fixes if yes pls dm me on discord TheMeliodas#2779

  • @zovusspamming8374
    @zovusspamming8374 4 ปีที่แล้ว

    awesome video

  • @steezybeatz._.7846
    @steezybeatz._.7846 3 ปีที่แล้ว

    when i run the code it has no errors but when i add a role it says i am missing permissions (error 50013)

    • @qipy7532
      @qipy7532 3 ปีที่แล้ว +1

      Same issue here
      upd
      I found a solution. You should check if ur bot role is higher then the role u want to give

  • @sigurdrolfsnes93
    @sigurdrolfsnes93 4 ปีที่แล้ว +1

    Can someone help. the remove_roles(role) doesnt work

    • @Neoproxy_
      @Neoproxy_ 3 ปีที่แล้ว +5

      use member = await(await client.fetch_guild(payload.guild_id)).fetch_member(payload.user_id)

    • @stevebesto2
      @stevebesto2 3 ปีที่แล้ว +2

      @@Neoproxy_ Thanks a lottt

  • @halfdan6549
    @halfdan6549 4 ปีที่แล้ว +5

    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 ?

    • @seldian
      @seldian 4 ปีที่แล้ว

      Same issue here

    • @sorenoneil3876
      @sorenoneil3876 4 ปีที่แล้ว

      @@seldian yeah

    • @marcorangel1997
      @marcorangel1997 3 ปีที่แล้ว

      yeah i got no clue on that, tryna figure it out rn

    • @sorenoneil3876
      @sorenoneil3876 3 ปีที่แล้ว

      Make sure if it's in a cog you passed in self everywhere you need it that was my issue

    • @marcorangel1997
      @marcorangel1997 3 ปีที่แล้ว +1

      @@sorenoneil3876 my solution was to add text to the message saying “if you’d like a role removed please message an admin” LMAO

  • @__CodiX__
    @__CodiX__ 3 ปีที่แล้ว

    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-carrot
      @ten-faced-carrot 3 ปีที่แล้ว

      Did you write @client.event() or @client.event
      ?

  • @anirvdh
    @anirvdh 4 ปีที่แล้ว +2

    it didnt work

  • @yonatanklein
    @yonatanklein 3 ปีที่แล้ว

    ty for the video

  • @monarcas5502
    @monarcas5502 4 ปีที่แล้ว

    You can do a function to get the role and user you want to add it

  • @thelonghairedcanadiangamer3919
    @thelonghairedcanadiangamer3919 3 ปีที่แล้ว

    its just straight up not working for me no errors nothing it just isnt assigning the role is this tutorial with rewrite or nah?

    • @thelonghairedcanadiangamer3919
      @thelonghairedcanadiangamer3919 3 ปีที่แล้ว

      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.')

  • @tengohamudi
    @tengohamudi 3 ปีที่แล้ว

    nice video but your voice is so funny lmao

  • @ebat3577
    @ebat3577 4 ปีที่แล้ว

    what did this error mean? emoji = PartialEmoji.with_state(self, animated=emoji_data['animated'], id=emoji_id, name=emoji_data['name'])
    KeyError: 'animated'

    • @keyboyice1976
      @keyboyice1976 4 ปีที่แล้ว

      Your emoji_data dictionary doesn't have a key named 'animated' in it.

  • @thepogplay9120
    @thepogplay9120 4 ปีที่แล้ว

    i cant remove roles its keeping saying member not found

    • @WolfeWinters
      @WolfeWinters 4 ปีที่แล้ว

      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

  • @wrenoryx
    @wrenoryx 4 ปีที่แล้ว

    AttributeError: 'RawReactionActionEvent' object has no attribute 'message'
    On the "message_id = payload.message.id" line

    • @zarkiber
      @zarkiber 4 ปีที่แล้ว +2

      It should be:
      message_id = payload.message_id

    • @aristology6912
      @aristology6912 4 ปีที่แล้ว +2

      @Zarkiber is right, whenever you get the "Attribute" Error message, it's because you put a "." instead of a "_".

  • @hgrend
    @hgrend 4 ปีที่แล้ว

    I have :
    role = discord.utils.get(guild.roles, name=payload.emoji.name)
    AttributeError: 'NoneType' object has no attribute 'roles'
    Can you help me ?

    • @anirvdh
      @anirvdh 4 ปีที่แล้ว

      you need to define guild
      i think its something like payload.guild.roles

  • @JR-ub2wt
    @JR-ub2wt 4 ปีที่แล้ว +1

    can someone tell me how to use this but with several message ids

    • @YTChernovx
      @YTChernovx 4 ปีที่แล้ว

      A messy way would just to make a different event for each message ID.

    • @JR-ub2wt
      @JR-ub2wt 4 ปีที่แล้ว +1

      Czar.J that’s what I’m trying to avoid lmao

    • @YTChernovx
      @YTChernovx 4 ปีที่แล้ว

      @@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-ub2wt
      @JR-ub2wt 4 ปีที่แล้ว

      Czar.J you could also just use administrator for people you want to use the roles instead of specific role perms

    • @WolfeWinters
      @WolfeWinters 4 ปีที่แล้ว

      @@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

  • @l3al3ackrad85
    @l3al3ackrad85 3 ปีที่แล้ว

    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

    • @mrtomblue0
      @mrtomblue0 3 ปีที่แล้ว

      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 (:

  • @noasymons-lindschouw
    @noasymons-lindschouw 2 ปีที่แล้ว

    mine didn´t work

  • @SmonHD
    @SmonHD 3 ปีที่แล้ว

    Ehm "Member not Found" why?

    • @tonycipher5078
      @tonycipher5078 2 ปีที่แล้ว

      member = await(await client.fetch_guild(payload.guild_id)).fetch_member(payload.user_id)
      use this

  • @sigurdrolfsnes93
    @sigurdrolfsnes93 4 ปีที่แล้ว

    How do you use intents in this code can someone plz help

    • @_orca1057
      @_orca1057 4 ปีที่แล้ว

      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)

  • @namon2287
    @namon2287 3 ปีที่แล้ว

    where is a link to github

  • @mk9834
    @mk9834 5 ปีที่แล้ว

    Thanks so much!

  • @hussenalsaigh3155
    @hussenalsaigh3155 3 ปีที่แล้ว

    can you give the command

  • @mrgamesoflive4k
    @mrgamesoflive4k 2 ปีที่แล้ว

    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

  • @Totema.
    @Totema. 4 ปีที่แล้ว

    How do i have to do if i want to use discord emojis, not mine

    • @anirvdh
      @anirvdh 4 ปีที่แล้ว +1

      do a backslash behind the emojis

    • @Totema.
      @Totema. 4 ปีที่แล้ว

      @@anirvdh thanks

    • @anirvdh
      @anirvdh 4 ปีที่แล้ว +1

      @@Totema. omg you are still here ok well np

    • @joshua.s255
      @joshua.s255 3 ปีที่แล้ว

      @@anirvdh could you explain?

    • @anirvdh
      @anirvdh 3 ปีที่แล้ว

      @@joshua.s255 \:emoji_name:

  • @adianarchived
    @adianarchived ปีที่แล้ว

    source code?

  • @gewoonsandor9182
    @gewoonsandor9182 4 ปีที่แล้ว

    why does it say member is None type

    • @dea2215
      @dea2215 4 ปีที่แล้ว

      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

    • @WolfeWinters
      @WolfeWinters 4 ปีที่แล้ว +1

      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

  • @ryeen0284
    @ryeen0284 4 ปีที่แล้ว

    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

  • @cpasneedles
    @cpasneedles 4 ปีที่แล้ว

    How to add several messages?

    • @JR-ub2wt
      @JR-ub2wt 4 ปีที่แล้ว

      @@passi2437 where exaclty??

    • @Sortexx
      @Sortexx 4 ปีที่แล้ว

      you can just put a comma after the first message id and then another message id

  • @kwilk1984
    @kwilk1984 4 ปีที่แล้ว

    Where's the link to GitHub?

    • @aristology6912
      @aristology6912 4 ปีที่แล้ว

      In the description idiot

    • @siddhantpatel3599
      @siddhantpatel3599 4 ปีที่แล้ว

      @@aristology6912 u don’t have to get mad at that

    • @churchguy8325
      @churchguy8325 4 ปีที่แล้ว

      @@aristology6912 theres nothing on the description

  • @Spiri2
    @Spiri2 4 ปีที่แล้ว

    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”

    • @innuenzeus
      @innuenzeus 4 ปีที่แล้ว

      The error means that you referenced guild after the guild code ran.

  • @JaredVititoe
    @JaredVititoe 4 ปีที่แล้ว

    You are a god! Thank you.

  • @critcore736
    @critcore736 4 ปีที่แล้ว

    lifesaver c:

  • @Daniel-tm9cg
    @Daniel-tm9cg 4 ปีที่แล้ว

    Does anyone know the theme

    • @Sortexx
      @Sortexx 4 ปีที่แล้ว

      *hyper i hyper-material-theme* thats the theme from the hyper command promt if you want it

  • @deramazone276
    @deramazone276 4 ปีที่แล้ว

    Are this still working ?

    • @jh1an394
      @jh1an394 4 ปีที่แล้ว

      @Mango outdated or something

    • @Acrissmester
      @Acrissmester 4 ปีที่แล้ว

      @@jh1an394 not working.

    • @vincent-thomas
      @vincent-thomas 3 ปีที่แล้ว

      @@Acrissmester not working

  • @ha1fdan
    @ha1fdan 4 ปีที่แล้ว +7

    Github not working! ;D

  • @acampinglamp
    @acampinglamp 3 ปีที่แล้ว

    You have #0001 as your tag? Just how OG are you?

  • @ArtemKovalchukl
    @ArtemKovalchukl 4 ปีที่แล้ว

    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

    • @ArtemKovalchukl
      @ArtemKovalchukl 4 ปีที่แล้ว +1

      solution is add new discord api intents
      intents = discord.Intents.all()
      bot = commands.Bot(command_prefix=settings['prefix'], intents=intents)

  • @870.wiktor7
    @870.wiktor7 3 ปีที่แล้ว

    Please use node.js

    • @ansonthedev
      @ansonthedev  3 ปีที่แล้ว

      I have the same tutorial on my channel using Discord.js & Node.

  • @brownboyfriesrice
    @brownboyfriesrice 3 ปีที่แล้ว

    I keep getting Role Not Found. Please help

  • @antonkortial4635
    @antonkortial4635 4 ปีที่แล้ว

    and this is oudated now ! yes !!

    • @ansonthedev
      @ansonthedev  4 ปีที่แล้ว +2

      nope

    • @antonkortial4635
      @antonkortial4635 4 ปีที่แล้ว

      @@ansonthedev I tried today
      it told me that "guild_id" is not a part of "Member" class

    • @heymissbelle
      @heymissbelle 4 ปีที่แล้ว +3

      @@antonkortial4635 You probably mistyped, the code works fine. I coded it up today and everything works

    • @siddhantpatel3599
      @siddhantpatel3599 4 ปีที่แล้ว

      @@ansonthedev it doesn’t work now without intents, RIP

  • @didlex1064
    @didlex1064 3 ปีที่แล้ว

  • @ugulsen6216
    @ugulsen6216 3 ปีที่แล้ว

    is noone gonna speak about how much hes voice cracks

  • @f0rSee
    @f0rSee 3 ปีที่แล้ว +1

    Thanks a lot!

  • @bluescreenedcanedit
    @bluescreenedcanedit 2 ปีที่แล้ว

    I keep getting member not found when running this.

  • @nitsugama4429
    @nitsugama4429 3 ปีที่แล้ว

    Im getting "Role not found" could u help me?