I am trying to set a custom Emoji as my bot presence. However, I get this error.
AttributeError: 'str' object has no attribute 'get'
How could I fix this?
import discord
from discord.ext import commands
intents = discord.Intents.default()
intents.members = True
Bot = commands.Bot(command_prefix="&", intents=intents)
@Bot.event
async def on_ready():
await Bot.change_presence(activity=discord.Activity(type=4, emoji="", name="hello")) # The error is related to this line
print("ready!")
Bot.run(TOKEN)
Ignoring exception in on_ready
Traceback (most recent call last):
File "E:\projects\Virtual Environment\discord-bot\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "E:\projects\discord-bot\base.py", line 114, in on_ready
await Bot.change_presence(activity=discord.Activity(type=4, emoji="", name="hello"))
File "E:\projects\Virtual Environment\discord-bot\lib\site-packages\discord\activity.py", line 193, in __init__
self.emoji = PartialEmoji.from_dict(emoji)
File "E:\projects\Virtual Environment\discord-bot\lib\site-packages\discord\partial_emoji.py", line 83, in from_dict
animated=data.get('animated', False),
AttributeError: 'str' object has no attribute 'get'