Skip to content

feat(structures): Role, Member, Collection + Server/Channel methods#8

Merged
0xSaiNova merged 1 commit intodevfrom
4-sdk-structure-classes-and-collection
Mar 2, 2026
Merged

feat(structures): Role, Member, Collection + Server/Channel methods#8
0xSaiNova merged 1 commit intodevfrom
4-sdk-structure-classes-and-collection

Conversation

@0xSaiNova
Copy link
Copy Markdown
Member

Closes #4

Adds Role and Member structures, Collection class, and action methods to Server and Channel.

  • Role — maps wire data to camelCase (id, serverId, name, permissions, color, hoist, mentionable)
  • Member — wraps user as a User instance, exposes nickname/roles/joinedAt, displayName falls back to username when no nickname set
  • Collection — extends Map with filter/find/map/first/last/random/toJSON, same shape as discord.js so ported bots feel at home
  • Server — edit(), delete(), leave(), createChannel()
  • Channel — send(), edit(), delete(), fetchMessages()
  • REST — leaveServer() added for DELETE /servers/:id/members/@me

…refs #4]

Added Role and Member structures mapping wire data to camelCase. Collection
extends Map with filter/find/map/first/last/random/toJSON — same shape as
discord.js so ported bots feel at home.

Server now has edit(), delete(), leave(), createChannel(). Channel has send(),
edit(), delete(), fetchMessages(). Both store the client ref via private fields
to make REST calls directly. leaveServer() added to REST for the leave endpoint.
@0xSaiNova 0xSaiNova linked an issue Feb 24, 2026 that may be closed by this pull request
@0xSaiNova 0xSaiNova merged commit 2f4528b into dev Mar 2, 2026
3 checks passed
@0xSaiNova 0xSaiNova deleted the 4-sdk-structure-classes-and-collection branch March 2, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

{sdk} Structure classes and Collection

1 participant