#Difference between position and rawPosition? ( as in how are they positioned)
110 messages · Page 1 of 1 (latest)
no
Closed: marked as duplicate
tristan stop shitposting in djs-questions
rawPosition is the one discord sends
iirc position is something from discordjs and resembles the position in the category?
correct me if I'm wrong
i know that but how is it even positioned
i know what raw means, i just don't know how discord's api positions it and how djs does it
Difference between position and rawPosition? ( as in how are they positioned)
well position is what position the channel has in the category (this forum channel would be 0)
rawPosition seems to be the position of the channel from top to bottom
categories and text/voice channels are separated
so for rawPositions, there are three categories of positions?
category, text and voice?
do stage channels count as voice?
hmm, this makes sense since voice channels are always on the bottom in the category
i don't know about stages though
not something to ask on my thread, it's a forum, go ask on #archive-offtopic 😡
rawPosition on voice/stage seems absolutely fucked
(does this still need answers?)
yes
yes
ook
at least for rawPosition
djs positions are just like from top to bottom, right? neat
after we're done with that, i got two words for you, role positions 🤨
the rawPosition is the position as sent by discord, as single number, nonexclusive to other channels or roles
when the discord client recieves roles or channels with the same position, it orders them based on id, ascending for channels, descending for roles
each type of channel is sorted seperately
the library's position follows the order as shown in the discord client
ah role positions seem simpler, just "id sorting -> position sorting" right?
both role and channel positions are generated in the same way, each type of channel is sorted seperately
both the first text channel and the first voice channel in a category will have the position 0 (or 1 i don't remember)
let me check
why did i try to enable developer mode 
okay that bit is irrelevant for now, each type?
not just categories, text-based types and voice?
not sure about that, haven't tested that much
it doesn't make sense to have sort categories for each type
categories are seperate, and text and voice are seperate, but i don't know if news and stage are grouped with text and voice respectively
only voice and everything else (categories ofc) make sense because voice channels are always on the bottom of the category
makes sense for the news channels to be sorted along with text channels, but i haven't used stages so i can't comment on that
that was phrased badly, mb
my understanding is, if are allowed to be placed anywhere and not just some specific position (like on the top of the other channels or on the bottom), stages would be sorted with text channels
for some reason now i can't find a single stage in all 70 of my servers
@dawn stirrup did stages get removed or something?
stage is sorted among voice channels so they would share the sorting i believe
they are? i think i saw stages being on top
so there's 4 groups for the rawPosition, roles, categories, text-based (for each category) and voice-based (for each category)
may have been outside of a category?
no i think it was inside
but again i can't really confirm
because i can't find a single stage
im testing in the client rn, can't get it above text
okay so it's with voice channels
hype died down probably
they can be placed above voice channels, right?
now just confirm rawPosition for roles for me
like channels but descending
confused
channel with position 0 is at the top, role with position 0 is at the bottom (<@&222078108977594368>)
so djs just makes it ascending -> descending?
that's very useful
(static) Util.discordSort()
Sorts by Discord's position and id.
(lib stays consistent with descending thing but the order of ids changes)
okay so summary of this thread correct me if i'm wrong
Roles
rawPosition -> discord sends the roles in an ascending order
position -> discordjs makes it descending
channels
rawPosition -> three groups with their own descending sorting, categories, voice channels (including stages) and everything else
position -> all the channels in descending order as they appear in the ui
channels are ascending
not sure what you mean by this part
discord sends the roles as ascending
in an ascending order
<@&222078108977594368>, the bottom role, is always (raw)pos 0 (afaik)
djs keeps that
and then the role above is 1, the one above is 2 and so on?
for position, yes
for rawPos they just go up, not necessarily sequential/distinct as mentioned before
so wait djs makes it from top to bottom but in the end they have everyone as 0?
uhhhhhh
suppose uh, this server ig
mod, contrib, everyone
for djs position, it's 2 1 0 in that order
for raw position, afaik everyone is always 0, and then contrib is something above that, and then mod is something above that
so what's the difference
or it could be that everyone is 0, both mod and contrib are 1, and mod has a later id than contrib
the "first" channel is the topmost channel, the "first" role is the bottommost role
noooo i mean what's the difference between djs position and rawPosition for roles specifically
forget channels
djs position resolves the rawPosition into indexes
rawPosition can have duplicates or gaps, position doesn't
rawPosition doesn't require distinct positions
to avoid extra updates i guess
if you have a channel in position 1, and you edit another channel to have position 1, then those 2 channels will be sorted by id and the first channel won't get updated
i get that instead of editting the positions of all the roles just for one update is wasteful but then what is it for
rawPositions
as in the value discord sends or the field exposed on Roles/GuildChannels
well now i have to sleep
i'll do some testing later on
thanks a lot
i'm left with extreme confusion
im confused on what you're confused on
right now just how discord roles' raw position works
i feel like it just barely does tbh
and i wanna know how 

