From dba1976a8e2640700c425b7efe64507027840bab Mon Sep 17 00:00:00 2001 From: "Ean Milligan (Bastion)" Date: Wed, 22 Jun 2022 01:57:38 -0400 Subject: [PATCH] Add messages to all api calls --- src/api.ts | 2 +- src/endpoints/deletes/apiKeyDelete.ts | 4 ++-- src/endpoints/gets/apiChannel.ts | 4 ++-- src/endpoints/gets/apiKey.ts | 4 ++-- src/endpoints/gets/apiKeyAdmin.ts | 4 ++-- src/endpoints/gets/apiRoll.ts | 2 +- src/endpoints/posts/apiChannelAdd.ts | 4 ++-- src/endpoints/puts/apiChannelManageActive.ts | 4 ++-- src/endpoints/puts/apiChannelManageBan.ts | 4 ++-- src/endpoints/puts/apiKeyManage.ts | 4 ++-- src/endpoints/stdResponses.ts | 4 ++++ 11 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/api.ts b/src/api.ts index b18cde4..a187a81 100644 --- a/src/api.ts +++ b/src/api.ts @@ -205,7 +205,7 @@ const start = async (): Promise => { requestEvent.respondWith(stdResp.TooManyRequests('Slow down, servers are expensive and this bot is free to use.')); } else { // Alert API user that they shouldn't be doing this - requestEvent.respondWith(stdResp.Forbidden('')); + requestEvent.respondWith(stdResp.Forbidden('Why are you here?')); } } })(); diff --git a/src/endpoints/deletes/apiKeyDelete.ts b/src/endpoints/deletes/apiKeyDelete.ts index 23f6db0..b14e811 100644 --- a/src/endpoints/deletes/apiKeyDelete.ts +++ b/src/endpoints/deletes/apiKeyDelete.ts @@ -76,10 +76,10 @@ export const apiKeyDelete = async (requestEvent: Deno.RequestEvent, query: Map genericResponse(customText, Status.OK), RequestTimeout: (customText: string) => genericResponse(customText, Status.RequestTimeout), TooManyRequests: (customText: string) => genericResponse(customText, Status.TooManyRequests), + Strings: { + missingParams: 'Missing Parameters.', + restricted: 'This API is restricted.', + }, };