question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Status not showing up

See original GitHub issue

Hi! I’m trying to make a self-bot that sets a custom status and then stays online forever. I tried this:

import discum

bot = discum.Client(token="token")
bot.setStatus("my custom status")
bot.gateway.run(auto_reconnect=True)

The bot stays online, but the status doesn’t show up when I check from another account. What am I doing wrong? Cheers!


arandomnewaccount: oh I think see what’s happening. What I think is going on here is the IDENTIFY message your client is sending out (when running bot.gateway.run() says to discord that your status is online (https://github.com/Merubokkusu/Discord-S.C.U.M/blob/master/discum/gateway/gateway.py#L64), which is then changing your status. I’m going to have to do a few more tests to confirm, and if that’s indeed the case, then I’ll be fixing it in an upcoming commit.

If that’s the case, then the custom status should show if you don’t connect to the gateway…

edit: just tested it and the gateway connection does not affect the status so… My other guess is that your other account is not getting updates for your current account’s presence changes. See if the profile of your current account (viewed from your other account) shows the custom status (right-click on username -> click profile). If it does, then everything is working fine.

2nd edit: I see now. Tried looking from my other account and couldn’t see any evidence of status-changing on my main so…I’ve got 1 last idea and if that doesn’t work idk (I’ll have to try tmr since tonight I don’t have much time). Thanks for bringing this issue up.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Gilgames000commented, Feb 21, 2021

Ah I see! Thank you for looking into this. Do you happen to know if there is also a gateway request for sending DMs or something like that? Because after I send 2 DMs with the HTTP request my accounts get locked (even though I use a 1 minute delay between messages and a phone-verified account).


arandomnewaccount: hm well. Technically, but not in the same way that setStatus requires a gateway request. You see, when a real user sends a dm, that user has to go to the channel first (a gateway request) and then send the dm (an http request). Now, there’re a number of ways to code this. The simplest looking way is like this:

import time
@bot.gateway.command
def sendMessage(resp):
    if resp.event.message:
        m = resp.parsed.message_create #these are just lowercased event names
        if m["channel_id"] == "the channel id here": #if your own message in that channel detected
        	time.sleep(1) #or whatever wait time
        	bot.gateway.request.DMchannel("the channel id here") #request to view the channel
        	time.sleep(1) #optional, I think. But generally, the more wait time, the better.
        	bot.sendMessage("the channel id here", "some message")

You could also set something up so that the request to view the channel is only sent once. Pretty sure that would work too. As far as creating DMs goes, the order is: (1) send the createDM (http request) and then (2) request to view the channel and finally (3) send the messages.

I guess if you don’t want to send the first dm to start it off (as in the example above), you can use threading. Unfortunately, the threading option would probs take a few more lines to implement. But, it’s not too bad; I’d use threading.Timer(...) for the waiting since a while loop could pose some issues.

p.s. for joining guilds, there’s a similar thing going on. Just gotta (1) join guild thru http request and then (2) view the guild using bot.gateway.request.lazyGuild("guild id here", {"channel id here": [0,99]}).

Whew that’s quite a bit actually lol. I should probs document this but uh…Ill get there eventually…


arandomnewaccount: alright made some updates (you’ll have to reinstall discum), here’s how it can be done:

@bot.gateway.command
def setStatusTest(resp):
    if resp.event.ready_supplemental:
        bot.gateway.setCustomStatus("my custom status")

I’ll update the docs later.

0reactions
Gilgames000commented, Feb 23, 2021

But anyway it’s still working so I’m gonna close the issue for now 🤷

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom status not showing up. : r/discordapp - Reddit
Anytime I set a custom status of any kind, wether it's letter spam, words, or anything- nothing appears.
Read more >
6 Methods to Fix WhatsApp Status Not Showing
How to Fix WhatsApp Status Not Showing? · Fix 1: Check the connection · Fix 2: Contact Your Friends · Fix 3: Update...
Read more >
Why Is WhatsApp Status Not Showing? How Can I Fix it?
How to Fix WhatsApp Status Not Showing to Me · Check the Contact List · Update WhatsApp · Privacy Settings · Check the...
Read more >
Fix Discord Custom Status Not Showing [Latest Fix 2022]
Discord custom status not showing up correctly can be due to many reasons. It can be you assigning a short expiration time, conflict...
Read more >
[2022 SOLVED + GUIDE] WhatsApp Status Not Showing
This guide will show you how to solve the issue wherein WhatsApp status not showing. We will help you solve the problem with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found