guild.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package discordgo
  2. type Guild struct {
  3. Id string `json:"id"`
  4. Name string `json:"name"`
  5. Icon string `json:"icon"`
  6. Region string `json:"region"`
  7. AfkTimeout int `json:"afk_timeout"`
  8. AfkChannelId string `json:"afk_channel_id"`
  9. EmbedChannelId string `json:"embed_channel_id"`
  10. EmbedEnabled bool `json:"embed_enabled"`
  11. OwnerId string `json:"owner_id"`
  12. Large bool `json:"large"` // ??
  13. JoinedAt string `json:"joined_at"` // make this a timestamp
  14. Roles []Role `json:"roles"`
  15. Members []Member `json:"members"`
  16. Presences []Presence `json:"presences"`
  17. Channels []Channel `json:"channels"`
  18. VoiceStates []VoiceState `json:"voice_states"`
  19. }
  20. type Role struct {
  21. Id string `json:"id"`
  22. Name string `json:"name"`
  23. Managed bool `json:"managed"`
  24. Color int `json:"color"`
  25. Hoist bool `json:"hoist"`
  26. Position int `json:"position"`
  27. Permissions int `json:"permissions"`
  28. }
  29. type VoiceState struct {
  30. UserId string `json:"user_id"`
  31. Suppress bool `json:"suppress"`
  32. SessionId string `json:"session_id"`
  33. SelfMute bool `json:"self_mute"`
  34. SelfDeaf bool `json:"self_deaf"`
  35. Mute bool `json:"mute"`
  36. Deaf bool `json:"deaf"`
  37. ChannelId string `json:"channel_id"`
  38. }
  39. type Presence struct {
  40. User User `json:"user"`
  41. Status string `json:"status"`
  42. GameId int `json:"game_id"`
  43. }
  44. // TODO: Member vs User?
  45. type Member struct {
  46. GuildId string `json:"guild_id"`
  47. JoinedAt string `json:"joined_at"`
  48. Deaf bool `json:"deaf"`
  49. mute bool `json:"mute"`
  50. User User `json:"user"`
  51. Roles []string `json:"roles"`
  52. }
  53. /*
  54. TODO: How to name these? If we make a variable to store
  55. channels from READY packet, etc. We can't have a Channel
  56. func? And which is better. Channels func gets live up
  57. to date data on each call.. so, there is some benefit there.
  58. Maybe it should have both, but make the Channels check and
  59. pull new data based on a cache time?
  60. func (s *Server) Channels() (c []Channel, err error) {
  61. c, err = Channels(s.Session, s.Id)
  62. return
  63. }
  64. */
  65. /*
  66. func (s *Server) Members() (m []Users, err error) {
  67. }
  68. */