cronokirby / alchemy

A discord library for Elixir
MIT License
151 stars 34 forks source link

Channel Categories #54

Closed lun-4 closed 6 years ago

lun-4 commented 6 years ago

Every channel object(in a guild) can have a parent_id field(it should be nil when no category), it is a snowflake that points to another channel(the channel category, type 4), the category has its own name and permission overwrites which can be synced to the category's childs.

Note: In theory, categories can have category childs, but the UI doesn't allow that 🤷‍

We could add a Alchemy.Category.t where it could have functions like a get_childs(category_id) :: [Alchemy.Channel.t].

cronokirby commented 6 years ago

Thinking of splitting the channel type into 5 types (one for each id) instead of having this weird spec of keys that may or may not be there

lun-4 commented 6 years ago

It would be really nice! checking for the actual type instead of missing keys sounds way better

cronokirby commented 6 years ago

New pr splits up the channel types, feel free to raise issues / pr for utility functions or modifications related to this