How make custom status discord.py

26,774

Solution 1

I'm late to the party, WayToDoor is right, bots can't use custom status, I found that they "can use it" but it's invisible except bots can see it's a custom status and you will see "custom status" on the bot profile.

There is Playing, Watching, Listening to, and Streaming available for the bots no problem

You also now have an option to use "Competing in" too, which has type 5. I can't see it on the docs yet so I'm assuming it's not implemented yet.

#this is how "Competing in" is set.
discord.Activity(name="Test", type=5)

this should work.

Solution 2

Bots cannot use custom statuses yet. Use Playing or Watching instead. See https://github.com/Rapptz/discord.py/issues/2400

Solution 3

try these:

# Setting `Playing ` status
await bot.change_presence(activity=discord.Game(name="a game"))

# Setting `Streaming ` status
await bot.change_presence(activity=discord.Streaming(name="My Stream", url=my_twitch_url))

# Setting `Listening ` status
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="a song"))

# Setting `Watching ` status
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="a movie"))
Share:
26,774

Related videos on Youtube

loncer
Author by

loncer

Updated on May 16, 2021

Comments

  • loncer
    loncer about 3 years

    Why is my code not working?

    @bot.event
    async def on_ready():
        print('Bot is now working!')
        await bot.change_presence(activity=discord.CustomActivity(name='Custom status' ,emoji='🖥️'))
    

    And gives me an error.

    Ignoring exception in on_ready
    Traceback (most recent call last):
      File "/home/runner/.local/share/virtualenvs/python3/lib/python3.7/site-packages/discord/client.py", line 270, in _run_event
        await coro(*args, **kwargs)
      File "main.py", line 30, in on_ready
        await bot.change_presence(activity=discord.CustomActivity(name='Custom status' ,emoji='🖥️'))
    AttributeError: module 'discord' has no attribute 'CustomActivity'
    

    How fix is error?

    • GPhilo
      GPhilo over 4 years
      what version of the discord package are you using?
    • loncer
      loncer over 4 years
      I use newest version 1.3.
    • Harmon758
      Harmon758 over 4 years
      Do you have another module, i.e. file or folder, named 'discord' in your path?
    • Anu6is
      Anu6is over 4 years
      Bots cannot utilize custom statuses, they can only use the previous Playing, Watching etc.
    • Patrick Haugh
      Patrick Haugh over 4 years
      You might double check that the version updated correctly, by adding print(discord.__version__) to the start of your bot.
  • SK3
    SK3 almost 3 years
    if it did not why would i add it?
  • jupiterbjy
    jupiterbjy almost 3 years
    Can confirm this is still an ongoing problem.
  • Parasol Kirby
    Parasol Kirby over 2 years
    There was a time when bots could use custom statuses, with discord.ActivityType.custom, and using state instead of name to define the text.