8000 Document more ack fields and ack flags · Issue #305 · discord-userdoccers/discord-userdoccers · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Document more ack fields and ack flags #305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
BoryaGames opened this issue Jan 20, 2025 · 4 comments
Open

Document more ack fields and ack flags #305

BoryaGames opened this issue Jan 20, 2025 · 4 comments
Labels
addition New area of the documentation, e.g. a topic or section

Comments

@BoryaGames
Copy link
Contributor

Message acknowledgement has more fields than documented right now (for example, flags, last_viewed or token).

The following flags are known at the moment:

        e[e.IS_GUILD_CHANNEL = 1] = "IS_GUILD_CHANNEL",
        e[e.IS_THREAD = 2] = "IS_THREAD",
        e[e.IS_MENTION_LOW_IMPORTANCE = 4] = "IS_MENTION_LOW_IMPORTANCE"
@dolfies
Copy link
Contributor
dolfies commented Jan 27, 2025

Read state docs aren't there yet, it's quite complicated unfortunately. You can look at discord.py-self for a mostly complete implementation.

@dolfies dolfies added the addition New area of the documentation, e.g. a topic or section label Jan 27, 2025
@mzivic7
Copy link
mzivic7 commented Apr 10, 2025

I've been making third party discord client for some time now (sadly, without knowing about this repo) so I mostly figured it all out.
Here's what I know about ack-ing (api v9):
token can be set to None, I never saw it have different value.
last_viewed is days since discord epoch, and can be calculated like this (python): ceil((time.time() - 1420070400) / 86400) (time.time() gives current utc time in seconds), idk why discord requires that, but will always send error if its wrong.

@mzivic7
Copy link
mzivic7 commented Apr 10, 2025

About read_state:
The catch is: last_message_id in read_state entries is actually last_ACKED_message_id.
So to know if channel has unread messages, simply compare last_message_id form private_channels or guilds > channels with this last_ACKED_message_id. If last_message_id is larger, there are unreads.

@dolfies
Copy link
Contributor
dolfies commented Apr 10, 2025

Yup! It gets a little more complicated with other read state types though

You can take a look here, though I don't have the IS_MENTION_LOW_IMPORTANCE flag or the new unread system implemented yet
https://github.com/dolfies/discord.py-self/blob/master/discord/read_state.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition New area of the documentation, e.g. a topic or section
Projects
None yet
Development

No branches or pull requests

3 participants
0