endpoints.go 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. // Known Discord API Endpoints.
  11. var (
  12. EndpointStatus = "https://status.discordapp.com/api/v2/"
  13. EndpointSm = EndpointStatus + "scheduled-maintenances/"
  14. EndpointSmActive = EndpointSm + "active.json"
  15. EndpointSmUpcoming = EndpointSm + "upcoming.json"
  16. EndpointDiscord = "https://discordapp.com/"
  17. EndpointAPI = EndpointDiscord + "api/"
  18. EndpointGuilds = EndpointAPI + "guilds/"
  19. EndpointChannels = EndpointAPI + "channels/"
  20. EndpointUsers = EndpointAPI + "users/"
  21. EndpointGateway = EndpointAPI + "gateway"
  22. EndpointWebhooks = EndpointAPI + "webhooks/"
  23. EndpointCDN = "https://cdn.discordapp.com/"
  24. EndpointCDNAttachments = EndpointCDN + "attachments/"
  25. EndpointCDNAvatars = EndpointCDN + "avatars/"
  26. EndpointCDNIcons = EndpointCDN + "icons/"
  27. EndpointCDNSplashes = EndpointCDN + "splashes/"
  28. EndpointCDNChannelIcons = EndpointCDN + "channel-icons/"
  29. EndpointAuth = EndpointAPI + "auth/"
  30. EndpointLogin = EndpointAuth + "login"
  31. EndpointLogout = EndpointAuth + "logout"
  32. EndpointVerify = EndpointAuth + "verify"
  33. EndpointVerifyResend = EndpointAuth + "verify/resend"
  34. EndpointForgotPassword = EndpointAuth + "forgot"
  35. EndpointResetPassword = EndpointAuth + "reset"
  36. EndpointRegister = EndpointAuth + "register"
  37. EndpointVoice = EndpointAPI + "/voice/"
  38. EndpointVoiceRegions = EndpointVoice + "regions"
  39. EndpointVoiceIce = EndpointVoice + "ice"
  40. EndpointTutorial = EndpointAPI + "tutorial/"
  41. EndpointTutorialIndicators = EndpointTutorial + "indicators"
  42. EndpointTrack = EndpointAPI + "track"
  43. EndpointSso = EndpointAPI + "sso"
  44. EndpointReport = EndpointAPI + "report"
  45. EndpointIntegrations = EndpointAPI + "integrations"
  46. EndpointUser = func(uID string) string { return EndpointUsers + uID }
  47. EndpointUserAvatar = func(uID, aID string) string { return EndpointCDNAvatars + uID + "/" + aID + ".png" }
  48. EndpointUserSettings = func(uID string) string { return EndpointUsers + uID + "/settings" }
  49. EndpointUserGuilds = func(uID string) string { return EndpointUsers + uID + "/guilds" }
  50. EndpointUserGuild = func(uID, gID string) string { return EndpointUsers + uID + "/guilds/" + gID }
  51. EndpointUserGuildSettings = func(uID, gID string) string { return EndpointUsers + uID + "/guilds/" + gID + "/settings" }
  52. EndpointUserChannels = func(uID string) string { return EndpointUsers + uID + "/channels" }
  53. EndpointUserDevices = func(uID string) string { return EndpointUsers + uID + "/devices" }
  54. EndpointUserConnections = func(uID string) string { return EndpointUsers + uID + "/connections" }
  55. EndpointGuild = func(gID string) string { return EndpointGuilds + gID }
  56. EndpointGuildInivtes = func(gID string) string { return EndpointGuilds + gID + "/invites" }
  57. EndpointGuildChannels = func(gID string) string { return EndpointGuilds + gID + "/channels" }
  58. EndpointGuildMembers = func(gID string) string { return EndpointGuilds + gID + "/members" }
  59. EndpointGuildMember = func(gID, uID string) string { return EndpointGuilds + gID + "/members/" + uID }
  60. EndpointGuildMemberRole = func(gID, uID, rID string) string { return EndpointGuilds + gID + "/members/" + uID + "/roles/" + rID }
  61. EndpointGuildBans = func(gID string) string { return EndpointGuilds + gID + "/bans" }
  62. EndpointGuildBan = func(gID, uID string) string { return EndpointGuilds + gID + "/bans/" + uID }
  63. EndpointGuildIntegrations = func(gID string) string { return EndpointGuilds + gID + "/integrations" }
  64. EndpointGuildIntegration = func(gID, iID string) string { return EndpointGuilds + gID + "/integrations/" + iID }
  65. EndpointGuildIntegrationSync = func(gID, iID string) string { return EndpointGuilds + gID + "/integrations/" + iID + "/sync" }
  66. EndpointGuildRoles = func(gID string) string { return EndpointGuilds + gID + "/roles" }
  67. EndpointGuildRole = func(gID, rID string) string { return EndpointGuilds + gID + "/roles/" + rID }
  68. EndpointGuildInvites = func(gID string) string { return EndpointGuilds + gID + "/invites" }
  69. EndpointGuildEmbed = func(gID string) string { return EndpointGuilds + gID + "/embed" }
  70. EndpointGuildPrune = func(gID string) string { return EndpointGuilds + gID + "/prune" }
  71. EndpointGuildIcon = func(gID, hash string) string { return EndpointCDNIcons + gID + "/" + hash + ".png" }
  72. EndpointGuildSplash = func(gID, hash string) string { return EndpointCDNSplashes + gID + "/" + hash + ".png" }
  73. EndpointGuildWebhooks = func(gID string) string { return EndpointGuilds + gID + "/webhooks" }
  74. EndpointChannel = func(cID string) string { return EndpointChannels + cID }
  75. EndpointChannelPermissions = func(cID string) string { return EndpointChannels + cID + "/permissions" }
  76. EndpointChannelPermission = func(cID, tID string) string { return EndpointChannels + cID + "/permissions/" + tID }
  77. EndpointChannelInvites = func(cID string) string { return EndpointChannels + cID + "/invites" }
  78. EndpointChannelTyping = func(cID string) string { return EndpointChannels + cID + "/typing" }
  79. EndpointChannelMessages = func(cID string) string { return EndpointChannels + cID + "/messages" }
  80. EndpointChannelMessage = func(cID, mID string) string { return EndpointChannels + cID + "/messages/" + mID }
  81. EndpointChannelMessageAck = func(cID, mID string) string { return EndpointChannels + cID + "/messages/" + mID + "/ack" }
  82. EndpointChannelMessagesBulkDelete = func(cID string) string { return EndpointChannel(cID) + "/messages/bulk_delete" }
  83. EndpointChannelMessagesPins = func(cID string) string { return EndpointChannel(cID) + "/pins" }
  84. EndpointChannelMessagePin = func(cID, mID string) string { return EndpointChannel(cID) + "/pins/" + mID }
  85. EndpointGroupIcon = func(cID, hash string) string { return EndpointCDNChannelIcons + cID + "/" + hash + ".png" }
  86. EndpointChannelWebhooks = func(cID string) string { return EndpointChannel(cID) + "/webhooks" }
  87. EndpointWebhook = func(wID string) string { return EndpointWebhooks + wID }
  88. EndpointWebhookToken = func(wID, token string) string { return EndpointWebhooks + wID + "/" + token }
  89. EndpointMessageReactions = func(cID, mID, eID string) string {
  90. return EndpointChannelMessage(cID, mID) + "/reactions/" + eID
  91. }
  92. EndpointMessageReaction = func(cID, mID, eID, uID string) string {
  93. return EndpointMessageReactions(cID, mID, eID) + "/" + uID
  94. }
  95. EndpointRelationships = func() string { return EndpointUsers + "@me" + "/relationships" }
  96. EndpointRelationship = func(uID string) string { return EndpointRelationships() + "/" + uID }
  97. EndpointRelationshipsMutual = func(uID string) string { return EndpointUsers + uID + "/relationships" }
  98. EndpointInvite = func(iID string) string { return EndpointAPI + "invite/" + iID }
  99. EndpointIntegrationsJoin = func(iID string) string { return EndpointAPI + "integrations/" + iID + "/join" }
  100. EndpointEmoji = func(eID string) string { return EndpointAPI + "emojis/" + eID + ".png" }
  101. EndpointOauth2 = EndpointAPI + "oauth2/"
  102. EndpointApplications = EndpointOauth2 + "applications"
  103. EndpointApplication = func(aID string) string { return EndpointApplications + "/" + aID }
  104. EndpointApplicationsBot = func(aID string) string { return EndpointApplications + "/" + aID + "/bot" }
  105. )