mirror of
https://github.com/xHyroM/roles-bot.git
synced 2024-11-22 08:21:05 +01:00
nextjs + new client id
This commit is contained in:
parent
a4beab6615
commit
b0841b319c
25 changed files with 9780 additions and 218 deletions
2
.github/workflows/pages.yml
vendored
2
.github/workflows/pages.yml
vendored
|
@ -16,4 +16,4 @@ jobs:
|
||||||
uses: JamesIves/github-pages-deploy-action@4.1.4
|
uses: JamesIves/github-pages-deploy-action@4.1.4
|
||||||
with:
|
with:
|
||||||
branch: gh-pages
|
branch: gh-pages
|
||||||
folder: src/web
|
folder: src/web-old
|
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
@ -4,7 +4,7 @@
|
||||||
{
|
{
|
||||||
"format": "expanded",
|
"format": "expanded",
|
||||||
"extensionName": ".css",
|
"extensionName": ".css",
|
||||||
"savePath": "/src/web/dist"
|
"savePath": "/src/web/styles/css"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -4,4 +4,4 @@
|
||||||
|
|
||||||
Discord bot for reaction roles that works with [Cloudflare Workers](https://workers.cloudflare.com/).
|
Discord bot for reaction roles that works with [Cloudflare Workers](https://workers.cloudflare.com/).
|
||||||
|
|
||||||
You can add the bot to your server, just click [here](https://discord.com/api/oauth2/authorize?client_id=905540851718037565&permissions=268435456&scope=bot%20applications.commands).
|
You can add the bot to your server, just click [here](https://discord.com/api/oauth2/authorize?client_id=923267906941370368&permissions=268435456&scope=bot%20applications.commands).
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
module.exports = {
|
||||||
"message": "lol",
|
"message": "lol",
|
||||||
"channel": "862700556438732851",
|
"channel": "862700556438732851",
|
||||||
"roles": [
|
"roles": [
|
3
src/web/.eslintrc.json
Normal file
3
src/web/.eslintrc.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"extends": "next/core-web-vitals"
|
||||||
|
}
|
37
src/web/.gitignore
vendored
Normal file
37
src/web/.gitignore
vendored
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
/node_modules
|
||||||
|
/.pnp
|
||||||
|
.pnp.js
|
||||||
|
|
||||||
|
# testing
|
||||||
|
/coverage
|
||||||
|
|
||||||
|
# next.js
|
||||||
|
/.next/
|
||||||
|
/out/
|
||||||
|
|
||||||
|
# production
|
||||||
|
/build
|
||||||
|
|
||||||
|
# misc
|
||||||
|
.DS_Store
|
||||||
|
*.pem
|
||||||
|
|
||||||
|
# debug
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env.local
|
||||||
|
.env.development.local
|
||||||
|
.env.test.local
|
||||||
|
.env.production.local
|
||||||
|
|
||||||
|
# vercel
|
||||||
|
.vercel
|
||||||
|
|
||||||
|
# typescript
|
||||||
|
*.tsbuildinfo
|
34
src/web/README.md
Normal file
34
src/web/README.md
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
First, run the development server:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run dev
|
||||||
|
# or
|
||||||
|
yarn dev
|
||||||
|
```
|
||||||
|
|
||||||
|
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||||
|
|
||||||
|
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
|
||||||
|
|
||||||
|
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
|
||||||
|
|
||||||
|
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
|
||||||
|
|
||||||
|
## Learn More
|
||||||
|
|
||||||
|
To learn more about Next.js, take a look at the following resources:
|
||||||
|
|
||||||
|
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||||
|
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||||
|
|
||||||
|
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
|
||||||
|
|
||||||
|
## Deploy on Vercel
|
||||||
|
|
||||||
|
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
||||||
|
|
||||||
|
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
5
src/web/next-env.d.ts
vendored
Normal file
5
src/web/next-env.d.ts
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
/// <reference types="next" />
|
||||||
|
/// <reference types="next/image-types/global" />
|
||||||
|
|
||||||
|
// NOTE: This file should not be edited
|
||||||
|
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
9404
src/web/package-lock.json
generated
Normal file
9404
src/web/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
22
src/web/package.json
Normal file
22
src/web/package.json
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"name": "web",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"dev": "next dev",
|
||||||
|
"build": "next build",
|
||||||
|
"start": "next start",
|
||||||
|
"lint": "next lint"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"next": "12.0.7",
|
||||||
|
"react": "17.0.2",
|
||||||
|
"react-dom": "17.0.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "17.0.2",
|
||||||
|
"@types/react": "17.0.37",
|
||||||
|
"eslint": "8.5.0",
|
||||||
|
"eslint-config-next": "12.0.7",
|
||||||
|
"typescript": "4.5.4"
|
||||||
|
}
|
||||||
|
}
|
6
src/web/pages/_app.tsx
Normal file
6
src/web/pages/_app.tsx
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import '../styles/css/style.css';
|
||||||
|
import type { AppProps } from 'next/app';
|
||||||
|
|
||||||
|
export default function MyApp({ Component, pageProps }: AppProps) {
|
||||||
|
return <Component {...pageProps} />
|
||||||
|
}
|
31
src/web/pages/index.tsx
Normal file
31
src/web/pages/index.tsx
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
import Head from "next/head";
|
||||||
|
|
||||||
|
export default function Home() {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Head>
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/styles/default.min.css" />
|
||||||
|
</Head>
|
||||||
|
<section className="flex-container">
|
||||||
|
<div className="container animate__animated animate__fadeIn">
|
||||||
|
<h1>Generate</h1>
|
||||||
|
<form>
|
||||||
|
<input placeholder="Your Message" name="message" id="message"/><br />
|
||||||
|
<input placeholder="Channel Id" name="channel" id="channel"/>
|
||||||
|
</form>
|
||||||
|
<button id="addRole">Add Role</button>
|
||||||
|
<button id="buttonCopy">Copy</button>
|
||||||
|
<img src="slash.png" className="responsive" />
|
||||||
|
<pre className={`hljs language-json copy`} id="jsonPre"><code id="json" className="code"></code></pre>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<script src="https://kit.fontawesome.com/5acf4d9e80.js" crossOrigin="anonymous"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/highlight.min.js"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||||
|
<script src="script.js"></script>
|
||||||
|
<script>hljs.initHighlightingOnLoad();</script>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 122 KiB |
|
@ -12,9 +12,9 @@ $('button[id=addRole]').click((e) => {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: 'Add Role',
|
title: 'Add Role',
|
||||||
html:
|
html:
|
||||||
'<input id="swal-input1" class="swal2-input" placeholder="Button Label*" required>' +
|
'<input id="swal-input1" class="swal2-input" placeholder="Button Label*" required />' +
|
||||||
'<input id="swal-input2" class="swal2-input" placeholder="Role Id*" required>' +
|
'<input id="swal-input2" class="swal2-input" placeholder="Role Id*" required />' +
|
||||||
'<input id="swal-input3" class="swal2-input" placeholder="Emoji">',
|
'<input id="swal-input3" class="swal2-input" placeholder="Emoji" />',
|
||||||
preConfirm: function () {
|
preConfirm: function () {
|
||||||
return new Promise(function (resolve) {
|
return new Promise(function (resolve) {
|
||||||
resolve([
|
resolve([
|
||||||
|
@ -23,7 +23,7 @@ $('button[id=addRole]').click((e) => {
|
||||||
$('#swal-input3').val()
|
$('#swal-input3').val()
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
},
|
}
|
||||||
}).then(function (result) {
|
}).then(function (result) {
|
||||||
if (result.value?.[0] && result.value?.[1]) {
|
if (result.value?.[0] && result.value?.[1]) {
|
||||||
json.roles.push({
|
json.roles.push({
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
@ -2,12 +2,12 @@
|
||||||
"version": 3,
|
"version": 3,
|
||||||
"mappings": "AAKA,OAAO,CAAC,0HAAI;ACLZ,AAAA,IAAI,CAAC;EACH,SAAS,EAAE,IAAI;EACf,UAAU,EAAE,UAAU;CACvB;;AACD,AAAA,CAAC;AACD,CAAC,AAAA,QAAQ;AACT,CAAC,AAAA,OAAO,CAAC;EACP,UAAU,EAAE,OAAO;CACpB;;AACD,AAAA,IAAI,CAAC;EACH,WAAW,EAAE,4BAA4B;EACzC,WAAW,EAAE,GAAG;EAChB,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;EACV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/style.scss",
|
||||||
"../app/scss/_globals.scss",
|
"../scss/_globals.scss",
|
||||||
"../app/scss/_vars.scss",
|
"../scss/_vars.scss",
|
||||||
"../app/scss/_containers.scss",
|
"../scss/_containers.scss",
|
||||||
"../app/scss/_textstyle.scss",
|
"../scss/_textstyle.scss",
|
||||||
"../app/scss/_forumstyle.scss"
|
"../scss/_forumstyle.scss"
|
||||||
],
|
],
|
||||||
"names": [],
|
"names": [],
|
||||||
"file": "style.css"
|
"file": "style.css"
|
20
src/web/tsconfig.json
Normal file
20
src/web/tsconfig.json
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es5",
|
||||||
|
"lib": ["dom", "dom.iterable", "esnext"],
|
||||||
|
"allowJs": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"strict": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"module": "esnext",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"jsx": "preserve",
|
||||||
|
"incremental": true
|
||||||
|
},
|
||||||
|
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
||||||
|
"exclude": ["node_modules"]
|
||||||
|
}
|
Loading…
Reference in a new issue