-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bso' of https://github.com/nwjgit/oldschoolbot into com…
…pCapeSimItems
- Loading branch information
Showing
974 changed files
with
21,602 additions
and
19,028 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.env | ||
icon_cache | ||
logs | ||
dist | ||
node_modules | ||
coverage | ||
.yarn | ||
.tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
# You need to change these: | ||
CLIENT_ID=PUT_YOUR_CLIENT_ID_HERE | ||
BOT_TOKEN=PUT_YOUR_TOKEN_HERE | ||
|
||
# You may need to change these: | ||
ROBOCHIMP_DATABASE_URL=postgresql://postgres:postgres@localhost:5436/robochimp_test | ||
DATABASE_URL=postgresql://postgres:postgres@localhost:5435/osb_test | ||
|
||
# Optional | ||
#REDIS_PORT=6379 | ||
#TESTING_SERVER_ID=123456789012345678 | ||
|
||
# Dont change these: | ||
TZ="UTC" | ||
ROBOCHIMP_DATABASE_URL=postgresql://postgres:postgres@localhost:5436/robochimp_integration_test | ||
DATABASE_URL=postgresql://postgres:postgres@localhost:5435/osb_integration_test?connection_limit=20&pool_timeout=120 | ||
PATREON_CAMPAIGN_ID=1234 | ||
PATREON_TOKEN=asdfasdfasdf | ||
PATREON_WEBHOOK_SECRET=asdfasdfasdf | ||
HTTP_PORT=7373 | ||
CLIENT_ID=111398433321891634 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
TZ="UTC" | ||
ROBOCHIMP_DATABASE_URL=postgresql://postgres:postgres@localhost:5436/robochimp_integration_test?connection_limit=1000 | ||
DATABASE_URL=postgresql://postgres:postgres@localhost:5435/osb_integration_test?pool_timeout=120&connection_limit=1000 | ||
PATREON_CAMPAIGN_ID=1234 | ||
PATREON_TOKEN=asdfasdfasdf | ||
PATREON_WEBHOOK_SECRET=asdfasdfasdf | ||
HTTP_PORT=7373 | ||
CLIENT_ID=111398433321891634 | ||
# PRISMA_CLIENT_ENGINE_TYPE=binary | ||
BOT_TOKEN=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | ||
TEST=true | ||
CI=true | ||
YARN_ENABLE_HARDENED_MODE=0 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
BSO: | ||
- base-branch: "bso" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: "Pull Request Labeler" | ||
on: | ||
pull_request_target: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
labeler: | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/labeler@v5 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
dist | ||
dist | ||
coverage | ||
node_modules | ||
logs | ||
licenses |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
nodeLinker: node-modules | ||
telemetryInterval: 999999999999 | ||
enableTelemetry: false | ||
checksumBehavior: "update" | ||
enableHardenedMode: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Setting up for contributing/running the bot | ||
|
||
This assumes you are using VSCode as your IDE. If you have errors or issues, you can ask us for help in the #developer channel in the [discord server](https://discord.gg/ob). | ||
|
||
## **Setup** | ||
|
||
### Discord Bot Account | ||
|
||
1. Create a discord bot account, and have the application ID and bot token saved. | ||
2. Ensure your bot has `Privileged Gateway Intents > Server Members Intent` enabled. | ||
|
||
### Environment | ||
|
||
1. Install [NvM](https://github.com/coreybutler/nvm-windows/), then use it to install NodeJS v20.15.0 OR install the nodejs version directly. | ||
2. Install [Postgres 16](https://www.postgresql.org/download/) and PGAdmin4 for interacting with postgres (optional, but helpful) | ||
3. Install Yarn using: `npm i -g yarn` | ||
4. Clone the repo: `git clone https://github.com/oldschoolgg/oldschoolbot.git` | ||
5. Run the following commands in the root of the repo: `corepack enable`, `yarn`, `npx prisma db push` and `npx prisma db push --schema ./prisma/robochimp.prisma` | ||
|
||
### Configuration | ||
|
||
1. Copy the ".env.example" file and rename the copy to ".env", put your bot token and bot id (client id) in it. | ||
2. Create 2 databases called "osb_test" and "robochimp_test" | ||
3. Change `DATABASE_URL` and `ROBOCHIMP_DATABASE_URL` in your .env with the format `postgresql://USER:PASSWORD@HOST:PORT/DATABASE_NAME`. | ||
4. Make a config file from the example: `cp src/config.example.ts src/config.ts` | ||
5. Edit this new `config.ts` file: | ||
- Copy your Discord ID into both `OWNER_IDS` and `ADMIN_IDS`. | ||
- Enter the Server ID where you want to Administer your bot from in `SupportServer` | ||
- Enter the Server ID into `DEV_SERVER_ID` | ||
|
||
### Running the bot | ||
|
||
1. Run `yarn start` | ||
|
||
#### VSCode settings (Optional) | ||
|
||
1. In VSCode, press CTRL+SHIFT+P, search "Open User Settings JSON" | ||
2. Add this to the file: | ||
|
||
```json | ||
// Format/fix code automatically | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true, | ||
"editor.codeActionsOnSave": { | ||
"quickfix.biome": "explicit", | ||
}, | ||
// Disable telemetry | ||
"telemetry.telemetryLevel": "off", | ||
// Always use \n for EOF | ||
"files.eol": "\n", | ||
``` | ||
|
||
# Troubleshooting | ||
|
||
- Check your NodeJS/NPM/Yarn/Postgres versions. | ||
- Uninstall prettier/eslint vscode plugins. | ||
- Delete these folders: node_modules, dist |
Oops, something went wrong.