Search code examples
discorddiscord.pybots

AttributeError: 'Client' object has no attribute 'get_all_emojis'


from distutils.util import change_root
from discord.utils import get
import discord
import random
import shutil

client = discord.Client()

@client.event
async def on_ready():
    print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
    channel = client.get_channel(968268255804420096)
    emoji = await discord.utils.get(client.get_all_emojis(), name='upvote')
    await client.add_reaction(message, emoji)
        

i'm trying to make a bot react to all messages in a specific channel, but i keep getting the "AttributeError: 'Client' object has no attribute 'get_all_emojis'" error any help?


Solution

  • This no longer works because get_all_emojis was removed a long time ago. Instead, use client.emojis.

    emoji = discord.utils.get(client.emojis, name='upvote')