users.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package discordgo
  2. type User struct {
  3. Id int `json:"id,string"`
  4. Email string `json:"email"`
  5. Username string `json:"username"`
  6. Avatar string `json:"Avatar"`
  7. Verified bool `json:"verified"`
  8. //Discriminator int `json:"discriminator,string"` // TODO: See below
  9. }
  10. // Discriminator sometimes comes as a string
  11. // and sometimes it comes as a int. Weird.
  12. // to avoid errors I've just commented it out
  13. // but it doesn't seem to just kill the whole
  14. // program. Heartbeat is taken on READY even
  15. // with error and the system continues to read
  16. // it just doesn't seem able to handle this one
  17. // field correctly. Need to research this more.
  18. type PrivateChannel struct {
  19. Id int `json:"id,string"`
  20. IsPrivate bool `json:"is_private"`
  21. LastMessageId int `json:"last_message_id,string"`
  22. Recipient User `json:"recipient"`
  23. } // merge with channel?
  24. type Settings struct {
  25. RenderEmbeds bool `json:"render_embeds"`
  26. InlineEmbedMedia bool `json:"inline_embed_media"`
  27. EnableTtsCommand bool `json:"enable_tts_command"`
  28. MessageDisplayCompact bool `json:"message_display_compact"`
  29. Locale string `json:"locale"`
  30. ShowCurrentGame bool `json:"show_current_game"`
  31. Theme string `json:"theme"`
  32. //MutedChannels []string `json:"muted_channels"` // TODO, see below
  33. MutedChannels []int `json:"muted_channels,string"` // TODO, see below
  34. // MutedChannels []MutedChannel `json:"muted_channels"`
  35. }
  36. type MutedChannel struct {
  37. mc int `json:",string"`
  38. }
  39. // MutedChannels should be an array of ints...
  40. // need to find a way to make that happen
  41. // PM function to PM a user.