guild.go 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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"` // TODO: See below
  52. }
  53. //Roles []string `json:"roles"` // TODO: Should be ints, see below
  54. // Above "Roles" should be an array of ints
  55. // TODO: Figure out how to make it be one.
  56. /*
  57. {
  58. "roles": [
  59. "89544728336416768",
  60. "110429733396676608"
  61. ],
  62. }
  63. */
  64. // Channels returns an array of Channel structures for channels within
  65. // this Server
  66. /*
  67. TODO: How to name these? If we make a variable to store
  68. channels from READY packet, etc. We can't have a Channel
  69. func? And which is better. Channels func gets live up
  70. to date data on each call.. so, there is some benefit there.
  71. Maybe it should have both, but make the Channels check and
  72. pull new data based on a cache time?
  73. func (s *Server) Channels() (c []Channel, err error) {
  74. c, err = Channels(s.Session, s.Id)
  75. return
  76. }
  77. */
  78. /*
  79. func (s *Server) Members() (m []Users, err error) {
  80. }
  81. */