Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for exposing Discord message flags in Nostrum.Struct.Message and introduces a dedicated Nostrum.Struct.Message.Flags helper module to convert between the integer bitfield and a boolean-flag struct.
Changes:
- Introduce
Nostrum.Struct.Message.Flagswithfrom_integer/1andto_integer/1helpers. - Add a
:flagsfield (raw bitfield integer) toNostrum.Struct.Messageand attempt to cast it duringto_struct/1and update merges. - Add a message
flagstype to the struct typespecs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| lib/nostrum/struct/message/flags.ex | New helper struct/module for converting message flags between bitfield integers and booleans. |
| lib/nostrum/struct/message.ex | Adds :flags to the message struct and attempts to cast it during struct construction/updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jchristgit
left a comment
There was a problem hiding this comment.
Thank you for the pull request!
Clanker comments are mostly fine, to be honest. I'm positively surprised. See my comments below.
We should think about whether we want the flags field in the Message to automatically be decoded. Right now, from my understanding, they are just being kept as-is.
lara-rium
left a comment
There was a problem hiding this comment.
this should resolve all the comments, pls let me know if i need further adjustments
i just copied over from user, which also keeps it as it is. if we wanna discuss this i think we should do it in another issue cos it'd affect other flags as well. im also not very happy with this approach bc it involves copy/pasting the same |
closes #711
i looked at user flags impl and reflected those on message but some things may be missing. pls lmk upon review. also sorry ab the messy revert commits, forgot to create different branches for each pr