2626
2727import static net .dv8tion .jda .core .requests .Method .*;
2828
29+ @ SuppressWarnings ("unused" )
2930public class Route
3031{
3132 public static class Misc
3233 {
33- public static final Route GET_VOICE_REGIONS = new Route (GET , "voice/regions " );
34- public static final Route GATEWAY = new Route (GET , "gateway " );
35- public static final Route GATEWAY_BOT = new Route (GET , "gateway/bot " );
36- public static final Route TRACK = new Route (POST , "track " );
34+ public static final Route TRACK = new Route (POST , true , "track " );
35+ public static final Route GET_VOICE_REGIONS = new Route (GET , true , "voice/regions " );
36+ public static final Route GATEWAY = new Route (GET , true , "gateway" );
37+ public static final Route GATEWAY_BOT = new Route (GET , true , "gateway/bot " );
3738 }
3839
3940 public static class Applications
@@ -57,17 +58,15 @@ public static class Applications
5758 public static final Route GET_AUTHORIZED_APPLICATION = new Route (GET , "oauth2/tokens/{auth_id}" );
5859 public static final Route DELETE_AUTHORIZED_APPLICATION = new Route (DELETE , "oauth2/tokens/{auth_id}" );
5960 }
60-
61+
6162 public static class Self
6263 {
63- public static final Route GET_SELF = new Route (GET , "users/@me" );
64- public static final Route MODIFY_SELF = new Route (PATCH , "users/@me" );
65- public static final Route GET_GUILDS = new Route (GET , "users/@me/guilds" );
66- public static final Route LEAVE_GUILD = new Route (DELETE , "users/@me/guilds/{guild_id}" );
67- public static final Route GET_PRIVATE_CHANNELS = new Route (GET , "users/@me/channels" );
68- public static final Route CREATE_PRIVATE_CHANNEL = new Route (POST , "users/@me/channels" );
69-
70- public static final Route GATEWAY_BOT = new Route (GET , "gateway/bot" );
64+ public static final Route GET_SELF = new Route (GET , true , "users/@me" );
65+ public static final Route MODIFY_SELF = new Route (PATCH , "users/@me" );
66+ public static final Route GET_GUILDS = new Route (GET , "users/@me/guilds" );
67+ public static final Route LEAVE_GUILD = new Route (DELETE , "users/@me/guilds/{guild_id}" );
68+ public static final Route GET_PRIVATE_CHANNELS = new Route (GET , "users/@me/channels" );
69+ public static final Route CREATE_PRIVATE_CHANNEL = new Route (POST , "users/@me/channels" );
7170
7271 // Client only
7372 public static final Route USER_SETTINGS = new Route (GET , "users/@me/settings" );
@@ -115,8 +114,8 @@ public static class Guilds
115114 public static final Route GET_GUILD_EMBED = new Route (GET , "guilds/{guild_id}/embed" , "guild_id" );
116115 public static final Route MODIFY_GUILD_EMBED = new Route (PATCH , "guilds/{guild_id}/embed" , "guild_id" );
117116 public static final Route GET_GUILD_EMOTES = new Route (GET , "guilds/{guild_id}/emojis" , "guild_id" );
118- public static final Route GET_AUDIT_LOGS = new Route (GET , "guilds/{guild_id}/audit-logs" , "guild_id" );
119- public static final Route GET_VOICE_REGIONS = new Route (GET , "guilds/{guild_id}/regions" , "guild_id" );
117+ public static final Route GET_AUDIT_LOGS = new Route (GET , true , "guilds/{guild_id}/audit-logs" , "guild_id" );
118+ public static final Route GET_VOICE_REGIONS = new Route (GET , true , "guilds/{guild_id}/regions" , "guild_id" );
120119
121120 public static final Route GET_INTEGRATIONS = new Route (GET , "guilds/{guild_id}/integrations" , "guild_id" );
122121 public static final Route CREATE_INTEGRATION = new Route (POST , "guilds/{guild_id}/integrations" , "guild_id" );
@@ -194,7 +193,6 @@ public static class Messages
194193 {
195194 public static final Route SEND_MESSAGE = new Route (POST , "channels/{channel_id}/messages" , "channel_id" );
196195 public static final Route EDIT_MESSAGE = new Route (PATCH , "channels/{channel_id}/messages/{message_id}" , "channel_id" );
197- public static final Route DELETE_MESSAGE = new Route (DELETE , "channels/{channel_id}/messages/{message_id}" , "channel_id" );
198196 public static final Route GET_PINNED_MESSAGES = new Route (GET , "channels/{channel_id}/pins" , "channel_id" );
199197 public static final Route ADD_PINNED_MESSAGE = new Route (PUT , "channels/{channel_id}/pins/{message_id}" , "channel_id" );
200198 public static final Route REMOVE_PINNED_MESSAGE = new Route (DELETE , "channels/{channel_id}/pins/{message_id}" , "channel_id" );
@@ -206,23 +204,24 @@ public static class Messages
206204 public static final Route REMOVE_ALL_REACTIONS = new Route (DELETE , "channels/{channel_id}/messages/{message_id}/reactions" , "channel_id" );
207205 public static final Route GET_REACTION_USERS = new Route (GET , "channels/{channel_id}/messages/{message_id}/reactions/{reaction_code}" , "channel_id" );
208206
209- public static final Route GET_MESSAGE_HISTORY = new Route (GET , "channels/{channel_id}/messages" , "channel_id" );
207+ public static final Route DELETE_MESSAGE = new Route (DELETE , true , "channels/{channel_id}/messages/{message_id}" , "channel_id" );
208+ public static final Route GET_MESSAGE_HISTORY = new Route (GET , true , "channels/{channel_id}/messages" , "channel_id" );
210209
211210 //Bot only
212- public static final Route GET_MESSAGE = new Route (GET , "channels/{channel_id}/messages/{message_id}" , "channel_id" );
213- public static final Route DELETE_MESSAGES = new Route (POST , "channels/{channel_id}/messages/bulk-delete" , "channel_id" );
211+ public static final Route GET_MESSAGE = new Route (GET , true , "channels/{channel_id}/messages/{message_id}" , "channel_id" );
212+ public static final Route DELETE_MESSAGES = new Route (POST , "channels/{channel_id}/messages/bulk-delete" , "channel_id" );
214213
215214 //Client only
216215 public static final Route ACK_MESSAGE = new Route (POST , "channels/{channel_id}/messages/{message_id}/ack" );
217216 }
218217
219218 public static class Invites
220219 {
221- public static final Route GET_INVITE = new Route (GET , "invites/{code}" );
222- public static final Route DELETE_INVITE = new Route (DELETE , "invites/{code} " );
223- public static final Route GET_GUILD_INVITES = new Route (GET , "guilds/{guild_id }/invites" , "guild_id " );
224- public static final Route GET_CHANNEL_INVITES = new Route (GET , "channels/{channel_id}/invites" , "channel_id" );
225- public static final Route CREATE_INVITE = new Route (POST , "channels/{channel_id}/invites" , "channel_id " );
220+ public static final Route GET_INVITE = new Route (GET , true , "invites/{code}" );
221+ public static final Route GET_GUILD_INVITES = new Route (GET , true , "guilds/{guild_id}/invites" , "guild_id " );
222+ public static final Route GET_CHANNEL_INVITES = new Route (GET , true , "channels/{channel_id }/invites" , "channel_id " );
223+ public static final Route CREATE_INVITE = new Route (POST , "channels/{channel_id}/invites" , "channel_id" );
224+ public static final Route DELETE_INVITE = new Route (DELETE , "invites/{code} " );
226225 }
227226
228227 public static class Custom
@@ -241,15 +240,27 @@ public static class Custom
241240 private final Method method ;
242241 private final List <Integer > majorParamIndexes = new ArrayList <>();
243242 private final RateLimit ratelimit ;
243+ private final boolean missingHeaders ;
244244
245245 private Route (Method method , String route , String ... majorParameters )
246246 {
247- this (method , null , route , majorParameters );
247+ this (method , null , false , route , majorParameters );
248248 }
249249
250250 private Route (Method method , RateLimit rateLimit , String route , String ... majorParameters )
251+ {
252+ this (method , rateLimit , false , route , majorParameters );
253+ }
254+
255+ private Route (Method method , boolean missingHeaders , String route , String ... majorParameters )
256+ {
257+ this (method , null , missingHeaders , route , majorParameters );
258+ }
259+
260+ private Route (Method method , RateLimit rateLimit , boolean missingHeaders , String route , String ... majorParameters )
251261 {
252262 this .method = method ;
263+ this .missingHeaders = missingHeaders ;
253264 this .ratelimit = rateLimit ;
254265 this .route = route ;
255266 this .paramCount = Helpers .countMatches (route , '{' ); //All parameters start with {
@@ -303,6 +314,11 @@ public String getRoute()
303314 return route ;
304315 }
305316
317+ public boolean isMissingHeaders ()
318+ {
319+ return missingHeaders ;
320+ }
321+
306322 public String getRatelimitRoute ()
307323 {
308324 return ratelimitRoute ;
0 commit comments