#Activity Not Changing

1 messages · Page 1 of 1 (latest)

violet basin
#

I am having an issue with my bot's activity not changing during the tasks.loop. The event triggers perfect, but the await DaveMod.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=f"{numofservers} Servers!"))
does not seem to be doing anything.

Attempt: https://pastebin.com/v7C9xRgA
Output:

--------------------------------------
Dave Mod Canary#9604 is ready and online!
--------------------------------------
-------------------------------------------------------
Successfully Established a Connection to the Database
-------------------------------------------------------
Changing Status...
Before: !help
After: !help


Backing up Database...

Database Backup #57 Complete!
Successfully backed up 56 Documents to: ./dbbackups/DB-Backup-57
Changing Status...
Before: !help
After: !help
Changing Status...
Before: !help
After: !help
snow cedarBOT
fresh canopy
#

What is Bot_Started and where do you set that to True?

violet basin
#

that was simply not supposed to be in there. I still get the same issue with it removed:
New Code:

@tasks.loop(seconds=5)
async def change_status():
    print("\n\nChanging Status...")
    numofmembers = len(DaveMod.guilds)
    numofservers = len(DaveMod.guilds)
    print(f"Before: {DaveMod.activity.name}")
    
    
    if DaveMod.activity.name == "!help":
        await DaveMod.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=(f"{numofmembers} Members!")))
        print(f"After: {DaveMod.activity.name}")
        return
    
    elif DaveMod.activity.name == f"{numofmembers} Members!":
        await DaveMod.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=(f"{numofservers} Servers!")))
        print(f"After: {DaveMod.activity.name}")
        return
    
    elif DaveMod.activity.name == f"{numofservers} Servers!":
        await DaveMod.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=f"{numofmembers} Members!"))
        print(f"After: {DaveMod.activity.name}")
        return

    else:
        await DaveMod.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=f"{numofmembers} Members!"))
        print(f"After: {DaveMod.activity.name}")
        return
#

it prints fine, so its running the process with no error, yet the activity does not change with await DaveMod.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=f"{numofmembers} Members!"))

#

it seems to be the if statements preventing it from working. (even though it passes the if statement check) Not sure why. Just gonna use a different method i guess

empty haven
#

Its possible you are getting ratelimited. Try making the loop slower.