guild.go 2.7 KB

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