mirror of
https://github.com/Burn-E99/TheArtificer.git
synced 2026-06-04 09:03:50 -04:00
deno fmt
This commit is contained in:
@@ -10,22 +10,22 @@ import { apiChannelManageBan } from './puts/apiChannelManageBan.ts';
|
||||
import { apiChannelManageActive } from './puts/apiChannelManageActive.ts';
|
||||
|
||||
export default {
|
||||
delete: {
|
||||
apiKeyDelete,
|
||||
},
|
||||
get: {
|
||||
apiKey,
|
||||
apiRoll,
|
||||
apiKeyAdmin,
|
||||
apiChannel,
|
||||
heatmapPng,
|
||||
},
|
||||
post: {
|
||||
apiChannelAdd,
|
||||
},
|
||||
put: {
|
||||
apiKeyManage,
|
||||
apiChannelManageBan,
|
||||
apiChannelManageActive,
|
||||
},
|
||||
delete: {
|
||||
apiKeyDelete,
|
||||
},
|
||||
get: {
|
||||
apiKey,
|
||||
apiRoll,
|
||||
apiKeyAdmin,
|
||||
apiChannel,
|
||||
heatmapPng,
|
||||
},
|
||||
post: {
|
||||
apiChannelAdd,
|
||||
},
|
||||
put: {
|
||||
apiKeyManage,
|
||||
apiChannelManageBan,
|
||||
apiChannelManageActive,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@ export const apiKeyDelete = async (
|
||||
query: Map<string, string>,
|
||||
apiUserid: BigInt,
|
||||
apiUserEmail: string,
|
||||
apiUserDelCode: string
|
||||
apiUserDelCode: string,
|
||||
) => {
|
||||
if (query.has('user') && (query.get('user') || '').length > 0 && query.has('email') && (query.get('email') || '').length > 0) {
|
||||
if (apiUserid === BigInt(query.get('user') || '0') && apiUserEmail === query.get('email')) {
|
||||
|
||||
@@ -103,13 +103,15 @@ export const apiRoll = async (requestEvent: Deno.RequestEvent, query: Map<string
|
||||
};
|
||||
|
||||
// Parse the roll and get the return text
|
||||
await queueRoll(<QueuedRoll>{
|
||||
apiRoll: true,
|
||||
api: { requestEvent, channelId: BigInt(query.get('channel') || '0'), userId: BigInt(query.get('user') || '') },
|
||||
rollCmd,
|
||||
modifiers,
|
||||
originalCommand,
|
||||
});
|
||||
await queueRoll(
|
||||
<QueuedRoll> {
|
||||
apiRoll: true,
|
||||
api: { requestEvent, channelId: BigInt(query.get('channel') || '0'), userId: BigInt(query.get('user') || '') },
|
||||
rollCmd,
|
||||
modifiers,
|
||||
originalCommand,
|
||||
},
|
||||
);
|
||||
} catch (err) {
|
||||
// Handle any errors we missed
|
||||
log(LT.ERROR, `Unhandled Error: ${JSON.stringify(err)}`);
|
||||
@@ -119,8 +121,8 @@ export const apiRoll = async (requestEvent: Deno.RequestEvent, query: Map<string
|
||||
// Alert API user that they messed up
|
||||
requestEvent.respondWith(
|
||||
stdResp.Forbidden(
|
||||
`Verify you are a member of the guild you are sending this roll to. If you are, the ${config.name} may not have that registered, please send a message in the guild so ${config.name} can register this. This registration is temporary, so if you see this error again, just poke your server again.`
|
||||
)
|
||||
`Verify you are a member of the guild you are sending this roll to. If you are, the ${config.name} may not have that registered, please send a message in the guild so ${config.name} can register this. This registration is temporary, so if you see this error again, just poke your server again.`,
|
||||
),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -14,6 +14,6 @@ export const heatmapPng = async (requestEvent: Deno.RequestEvent) => {
|
||||
status: STATUS_CODE.OK,
|
||||
statusText: STATUS_TEXT[STATUS_CODE.OK],
|
||||
headers: imageHeaders,
|
||||
})
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import {
|
||||
// httpd deps
|
||||
StatusCode,
|
||||
STATUS_CODE,
|
||||
STATUS_TEXT,
|
||||
// httpd deps
|
||||
StatusCode,
|
||||
} from '../../deps.ts';
|
||||
|
||||
const genericResponse = (customText: string, status: StatusCode) =>
|
||||
new Response(customText || STATUS_TEXT[status], { status: status, statusText: STATUS_TEXT[status] });
|
||||
const genericResponse = (customText: string, status: StatusCode) => new Response(customText || STATUS_TEXT[status], { status: status, statusText: STATUS_TEXT[status] });
|
||||
|
||||
export default {
|
||||
BadRequest: (customText: string) => genericResponse(customText, STATUS_CODE.BadRequest),
|
||||
|
||||
Reference in New Issue
Block a user