During the dev stream, I had an idea for a more manual approach to the art review issue. What if there was a bot that can add artworks from a specific Discord message to the review queue upon command? This way, twins wouldn’t need to load active threads or interact with the Discord API during the art review and would just load arts from the queue when needed. But yeah, the obvious downside is that someone would need to run these commands before the streams.
#Art review possible solution
1 messages · Page 1 of 1 (latest)
yeah theres a bunch of workarounds we could do like this we just shouldn't have to 😭
Well you gotta work with what you got. If there isn't another solution you just have to do stuff like this, even if "we shouldn't have to do this stuff"
Well, at least I think it's the easiest one to implement before finding something better or waiting for discord to fix their api
at least is a temporary solution that could work as a permanent in the future
not a bandaid one waiting to fail
There's nothing more permanent than a temporary solution
You can pull from archived threads with API from a forum with a limit of certain number of most recent, I think deleted ones also show up in archived so you'd have to filter out after the call probably https://discord.com/developers/docs/resources/channel#list-public-archived-threads
Looking at the API Get Channel Messages on the art review channel could work as it can be paginated and threads are represented by a message on the channel with the thread id returned in the message object.
Wouldn't that also pull thread comments?
there also the route of reverse engineering the hidden api the client use (/channels/{channel.id}/threads/search)
I think only the first message is sent on the channel (not that I have anywhere to test)
tbf most you could likely do with active threads is just grab #1095941852068331560 with thread content (idk yet how that looks like, might need to do some experimenting to see how it looks like)
filter threads by tag, sort by time, grab the message
but I fucking bet that's what you already do with that method, im just looking at the python implementation instead
unfortunately API on their part isnt that versatile
but again, i've suggested this before: try doing the get requests throughout the stream before art section periodially, until you get a success, so it doesnt timeout at the worst possible moment
store what you get in cache and then just display when its time to
could also have mods post arts before stream in a separate locked forum so the actives threads are reduced and the twins can load from that during stream (yes also a Band-Aid solution)
Probably better be just a text channel instead of a forum in that case
I tried the hidden search API and it seems to work:
https://discord.com/api/v9/channels/1095941852068331560/threads/search?archived=false&sort_by=last_message_time&sort_order=desc&limit=25&tag_setting=match_some&offset=0
Seems a bit sketchy. Hidden APIs are hidden for a reason, that being not to make a public contract on how these APIs will work now or in the future
And apparently we already have this kind of issue even with the public API 
That's true, it's a workaround but this is the API used by the client, i don't think that discord changes them frequently
Get Channel Messages returns empty on a Forum channel like the Art one
can confirm this works on the latest api version (v10) with a bot token
It works, but obviously not in the .net library so doubt he will use that
surely they won't make a breaking change to a hidden api without incrementing the api version 
i mean, what's the alternative
oh hey here's the thread for this... if you're using SocketTextChannel, the Threads property (https://github.com/discord-net/Discord.Net/blob/3.18.0-beta.3/src/Discord.Net.WebSocket/Entities/Channels/SocketTextChannel.cs/#L60) might be able to use previously fetched information instead of the method that was screenshotted on stream (that one always makes a new request to /guilds/{guild_id}/threads/active)
it ends up filtering from a list of all channels which is populated here https://github.com/discord-net/Discord.Net/blob/dev/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs#L472
This route is documented in the official Discord's OpenAPI spec:
https://github.com/discord/discord-api-spec/commit/d9fb23dc284c368782384301429569970a4f87e0
It seems like the most effective solution right now
forgot to document then i assume?
Probably the docs on the dev site is not auto-generated from the API spec. Rather, the API spec is probably generated from existing codebase as there is no documentation on the spec file itself
API spec is probably generated
yeah that's the case with most openapi specs, no one is writing those by hand
More docs is here
https://discord.com/developers/docs/reference
Yeah, I think it is official, but not yet fully documented, since Threads is a "relatively" new feature
Certain API calls, such as listing archived threads and search will return ...
So they are talking about these routes:
/guilds/<guild_id>/threads/archived/<public/private>and
/channels/<channel_id>/threads/searchand maybe even/guilds/<guild_id>/threads/search(not listed in doc yet)
See: https://discord.com/developers/docs/topics/threads
And other get requests have the search route clearly documented, see Guild Member Example
That depends. If you're writing a new piece of software it could be handy to just write the spec first and generate client-server code from it
"relatively new" it's been 4 damn years 
I wouldn't know since I just used discord lol
oh whoops this already exists
the search route would definitely work, and there is also an undocumented /channels/{channelId}/threads/active route which works the same as its guild counterpart but filtered to the parent channel
I did a bit of performance testing as one of my servers also uses forums pretty heavily
/guilds/.../active- ~10sec/channels/.../active- ~900ms/channels/.../search- ~700ms (selecting just the past 2 weeks withmin_id)
also worth mentioning that search also includes some first_messages which could cut down on the additional calls needed to retrieve images
I guess the easiest would be to to start fetching using /channels/{channel.id}/threads/search and set min_id to the last messages the twins saw.
After the first request, set max_id to the last (smallest) message id of the previous request and repeat until there are less than 25 threads in the response.
One important thing to note is that if it gets to the point where max_id points to the message right after the one referenced by min_id then the response will not include first_messages so be careful with parsing this.
{"threads":[],"members":[],"has_more":false,"total_results":0}
How about treat art-review like game using game SDK?
On the control panel before starting the "game", vedal would only need to fill the parameters for the submission date range. Then it would fetch the art and put it on a queue so the fetch only happen once at the start
https://github.com/BlankParticle/discord-forum-threads-iteraator
here you go, a full implementation of the search api with support for limits and pagination
thanks this made it slightly easier to prompt cursor
gonna have to reopen this with latest issues happening with art review
im pretty sure I wrote this idea b4 already, but i'll reiterate in one message anyways
if you are having issues with discord API blocking you off during stream (possibly due to rate limiting), is it not better to do this instead:
- launch PC during the day of the stream, or day before
- cache the art posts that you want for the art review by sending less frequent API requests (like every 10-20 minutes if that satisfies them, or more frequently during times when discord API load worldwide is the lowest)
- use the cached art posts during art review (immediate access, no latency for displaying, immediate switching possible too)
- remove cache after stream
even better, cache the art throughout Friday - Monday for the next week entirely for both Neuro and Evil in their respective directories
