⚠️ Repository Archived⚠️ [2022-08-16]According to the DOE, for the 2022-2023 school year, the health screening will not be required.
- Daily Health Screener:
- No longer required to enter school buildings
This means that this repository will be archived.
Does the health screening for you automatically.
Please view the quickstart guide for learning how to get started.
- Git
- Node.js
- PostgreSQL for full functionality
- Run
git clone https://github.com/HealthScreening/HealthScreeningBot.git
. - Extract the files.
- Open a terminal to the
HealthScreeningBot
directory. - Run
npm install
. - NOTE: IF YOU ARE USING SQLITE (most likely), you need to run
npm install sqlite3
. - Create the config, as below. This is required, the installation will not work without it.
- Run
npm run build
. - Run
npm run deploy
. - Run
npx sequelize-cli db:migrate
.
A file called config.ts
needs to exist with pre-filled values. You can use the contents of the CI config.ts as an example. This must exist on the root directory prior to building.
The file needs to export three named objects (the name must be the same):
- A
database
variable that contains options for Sequelize. This is passed directly to Sequelize. - A
discord
variable that contains options for Discord. - A
github
variable that contains options for GitHub.
This is an object for the database.
If you are using sqlite3 (highly recommended because it does not require you to install any additional software), import the Options type from sequelize and export an object like so:
import { Options } from "sequelize";
export const database: Options = {
dialect: "sqlite",
storage: "./db.sqlite",
};
NOTE: When using sqlite3, some commands may not work. Core functionality should be working as expected.
If you are using Postgres (REQUIRED), export an object that looks like this:
import { Options } from "sequelize";
export const database: Options = {
dialect: "postgres",
username: "user",
password: "user",
database: "user",
host: "localhost",
port: 5432,
};
This is an object for the discord bot. To obtain a bot account, follow this guide. Export an object that looks like this:
export const discord = {
token: "token",
clientId: "id",
guildId: "id",
logChannelId: "id",
ownerId: "id",
};
token
: The bot token. Reference the guide for getting this.clientId
: The client ID of the bot. Found in the "General Information" tab of the bot app page.guildId
: The primary server that the bot belongs to (the "HQ" server).logChannelId
: The channel where the bot puts it's logs. Must belong to the server that is inguildId
.ownerId
: The user ID of the owner of the bot.
This is an object for the GitHub functionality of the bot. Placeholders can be used to disable functionality if you do not want to use the GitHub features. Export an object that looks like this (just leave "token"):
export const github = {
token: "token",
owner: "HealthScreening",
repo: "HealthScreeningBot",
};
token
: A GitHub PAT of the bot account.owner
: The owner of the repository the bot will post to. If the repo URL ishttps://github.com/a/b
, the owner isa
.repo
: The repository name. If the repo URL ishttps://github.com/a/b
, the repo name isb
.
When complete, the config.ts
file should look like this:
import { Options } from "sequelize";
export const database: Options = {
dialect: "postgres",
username: "user",
password: "user",
database: "user",
host: "localhost",
port: 5432,
};
export const discord = {
token: "token",
clientId: "id",
guildId: "id",
logChannelId: "id",
ownerId: "id",
};
export const github = {
token: "token",
owner: "HealthScreening",
repo: "HealthScreeningBot",
};
In the main directory on a terminal, run npm run start
.