Skip to content

Commit

Permalink
Merge pull request #14 from SandwichBtw/dev
Browse files Browse the repository at this point in the history
Remove old postgres stuff
  • Loading branch information
SandwichBtw authored Apr 21, 2024
2 parents 32114b7 + f47e050 commit 87de25c
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 71 deletions.
17 changes: 5 additions & 12 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,10 @@ TOKEN=YOURTOKENHERE

# List of admins who can use the bot commands using discord user id's.
# You can add multiple by adding a space between the id's.
ADMINS=1234
ADMINS=ID ID ID

# The general chat id that the bot will use for the scheduled messages.
CHANNEL_ID=YOURCHANNELIDHERE
# The channel that the bot will use for the scheduled messages.
CHANNEL_ID=ID

# Must be a number
SHARDS=1

# Here is your Postgres login configuration
POSTGRES_HOST=127.0.0.1
POSTGRES_USERNAME=postgres
POSTGRES_PASSWORD=password
POSTGRES_PORT=5432
POSTGRES_DATABASE=crystalbot
# The amount of shards that will be created.
SHARDS=1
4 changes: 2 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Docker Image CI

on:
push:
branches: [ "master" ]
branches: [ "master", "dev" ]
pull_request:
branches: [ "master" ]
branches: [ "master", "dev" ]

jobs:

Expand Down
6 changes: 0 additions & 6 deletions docker-compose-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ services:
context: .
environment:
- TOKEN=YOURTOKENHERE
- PREFIX=.
- ADMINS=1234
- SHARDS=1
- CHANNEL_ID=YOURCHANNELIDHERE
- POSTGRES_HOST=127.0.0.1
- POSTGRES_USERNAME=postgres
- POSTGRES_PASSWORD=password
- POSTGRES_PORT=5432
- POSTGRES_DATABASE=crystalbot
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const config = getConfig()
const manager = new ShardingManager("./bot.js", { totalShards: config.shards, token: `${config.token}` })

manager.on("shardCreate", shard => {
console.log(`Launched shard ${shard.id}`)
console.log(`Launched shard ${shard.id + 1}`)
})

process.on("unhandledRejection", err => {
Expand Down
7 changes: 0 additions & 7 deletions src/modules/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,5 @@ export function getConfig(): Config {
admins: process.env.ADMINS != null ? process.env.ADMINS.split(" ") : [],
channelId: `${process.env.CHANNEL_ID}`,
shards: process.env.SHARDS != null ? parseInt(process.env.SHARDS) : 1,
postgresConfig: {
host: `${process.env.POSTGRES_HOST}`,
username: `${process.env.POSTGRES_USERNAME}`,
password: `${process.env.POSTGRES_PASSWORD}`,
port: process.env.POSTGRES_PORT != null ? parseInt(process.env.POSTGRES_PORT) : 5432,
database: `${process.env.POSTGRES_DATABASE}`,
},
}
}
33 changes: 0 additions & 33 deletions src/modules/database.ts

This file was deleted.

11 changes: 1 addition & 10 deletions src/types/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,4 @@ export type Config = {
admins: string[]
channelId: string
shards: number
postgresConfig: PostgresConfig
}

export type PostgresConfig = {
host: string
username: string
password: string
port: number
database: string
}
}

0 comments on commit 87de25c

Please sign in to comment.