From 10434adad478d21bbb834a5803125db9f54c9d6c Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Wed, 2 Apr 2025 02:21:41 -0400 Subject: Added i18n (basic); Blacklist feature; Put error msg into a file --- bot/src/db/models/blacklist.js | 30 ++++++++++++++++++++++++++++++ bot/src/db/models/guild-settings.js | 1 + bot/src/db/models/user-settings.js | 18 ++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 bot/src/db/models/blacklist.js create mode 100644 bot/src/db/models/user-settings.js (limited to 'bot/src/db/models') diff --git a/bot/src/db/models/blacklist.js b/bot/src/db/models/blacklist.js new file mode 100644 index 0000000..1542f91 --- /dev/null +++ b/bot/src/db/models/blacklist.js @@ -0,0 +1,30 @@ +import { INTEGER, STRING } from 'sequelize'; +import { sequelize } from '../../utils/sequelize.js'; + +export const blacklistUser = sequelize.define('blacklist-users', { + id: { + type: INTEGER, + primaryKey: true, + autoIncrement: true, + }, + userID: { + type: STRING, + allowNull: false + } +}, { + updatedAt: false, +}); + +export const blacklistGuild = sequelize.define('blacklist-guilds', { + id: { + type: INTEGER, + primaryKey: true, + autoIncrement: true, + }, + guildID: { + type: STRING, + allowNull: false + } +}, { + updatedAt: false, +}); diff --git a/bot/src/db/models/guild-settings.js b/bot/src/db/models/guild-settings.js index 09cddd2..79f8fd6 100644 --- a/bot/src/db/models/guild-settings.js +++ b/bot/src/db/models/guild-settings.js @@ -1,6 +1,7 @@ import { INTEGER, STRING, BOOLEAN } from 'sequelize'; import { sequelize } from '../../utils/sequelize.js'; +// potentially rename the table to settings-guilds to stay consistent export const guildSettings = sequelize.define('guild-settings', { id: { type: INTEGER, diff --git a/bot/src/db/models/user-settings.js b/bot/src/db/models/user-settings.js new file mode 100644 index 0000000..edaff16 --- /dev/null +++ b/bot/src/db/models/user-settings.js @@ -0,0 +1,18 @@ +import { INTEGER, STRING } from 'sequelize'; +import { sequelize } from '../../utils/sequelize.js'; + +export const userSettings = sequelize.define('user-settings', { + id: { + type: INTEGER, + primaryKey: true, + autoIncrement: true, + }, + userID: { + type: STRING, + allowNull: false + }, + language: { + type: STRING, + allowNull: true + } +}); -- cgit v1.2.3