Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
DISCORD_TOKEN='YOUR_TOKEN_HERE'
DISCORD_LOGGING_CHANNEL='YOUR_CHANNEL_HERE'
DISCORD_LOGGING_CHANNEL='YOUR_CHANNEL_HERE'
PORT=3000
165 changes: 73 additions & 92 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,115 +1,96 @@
{
"extends": "eslint:recommended",
"$schema": "https://json.schemastore.org/eslintrc.json",
"env": {
"node": true,
"es6": true
"browser": false,
"es2021": true,
"node": true
},
"extends": [
"plugin:prettier/recommended"
],
"plugins": [
"unused-imports",
"import",
"@typescript-eslint",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": "latest"
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {
"arrow-spacing": [
// "no-console": "warn",
"prettier/prettier": [
"warn",
{
"before": true,
"after": true
"tabWidth": 4,
"endOfLine": "auto"
}
],
"brace-style": [
"error",
"stroustrup",
"no-unused-vars": "off",
"unused-imports/no-unused-vars": "off",
"unused-imports/no-unused-imports": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"allowSingleLine": true
"args": "after-used",
"ignoreRestSiblings": false,
"argsIgnorePattern": "^_.*?$"
}
],
"comma-dangle": [
"error",
"always-multiline"
],
"comma-spacing": "error",
"comma-style": "error",
"curly": [
"error",
"multi-line",
"consistent"
],
"dot-location": [
"error",
"property"
],
"handle-callback-err": "off",
"indent": [
"error",
"tab"
],
"keyword-spacing": "error",
"max-nested-callbacks": [
"error",
"import/order": [
"warn",
{
"max": 4
"groups": [
"type",
"builtin",
"object",
"external",
"internal",
"parent",
"sibling",
"index"
],
"pathGroups": [
{
"pattern": "~/**",
"group": "external",
"position": "after"
}
],
"newlines-between": "always"
}
],
"max-statements-per-line": [
"error",
"padding-line-between-statements": [
"warn",
{
"max": 2
}
],
"no-console": "off",
"no-empty-function": "error",
"no-floating-decimal": "error",
"no-inline-comments": "error",
"no-lonely-if": "error",
"no-multi-spaces": "error",
"no-multiple-empty-lines": [
"error",
"blankLine": "always",
"prev": "*",
"next": "return"
},
{
"max": 2,
"maxEOF": 1,
"maxBOF": 0
}
],
"no-shadow": [
"error",
"blankLine": "always",
"prev": [
"const",
"let",
"var"
],
"next": "*"
},
{
"allow": [
"err",
"resolve",
"reject"
"blankLine": "any",
"prev": [
"const",
"let",
"var"
],
"next": [
"const",
"let",
"var"
]
}
],
"no-trailing-spaces": [
"error"
],
"no-var": "error",
"object-curly-spacing": [
"error",
"always"
],
"prefer-const": "error",
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"space-before-blocks": "error",
"space-before-function-paren": [
"error",
{
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}
],
"space-in-parens": "error",
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": "error",
"yoda": "error"
]
}
}
30 changes: 0 additions & 30 deletions .github/workflows/bun.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
run: bun install

- name: Run ESLint
run: bunx eslint .
run: bun lint
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ jobs:
tag_name: v${{ env.NEW_VERSION }}
release_name: Release ${{ env.NEW_VERSION }}
draft: false
prerelease: false
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

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

> [!WARNING]
> 2.0.0 is in development

# Why use this?

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

# New in 2.0.0

- Upcoming 👀

# New in 1.1.0

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.
Expand All @@ -37,8 +44,9 @@ _Not all features that were meant to be in 1.1.0 were added in it. That's for 1.

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

<!-- # Support
[Support Discord Server](https://discord.gg/<REDACTED_FOR_NOW>) -->
# Support

[Support Discord Server](discord.gg/AppBeYXVNt)

# User Integration

Expand Down
19 changes: 19 additions & 0 deletions api/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import express, { type Request, type Response, type NextFunction } from 'express';
import cors from 'cors';
import path from 'path';

const app = express();
app.use(cors());
app.use(express.static(path.resolve(__dirname, 'public')));

app.get('/', (_req: Request, res: Response) => {
res.sendFile(path.resolve(__dirname, 'public/index.html'));
});

app.get('/invite', (_req: Request, res: Response) => {
res.redirect('https://discord.com/oauth2/authorize?client_id=1241739031252045935&permissions=268446736&integration_type=0&scope=bot+applications.commands');
});

app.listen(process.env.PORT, () => {
console.log(`Server running at http://localhost:${process.env.PORT}`);
});
File renamed without changes.
Loading