endpoints.go 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. // Discordgo - Discord bindings for Go
  2. // Available at https://github.com/bwmarrin/discordgo
  3. // Copyright 2015-2016 Bruce Marriner <bruce@sqls.net>. All rights reserved.
  4. // Use of this source code is governed by a BSD-style
  5. // license that can be found in the LICENSE file.
  6. // This file contains variables for all known Discord end points. All functions
  7. // throughout the Discordgo package use these variables for all connections
  8. // to Discord. These are all exported and you may modify them if needed.
  9. package discordgo
  10. // The Discord API version used for the REST and Websocket API.
  11. var ApiVersion = "6"
  12. // Known Discord API Endpoints.
  13. var (
  14. EndpointStatus = "https://status.discordapp.com/api/v2/"
  15. EndpointSm = EndpointStatus + "scheduled-maintenances/"
  16. EndpointSmActive = EndpointSm + "active.json"
  17. EndpointSmUpcoming = EndpointSm + "upcoming.json"
  18. EndpointDiscord = "https://discordapp.com/"
  19. EndpointAPI = EndpointDiscord + "api/v" + ApiVersion + "/"
  20. EndpointGuilds = EndpointAPI + "guilds/"
  21. EndpointChannels = EndpointAPI + "channels/"
  22. EndpointUsers = EndpointAPI + "users/"
  23. EndpointGateway = EndpointAPI + "gateway"
  24. EndpointGatewayBot = EndpointGateway + "/bot"
  25. EndpointWebhooks = EndpointAPI + "webhooks/"
  26. EndpointCDN = "https://cdn.discordapp.com/"
  27. EndpointCDNAttachments = EndpointCDN + "attachments/"
  28. EndpointCDNAvatars = EndpointCDN + "avatars/"
  29. EndpointCDNIcons = EndpointCDN + "icons/"
  30. EndpointCDNSplashes = EndpointCDN + "splashes/"
  31. EndpointCDNChannelIcons = EndpointCDN + "channel-icons/"
  32. EndpointAuth = EndpointAPI + "auth/"
  33. EndpointLogin = EndpointAuth + "login"
  34. EndpointLogout = EndpointAuth + "logout"
  35. EndpointVerify = EndpointAuth + "verify"
  36. EndpointVerifyResend = EndpointAuth + "verify/resend"
  37. EndpointForgotPassword = EndpointAuth + "forgot"
  38. EndpointResetPassword = EndpointAuth + "reset"
  39. EndpointRegister = EndpointAuth + "register"
  40. EndpointVoice = EndpointAPI + "/voice/"
  41. EndpointVoiceRegions = EndpointVoice + "regions"
  42. EndpointVoiceIce = EndpointVoice + "ice"
  43. EndpointTutorial = EndpointAPI + "tutorial/"
  44. EndpointTutorialIndicators = EndpointTutorial + "indicators"
  45. EndpointTrack = EndpointAPI + "track"
  46. EndpointSso = EndpointAPI + "sso"
  47. EndpointReport = EndpointAPI + "report"
  48. EndpointIntegrations = EndpointAPI + "integrations"
  49. EndpointUser = func(uID string) string { return EndpointUsers + uID }
  50. EndpointUserAvatar = func(uID, aID string) string { return EndpointCDNAvatars + uID + "/" + aID + ".png" }
  51. EndpointUserAvatarAnimated = func(uID, aID string) string { return EndpointCDNAvatars + uID + "/" + aID + ".gif" }
  52. EndpointUserSettings = func(uID string) string { return EndpointUsers + uID + "/settings" }
  53. EndpointUserGuilds = func(uID string) string { return EndpointUsers + uID + "/guilds" }
  54. EndpointUserGuild = func(uID, gID string) string { return EndpointUsers + uID + "/guilds/" + gID }
  55. EndpointUserGuildSettings = func(uID, gID string) string { return EndpointUsers + uID + "/guilds/" + gID + "/settings" }
  56. EndpointUserChannels = func(uID string) string { return EndpointUsers + uID + "/channels" }
  57. EndpointUserDevices = func(uID string) string { return EndpointUsers + uID + "/devices" }
  58. EndpointUserConnections = func(uID string) string { return EndpointUsers + uID + "/connections" }
  59. EndpointUserNotes = func(uID string) string { return EndpointUsers + "@me/notes/" + uID }
  60. EndpointGuild = func(gID string) string { return EndpointGuilds + gID }
  61. EndpointGuildInivtes = func(gID string) string { return EndpointGuilds + gID + "/invites" }
  62. EndpointGuildChannels = func(gID string) string { return EndpointGuilds + gID + "/channels" }
  63. EndpointGuildMembers = func(gID string) string { return EndpointGuilds + gID + "/members" }
  64. EndpointGuildMember = func(gID, uID string) string { return EndpointGuilds + gID + "/members/" + uID }
  65. EndpointGuildMemberRole = func(gID, uID, rID string) string { return EndpointGuilds + gID + "/members/" + uID + "/roles/" + rID }
  66. EndpointGuildBans = func(gID string) string { return EndpointGuilds + gID + "/bans" }
  67. EndpointGuildBan = func(gID, uID string) string { return EndpointGuilds + gID + "/bans/" + uID }
  68. EndpointGuildIntegrations = func(gID string) string { return EndpointGuilds + gID + "/integrations" }
  69. EndpointGuildIntegration = func(gID, iID string) string { return EndpointGuilds + gID + "/integrations/" + iID }
  70. EndpointGuildIntegrationSync = func(gID, iID string) string { return EndpointGuilds + gID + "/integrations/" + iID + "/sync" }
  71. EndpointGuildRoles = func(gID string) string { return EndpointGuilds + gID + "/roles" }
  72. EndpointGuildRole = func(gID, rID string) string { return EndpointGuilds + gID + "/roles/" + rID }
  73. EndpointGuildInvites = func(gID string) string { return EndpointGuilds + gID + "/invites" }
  74. EndpointGuildEmbed = func(gID string) string { return EndpointGuilds + gID + "/embed" }
  75. EndpointGuildPrune = func(gID string) string { return EndpointGuilds + gID + "/prune" }
  76. EndpointGuildIcon = func(gID, hash string) string { return EndpointCDNIcons + gID + "/" + hash + ".png" }
  77. EndpointGuildSplash = func(gID, hash string) string { return EndpointCDNSplashes + gID + "/" + hash + ".png" }
  78. EndpointGuildWebhooks = func(gID string) string { return EndpointGuilds + gID + "/webhooks" }
  79. EndpointChannel = func(cID string) string { return EndpointChannels + cID }
  80. EndpointChannelPermissions = func(cID string) string { return EndpointChannels + cID + "/permissions" }
  81. EndpointChannelPermission = func(cID, tID string) string { return EndpointChannels + cID + "/permissions/" + tID }
  82. EndpointChannelInvites = func(cID string) string { return EndpointChannels + cID + "/invites" }
  83. EndpointChannelTyping = func(cID string) string { return EndpointChannels + cID + "/typing" }
  84. EndpointChannelMessages = func(cID string) string { return EndpointChannels + cID + "/messages" }
  85. EndpointChannelMessage = func(cID, mID string) string { return EndpointChannels + cID + "/messages/" + mID }
  86. EndpointChannelMessageAck = func(cID, mID string) string { return EndpointChannels + cID + "/messages/" + mID + "/ack" }
  87. EndpointChannelMessagesBulkDelete = func(cID string) string { return EndpointChannel(cID) + "/messages/bulk_delete" }
  88. EndpointChannelMessagesPins = func(cID string) string { return EndpointChannel(cID) + "/pins" }
  89. EndpointChannelMessagePin = func(cID, mID string) string { return EndpointChannel(cID) + "/pins/" + mID }
  90. EndpointGroupIcon = func(cID, hash string) string { return EndpointCDNChannelIcons + cID + "/" + hash + ".png" }
  91. EndpointChannelWebhooks = func(cID string) string { return EndpointChannel(cID) + "/webhooks" }
  92. EndpointWebhook = func(wID string) string { return EndpointWebhooks + wID }
  93. EndpointWebhookToken = func(wID, token string) string { return EndpointWebhooks + wID + "/" + token }
  94. EndpointMessageReactions = func(cID, mID, eID string) string {
  95. return EndpointChannelMessage(cID, mID) + "/reactions/" + eID
  96. }
  97. EndpointMessageReaction = func(cID, mID, eID, uID string) string {
  98. return EndpointMessageReactions(cID, mID, eID) + "/" + uID
  99. }
  100. EndpointRelationships = func() string { return EndpointUsers + "@me" + "/relationships" }
  101. EndpointRelationship = func(uID string) string { return EndpointRelationships() + "/" + uID }
  102. EndpointRelationshipsMutual = func(uID string) string { return EndpointUsers + uID + "/relationships" }
  103. EndpointInvite = func(iID string) string { return EndpointAPI + "invite/" + iID }
  104. EndpointIntegrationsJoin = func(iID string) string { return EndpointAPI + "integrations/" + iID + "/join" }
  105. EndpointEmoji = func(eID string) string { return EndpointAPI + "emojis/" + eID + ".png" }
  106. EndpointOauth2 = EndpointAPI + "oauth2/"
  107. EndpointApplications = EndpointOauth2 + "applications"
  108. EndpointApplication = func(aID string) string { return EndpointApplications + "/" + aID }
  109. EndpointApplicationsBot = func(aID string) string { return EndpointApplications + "/" + aID + "/bot" }
  110. )