Skip to content

Commit 0a78d90

Browse files
committed
feat: Add message translation command, introduce new utilities for alerts, emojis, language mapping, and update build/API configurations.
1 parent 6498bbc commit 0a78d90

29 files changed

+1972
-1477
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Bug Report
22
description: Report a bug to help us improve Kaeru
3-
labels: ["bug"]
3+
labels: ['bug']
44

55
body:
66
- type: markdown

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Feature Request
22
description: Please explain what is in your mind, we would like to hear it!
3-
labels: "feature"
4-
assignees: "Neodevils"
3+
labels: 'feature'
4+
assignees: 'Neodevils'
55

66
body:
77
- type: markdown

.github/dependabot.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "npm"
4-
directory: "/"
3+
- package-ecosystem: 'npm'
4+
directory: '/'
55
schedule:
6-
interval: "weekly"
6+
interval: 'weekly'
77
open-pull-requests-limit: 5
8-
versioning-strategy: "increase-if-necessary"
8+
versioning-strategy: 'increase-if-necessary'
99
commit-message:
10-
prefix: "deps"
11-
include: "scope"
10+
prefix: 'deps'
11+
include: 'scope'

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions/setup-node@v4
2424
with:
2525
node-version: 18
26-
cache: "npm"
26+
cache: 'npm'
2727

2828
- name: Install dependencies
2929
run: npm ci

.prettierrc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
"semi": true,
33
"singleQuote": false,
4-
"printWidth": 100,
5-
"tabWidth": 2,
64
"trailingComma": "all",
5+
"printWidth": 100,
6+
"tabWidth": 4,
7+
"useTabs": true,
78
"bracketSpacing": true,
8-
"arrowParens": "avoid",
9-
"useTabs": true
9+
"arrowParens": "always",
10+
"endOfLine": "lf",
11+
"quoteProps": "as-needed"
1012
}

api/discord-oauth-callback.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
import { MiniDatabase } from "@minesa-org/mini-interaction";
2-
import { mini } from "./interactions.js";
3-
import { updateDiscordMetadata } from "../src/utils/database.js";
1+
import { MiniDatabase } from '@minesa-org/mini-interaction'
2+
import { mini } from './interactions.js'
3+
import { updateDiscordMetadata } from '../src/utils/database.js'
44

5-
const database = MiniDatabase.fromEnv();
6-
const failedPage = mini.failedOAuthPage("public/pages/failed.html");
5+
const database = MiniDatabase.fromEnv()
6+
const failedPage = mini.failedOAuthPage('public/pages/failed.html')
77

88
export default mini.discordOAuthCallback({
9-
templates: {
10-
success: mini.connectedOAuthPage("public/pages/connected.html"),
11-
missingCode: failedPage,
12-
oauthError: failedPage,
13-
invalidState: failedPage,
14-
serverError: failedPage,
15-
},
16-
async onAuthorize({ user, tokens }: { user: any; tokens: any }) {
17-
await database.set(user.id, {
18-
accessToken: tokens.access_token,
19-
refreshToken: tokens.refresh_token,
20-
expiresAt: tokens.expires_at,
21-
scope: tokens.scope,
22-
});
9+
templates: {
10+
success: mini.connectedOAuthPage('public/pages/connected.html'),
11+
missingCode: failedPage,
12+
oauthError: failedPage,
13+
invalidState: failedPage,
14+
serverError: failedPage
15+
},
16+
async onAuthorize({ user, tokens }: { user: any; tokens: any }) {
17+
await database.set(user.id, {
18+
accessToken: tokens.access_token,
19+
refreshToken: tokens.refresh_token,
20+
expiresAt: tokens.expires_at,
21+
scope: tokens.scope
22+
})
2323

24-
await updateDiscordMetadata(user.id, tokens.access_token);
25-
},
26-
});
24+
await updateDiscordMetadata(user.id, tokens.access_token)
25+
}
26+
})

api/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { mini } from "./interactions.js";
1+
import { mini } from './interactions.js'
22

