endpoints.go 6.0 KB

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