endpoints.go 7.5 KB

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