33
export default mini.discordOAuthVerificationPage({
4-
htmlFile: "index.html",
5-
});
4+
htmlFile: 'index.html'
5+
})

api/interactions.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { MiniInteraction } from "@minesa-org/mini-interaction";
1+
import { MiniInteraction } from '@minesa-org/mini-interaction'
22

3-
export const mini = new MiniInteraction();
3+
export const mini = new MiniInteraction()
44

55
export default mini.createNodeHandler({
6-
waitUntil: async (promise) => {
7-
try {
8-
const { waitUntil } = await import("@vercel/functions");
9-
waitUntil(promise);
10-
} catch (e) {
11-
console.log(e);
12-
}
13-
},
14-
});
6+
waitUntil: async (promise) => {
7+
try {
8+
const { waitUntil } = await import('@vercel/functions')
9+
waitUntil(promise)
10+
} catch (e) {
11+
console.log(e)
12+
}
13+
}
14+
})

index.html

Lines changed: 97 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,106 @@
11
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>Linked Roles Redirect</title>
7-
</head>
8-
<body
9-
style="
10-
background: url(&quot;https://media.discordapp.net/attachments/736571695170584576/1226985772033249372/background.png?format=webp&quality=lossless&width=940&height=740&quot;)
11-
top left repeat;
12-
background-color: rgb(49, 48, 48);
13-
color: #cbcbcb;
14-
font-family:
15-
system-ui,
16-
-apple-system,
17-
BlinkMacSystemFont,
18-
&quot;Segoe UI&quot;,
19-
Roboto,
20-
Oxygen,
21-
Ubuntu,
22-
Cantarell,
23-
&quot;Open Sans&quot;,
24-
&quot;Helvetica Neue&quot;,
25-
sans-serif;
26-
letter-spacing: -1.2%;
27-
width: 100vw;
28-
height: 100vh;
29-
display: flex;
30-
justify-content: center;
31-
align-items: center;
32-
flex-direction: column;
33-
overflow: hidden;
34-
"
35-
>
36-
<div style="display: flex; align-items: center">
37-
<!-- Discord Logo -->
38-
<svg
39-
fill="none"
40-
height="88"
41-
viewBox="0 0 77 88"
42-
width="77"
43-
xmlns="http://www.w3.org/2000/svg"
44-
style="width: 88px; height: 88px"
45-
>
46-
<path
47-
clip-rule="evenodd"
48-
d="m65.2166 19.7044c-5.0656-2.3394-10.4047-3.9856-15.8822-4.9213-.7468 1.3552-1.4319 2.743-2.0363 4.1631-5.8278-.8716-11.7672-.8716-17.5989 0-.6198-1.4201-1.3011-2.8079-2.0479-4.1471-5.4968.9361-10.8358 2.5819-15.9015 4.9217-10.0698 14.958-12.78733 29.5608-11.420825 43.9377 5.893285 4.3727 12.483225 7.6967 19.488925 9.8266 1.5744-2.1299 2.9717-4.4048 4.165-6.7771-2.2749-.8551-4.4805-1.9038-6.5784-3.1625.5581-.4031 1.097-.8067 1.6205-1.2587 12.3409 5.8414 26.6063 5.8414 38.9511 0 .5235.436 1.0624.8556 1.6013 1.2587-2.094 1.2426-4.3035 2.3074-6.5746 3.1625 1.2087 2.3723 2.5905 4.6312 4.1611 6.7611 7.0057-2.1299 13.5958-5.4539 19.4891-9.8266h.0191c1.6013-16.6522-2.7329-31.11-11.4555-43.9381zm-39.5092 35.1085c-3.7993 0-6.9287-3.5015-6.9287-7.7612 0-4.2598 3.0524-7.7613 6.9287-7.7613 3.8762 0 6.9865 3.5015 6.9249 7.7613 0 4.2597-3.0679 7.7612-6.9249 7.7612zm25.5748 0c-3.7993 0-6.9288-3.5015-6.9288-7.7612 0-4.2598 3.0679-7.7613 6.9288-7.7613 3.857 0 6.9864 3.5015 6.9248 7.7613 0 4.2597-3.0678 7.7612-6.9248 7.7612z"
49-
fill="#fff"
50-
fill-rule="evenodd"
51-
/>
52-
</svg>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Linked Roles Redirect</title>
7+
</head>
8+
<body
9+
style="
10+
background: url('https://media.discordapp.net/attachments/736571695170584576/1226985772033249372/background.png?format=webp&quality=lossless&width=940&height=740')
11+
top left repeat;
12+
background-color: rgb(49, 48, 48);
13+
color: #cbcbcb;
14+
font-family:
15+
system-ui,
16+
-apple-system,
17+
BlinkMacSystemFont,
18+
'Segoe UI',
19+
Roboto,
20+
Oxygen,
21+
Ubuntu,
22+
Cantarell,
23+
'Open Sans',
24+
'Helvetica Neue',
25+
sans-serif;
26+
letter-spacing: -1.2%;
27+
width: 100vw;
28+
height: 100vh;
29+
display: flex;
30+
justify-content: center;
31+
align-items: center;
32+
flex-direction: column;
33+
overflow: hidden;
34+
"
35+
>
36+
<div style="display: flex; align-items: center">
37+
<!-- Discord Logo -->
38+
<svg
39+
fill="none"
40+
height="88"
41+
viewBox="0 0 77 88"
42+
width="77"
43+
xmlns="http://www.w3.org/2000/svg"
44+
style="width: 88px; height: 88px"
45+
>
46+
<path
47+
clip-rule="evenodd"
48+
d="m65.2166 19.7044c-5.0656-2.3394-10.4047-3.9856-15.8822-4.9213-.7468 1.3552-1.4319 2.743-2.0363 4.1631-5.8278-.8716-11.7672-.8716-17.5989 0-.6198-1.4201-1.3011-2.8079-2.0479-4.1471-5.4968.9361-10.8358 2.5819-15.9015 4.9217-10.0698 14.958-12.78733 29.5608-11.420825 43.9377 5.893285 4.3727 12.483225 7.6967 19.488925 9.8266 1.5744-2.1299 2.9717-4.4048 4.165-6.7771-2.2749-.8551-4.4805-1.9038-6.5784-3.1625.5581-.4031 1.097-.8067 1.6205-1.2587 12.3409 5.8414 26.6063 5.8414 38.9511 0 .5235.436 1.0624.8556 1.6013 1.2587-2.094 1.2426-4.3035 2.3074-6.5746 3.1625 1.2087 2.3723 2.5905 4.6312 4.1611 6.7611 7.0057-2.1299 13.5958-5.4539 19.4891-9.8266h.0191c1.6013-16.6522-2.7329-31.11-11.4555-43.9381zm-39.5092 35.1085c-3.7993 0-6.9287-3.5015-6.9287-7.7612 0-4.2598 3.0524-7.7613 6.9287-7.7613 3.8762 0 6.9865 3.5015 6.9249 7.7613 0 4.2597-3.0679 7.7612-6.9249 7.7612zm25.5748 0c-3.7993 0-6.9288-3.5015-6.9288-7.7612 0-4.2598 3.0679-7.7613 6.9288-7.7613 3.857 0 6.9864 3.5015 6.9248 7.7613 0 4.2597-3.0678 7.7612-6.9248 7.7612z"
49+
fill="#fff"
50+
fill-rule="evenodd"
51+
/>
52+
</svg>
5353

54-
<!-- Plus Icon -->
55-
<svg
56-
height="28"
57-
viewBox="0 0 28 28"
58-
width="28"
59-
xmlns="http://www.w3.org/2000/svg"
60-
style="width: 28px; height: 28px; margin: 1em 37px"
61-
>
62-
<path
63-
d="m138 42h-10.008756c-1.091346 0-1.991244.8954305-1.991244 2 0 1.1122704.89151 2 1.991244 2h10.008756v10.0087557c0 1.0913468.895431 1.9912443 2 1.9912443 1.11227 0 2-.8915104 2-1.9912443v-10.0087557h10.008756c1.091346 0 1.991244-.8954305 1.991244-2 0-1.1122704-.89151-2-1.991244-2h-10.008756v-10.0087557c0-1.0913468-.895431-1.9912443-2-1.9912443-1.11227 0-2 .8915104-2 1.9912443z"
64-
fill="#949cf7"
65-
fill-rule="evenodd"
66-
transform="translate(-126 -30)"
67-
/>
68-
</svg>
54+
<!-- Plus Icon -->
55+
<svg
56+
height="28"
57+
viewBox="0 0 28 28"
58+
width="28"
59+
xmlns="http://www.w3.org/2000/svg"
60+
style="width: 28px; height: 28px; margin: 1em 37px"
61+
>
62+
<path
63+
d="m138 42h-10.008756c-1.091346 0-1.991244.8954305-1.991244 2 0 1.1122704.89151 2 1.991244 2h10.008756v10.0087557c0 1.0913468.895431 1.9912443 2 1.9912443 1.11227 0 2-.8915104 2-1.9912443v-10.0087557h10.008756c1.091346 0 1.991244-.8954305 1.991244-2 0-1.1122704-.89151-2-1.991244-2h-10.008756v-10.0087557c0-1.0913468-.895431-1.9912443-2-1.9912443-1.11227 0-2 .8915104-2 1.9912443z"
64+
fill="#949cf7"
65+
fill-rule="evenodd"
66+
transform="translate(-126 -30)"
67+
/>
68+
</svg>
6969

70-
<!-- Logo Placeholder -->
71-
<div
72-
style="
73-
width: 88px;
74-
height: 88px;
75-
border-radius: 100%;
76-
border: 3px solid #949494;
77-
border-style: dashed;
78-
background: #1d1d1d;
79-
display: flex;
80-
align-items: center;
81-
justify-content: center;
82-
"
83-
></div>
84-
</div>
70+
<!-- Logo Placeholder -->
71+
<div
72+
style="
73+
width: 88px;
74+
height: 88px;
75+
border-radius: 100%;
76+
border: 3px solid #949494;
77+
border-style: dashed;
78+
background: #1d1d1d;
79+
display: flex;
80+
align-items: center;
81+
justify-content: center;
82+
"
83+
></div>
84+
</div>
8585

86-
<div style="margin-top: 16px; color: hsl(0 0% 100%); text-align: center">
87-
Redirecting to <strong>Discord</strong> to verify your linked roles
88-
</div>
86+
<div style="margin-top: 16px; color: hsl(0 0% 100%); text-align: center">
87+
Redirecting to <strong>Discord</strong> to verify your linked roles
88+
</div>
8989

90-
<div style="margin-top: 16px; font-size: 16px; color: hsl(214 8.1% 61.2%); text-align: center">
91-
This only takes a moment.
92-
</div>
90+
<div style="margin-top: 16px; font-size: 16px; color: hsl(214 8.1% 61.2%); text-align: center">
91+
This only takes a moment.
92+
</div>
9393

94-
<script>
95-
const oauthUrl = "{{OAUTH_URL_RAW}}";
96-
const isPlaceholder =
97-
typeof oauthUrl !== "string" || !oauthUrl.length || oauthUrl.includes("{{");
94+
<script>
95+
const oauthUrl = '{{OAUTH_URL_RAW}}'
96+
const isPlaceholder =
97+
typeof oauthUrl !== 'string' || !oauthUrl.length || oauthUrl.includes('{{')
9898

99-
if (!isPlaceholder) {
100-
window.location.replace(oauthUrl);
101-
} else {
102-
document.querySelector("div:nth-of-type(2)").innerHTML = "<strong>ERROR</strong>";
103-
}
104-
</script>
105-
</body>
99+
if (!isPlaceholder) {
100+
window.location.replace(oauthUrl)
101+
} else {
102+
document.querySelector('div:nth-of-type(2)').innerHTML = '<strong>ERROR</strong>'
103+
}
104+
</script>
105+
</body>
106106
</html>

0 commit comments

Comments
 (0)