server.go 806 B

1234567891011121314151617181920212223
  1. package discordgo
  2. type Server 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"`
  8. Afk_timeout int `json:"afk_timeout"`
  9. Afk_channel_id int `json:"afk_channel_id"`
  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. Roles []Role `json:"roles"`
  14. Session *Session // I got to be doing it wrong here.
  15. }
  16. // Channels returns an array of Channel structures for channels within
  17. // this Server
  18. func (s *Server) Channels() (c []Channel, err error) {
  19. c, err = Channels(s.Session, s.Id)
  20. return
  21. }