endpoints.go 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. // APIVersion is 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. EndpointGuildChannels = func(gID string) string { return EndpointGuilds + gID + "/channels" }
  62. EndpointGuildMembers = func(gID string) string { return EndpointGuilds + gID + "/members" }
  63. EndpointGuildMember = func(gID, uID string) string { return EndpointGuilds + gID + "/members/" + uID }
  64. EndpointGuildMemberRole = func(gID, uID, rID string) string { return EndpointGuilds + gID + "/members/" + uID + "/roles/" + rID }
  65. EndpointGuildBans = func(gID string) string { return EndpointGuilds + gID + "/bans" }
  66. EndpointGuildBan = func(gID, uID string) string { return EndpointGuilds + gID + "/bans/" + uID }
  67. EndpointGuildIntegrations = func(gID string) string { return EndpointGuilds + gID + "/integrations" }
  68. EndpointGuildIntegration = func(gID, iID string) string { return EndpointGuilds + gID + "/integrations/" + iID }
  69. EndpointGuildIntegrationSync = func(gID, iID string) string { return EndpointGuilds + gID + "/integrations/" + iID + "/sync" }
  70. EndpointGuildRoles = func(gID string) string { return EndpointGuilds + gID + "/roles" }
  71. EndpointGuildRole = func(gID, rID string) string { return EndpointGuilds + gID + "/roles/" + rID }
  72. EndpointGuildInvites = func(gID string) string { return EndpointGuilds + gID + "/invites" }
  73. EndpointGuildEmbed = func(gID string) string { return EndpointGuilds + gID + "/embed" }
  74. EndpointGuildPrune = func(gID string) string { return EndpointGuilds + gID + "/prune" }
  75. EndpointGuildIcon = func(gID, hash string) string { return EndpointCDNIcons + gID + "/" + hash + ".png" }
  76. EndpointGuildSplash = func(gID, hash string) string { return EndpointCDNSplashes + gID + "/" + hash + ".png" }
  77. EndpointGuildWebhooks = func(gID string) string { return EndpointGuilds + gID + "/webhooks" }
  78. EndpointChannel = func(cID string) string { return EndpointChannels + cID }
  79. EndpointChannelPermissions = func(cID string) string { return EndpointChannels + cID + "/permissions" }
  80. EndpointChannelPermission = func(cID, tID string) string { return EndpointChannels + cID + "/permissions/" + tID }
  81. EndpointChannelInvites = func(cID string) string { return EndpointChannels + cID + "/invites" }
  82. EndpointChannelTyping = func(cID string) string { return EndpointChannels + cID + "/typing" }
  83. EndpointChannelMessages = func(cID string) string { return EndpointChannels + cID + "/messages" }
  84. EndpointChannelMessage = func(cID, mID string) string { return EndpointChannels + cID + "/messages/" + mID }
  85. EndpointChannelMessageAck = func(cID, mID string) string { return EndpointChannels + cID + "/messages/" + mID + "/ack" }
  86. EndpointChannelMessagesBulkDelete = func(cID string) string { return EndpointChannel(cID) + "/messages/bulk-delete" }
  87. EndpointChannelMessagesPins = func(cID string) string { return EndpointChannel(cID) + "/pins" }
  88. EndpointChannelMessagePin = func(cID, mID string) string { return EndpointChannel(cID) + "/pins/" + mID }
  89. EndpointGroupIcon = func(cID, hash string) string { return EndpointCDNChannelIcons + cID + "/" + hash + ".png" }
  90. EndpointChannelWebhooks = func(cID string) string { return EndpointChannel(cID) + "/webhooks" }
  91. EndpointWebhook = func(wID string) string { return EndpointWebhooks + wID }
  92. EndpointWebhookToken = func(wID, token string) string { return EndpointWebhooks + wID + "/" + token }
  93. EndpointMessageReactionsAll = func(cID, mID string) string {
  94. return EndpointChannelMessage(cID, mID) + "/reactions"
  95. }
  96. EndpointMessageReactions = func(cID, mID, eID string) string {
  97. return EndpointChannelMessage(cID, mID) + "/reactions/" + eID
  98. }
  99. EndpointMessageReaction = func(cID, mID, eID, uID string) string {
  100. return EndpointMessageReactions(cID, mID, eID) + "/" + uID
  101. }
  102. EndpointRelationships = func() string { return EndpointUsers + "@me" + "/relationships" }
  103. EndpointRelationship = func(uID string) string { return EndpointRelationships() + "/" + uID }
  104. EndpointRelationshipsMutual = func(uID string) string { return EndpointUsers + uID + "/relationships" }
  105. EndpointGuildCreate = EndpointAPI + "guilds"
  106. EndpointInvite = func(iID string) string { return EndpointAPI + "invite/" + iID }
  107. EndpointIntegrationsJoin = func(iID string) string { return EndpointAPI + "integrations/" + iID + "/join" }
  108. EndpointEmoji = func(eID string) string { return EndpointAPI + "emojis/" + eID + ".png" }
  109. EndpointOauth2 = EndpointAPI + "oauth2/"
  110. EndpointApplications = EndpointOauth2 + "applications"
  111. EndpointApplication = func(aID string) string { return EndpointApplications + "/" + aID }
  112. EndpointApplicationsBot = func(aID string) string { return EndpointApplications + "/" + aID + "/bot" }
  113. )