Skip to content

Commit 9e9514e

Browse files
committed
chore: push updates
from 8 months ago lol. closes #42, closes #26
1 parent 1446248 commit 9e9514e

21 files changed

+1254
-1991
lines changed

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
DISCORD_TOKEN='YOUR_TOKEN_HERE'
2-
DISCORD_LOGGING_CHANNEL='YOUR_CHANNEL_HERE'
2+
DISCORD_LOGGING_CHANNEL='YOUR_CHANNEL_HERE'
3+
PORT=3000

.eslintrc.json

Lines changed: 73 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,96 @@
11
{
2-
"extends": "eslint:recommended",
2+
"$schema": "https://json.schemastore.org/eslintrc.json",
33
"env": {
4-
"node": true,
5-
"es6": true
4+
"browser": false,
5+
"es2021": true,
6+
"node": true
67
},
8+
"extends": [
9+
"plugin:prettier/recommended"
10+
],
11+
"plugins": [
12+
"unused-imports",
13+
"import",
14+
"@typescript-eslint",
15+
"prettier"
16+
],
17+
"parser": "@typescript-eslint/parser",
718
"parserOptions": {
8-
"sourceType": "module",
9-
"ecmaVersion": "latest"
19+
"ecmaVersion": 12,
20+
"sourceType": "module"
1021
},
1122
"rules": {
12-
"arrow-spacing": [
23+
// "no-console": "warn",
24+
"prettier/prettier": [
1325
"warn",
1426
{
15-
"before": true,
16-
"after": true
27+
"tabWidth": 4,
28+
"endOfLine": "auto"
1729
}
1830
],
19-
"brace-style": [
20-
"error",
21-
"stroustrup",
31+
"no-unused-vars": "off",
32+
"unused-imports/no-unused-vars": "off",
33+
"unused-imports/no-unused-imports": "warn",
34+
"@typescript-eslint/no-unused-vars": [
35+
"warn",
2236
{
23-
"allowSingleLine": true
37+
"args": "after-used",
38+
"ignoreRestSiblings": false,
39+
"argsIgnorePattern": "^_.*?$"
2440
}
2541
],
26-
"comma-dangle": [
27-
"error",
28-
"always-multiline"
29-
],
30-
"comma-spacing": "error",
31-
"comma-style": "error",
32-
"curly": [
33-
"error",
34-
"multi-line",
35-
"consistent"
36-
],
37-
"dot-location": [
38-
"error",
39-
"property"
40-
],
41-
"handle-callback-err": "off",
42-
"indent": [
43-
"error",
44-
"tab"
45-
],
46-
"keyword-spacing": "error",
47-
"max-nested-callbacks": [
48-
"error",
42+
"import/order": [
43+
"warn",
4944
{
50-
"max": 4
45+
"groups": [
46+
"type",
47+
"builtin",
48+
"object",
49+
"external",
50+
"internal",
51+
"parent",
52+
"sibling",
53+
"index"
54+
],
55+
"pathGroups": [
56+
{
57+
"pattern": "~/**",
58+
"group": "external",
59+
"position": "after"
60+
}
61+
],
62+
"newlines-between": "always"
5163
}
5264
],
53-
"max-statements-per-line": [
54-
"error",
65+
"padding-line-between-statements": [
66+
"warn",
5567
{
56-
"max": 2
57-
}
58-
],
59-
"no-console": "off",
60-
"no-empty-function": "error",
61-
"no-floating-decimal": "error",
62-
"no-inline-comments": "error",
63-
"no-lonely-if": "error",
64-
"no-multi-spaces": "error",
65-
"no-multiple-empty-lines": [
66-
"error",
68+
"blankLine": "always",
69+
"prev": "*",
70+
"next": "return"
71+
},
6772
{
68-
"max": 2,
69-
"maxEOF": 1,
70-
"maxBOF": 0
71-
}
72-
],
73-
"no-shadow": [
74-
"error",
73+
"blankLine": "always",
74+
"prev": [
75+
"const",
76+
"let",
77+
"var"
78+
],
79+
"next": "*"
80+
},
7581
{
76-
"allow": [
77-
"err",
78-
"resolve",
79-
"reject"
82+
"blankLine": "any",
83+
"prev": [
84+
"const",
85+
"let",
86+
"var"
87+
],
88+
"next": [
89+
"const",
90+
"let",
91+
"var"
8092
]
8193
}
82-
],
83-
"no-trailing-spaces": [
84-
"error"
85-
],
86-
"no-var": "error",
87-
"object-curly-spacing": [
88-
"error",
89-
"always"
90-
],
91-
"prefer-const": "error",
92-
"quotes": [
93-
"error",
94-
"single"
95-
],
96-
"semi": [
97-
"error",
98-
"always"
99-
],
100-
"space-before-blocks": "error",
101-
"space-before-function-paren": [
102-
"error",
103-
{
104-
"anonymous": "never",
105-
"named": "never",
106-
"asyncArrow": "always"
107-
}
108-
],
109-
"space-in-parens": "error",
110-
"space-infix-ops": "error",
111-
"space-unary-ops": "error",
112-
"spaced-comment": "error",
113-
"yoda": "error"
94+
]
11495
}
11596
}

.github/workflows/bun.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/eslint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
run: bun install
2424

2525
- name: Run ESLint
26-
run: bunx eslint .
26+
run: bun lint

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,3 @@ jobs:
6363
tag_name: v${{ env.NEW_VERSION }}
6464
release_name: Release ${{ env.NEW_VERSION }}
6565
draft: false
66-
prerelease: false

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
[Invite it here](https://discord.com/oauth2/authorize?client_id=1241739031252045935&permissions=268446736&integration_type=0&scope=bot+applications.commands)
66

7+
> [!WARNING]
8+
> 2.0.0 is in development
9+
710
# Why use this?
811

912
- Automatically publishes announcements for you, in case you forget; or a bot sends a message; or you just want to take the easier route
@@ -28,6 +31,10 @@
2831
Discord has a rate limit for publishing channels of 10 announcements per server **per hour**.
2932
Please do not use this in your server if you exceed this limit
3033

34+
# New in 2.0.0
35+
36+
- Upcoming 👀
37+
3138
# New in 1.1.0
3239

3340
The bot has been restructured - mainly because of the admin permissions and how volatile it could be. Whilst it worked, I wanted to ditch it and make it more secure. You now have more control over what gets published and when it joins a server, will automatically add all needed permissions to it.
@@ -37,8 +44,9 @@ _Not all features that were meant to be in 1.1.0 were added in it. That's for 1.
3744

3845
The website for the bot is [here](https://autopublish.galvindev.me.uk)!
3946

40-
<!-- # Support
41-
[Support Discord Server](https://discord.gg/<REDACTED_FOR_NOW>) -->
47+
# Support
48+
49+
[Support Discord Server](discord.gg/AppBeYXVNt)
4250

4351
# User Integration
4452

api/api.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import express, { type Request, type Response, type NextFunction } from 'express';
2+
import cors from 'cors';
3+
import path from 'path';
4+
5+
const app = express();
6+
app.use(cors());
7+
app.use(express.static(path.resolve(__dirname, 'public')));
8+
9+
app.get('/', (_req: Request, res: Response) => {
10+
res.sendFile(path.resolve(__dirname, 'public/index.html'));
11+
});
12+
13+
app.get('/invite', (_req: Request, res: Response) => {
14+
res.redirect('https://discord.com/oauth2/authorize?client_id=1241739031252045935&permissions=268446736&integration_type=0&scope=bot+applications.commands');
15+
});
16+
17+
app.listen(process.env.PORT, () => {
18+
console.log(`Server running at http://localhost:${process.env.PORT}`);
19+
});
File renamed without changes.

0 commit comments

Comments
 (0)