aboutsummaryrefslogtreecommitdiff
path: root/src/lib/models/StickyRole.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-06-20 22:52:50 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-06-20 22:52:50 -0400
commit5c3da90f441c321f55ae735d6002f4da91f2481e (patch)
treeac6a993595eebe38fd5e7bd79ade4c5ec71be373 /src/lib/models/StickyRole.ts
parent87e77ae8cc69d0d7f1e3d6f614b03c9297e85ab3 (diff)
downloadtanzanite-5c3da90f441c321f55ae735d6002f4da91f2481e.tar.gz
tanzanite-5c3da90f441c321f55ae735d6002f4da91f2481e.tar.bz2
tanzanite-5c3da90f441c321f55ae735d6002f4da91f2481e.zip
feat(*): aaaaa
Diffstat (limited to 'src/lib/models/StickyRole.ts')
-rw-r--r--src/lib/models/StickyRole.ts40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/lib/models/StickyRole.ts b/src/lib/models/StickyRole.ts
new file mode 100644
index 0000000..597d7c5
--- /dev/null
+++ b/src/lib/models/StickyRole.ts
@@ -0,0 +1,40 @@
+import { Snowflake } from 'discord.js';
+import { DataTypes, Sequelize } from 'sequelize';
+import { BaseModel } from './BaseModel';
+
+export interface StickyRoleModel {
+ user: Snowflake;
+ guild: Snowflake;
+ roles: Snowflake[];
+}
+export interface StickyRoleModelCreationAttributes {
+ user: Snowflake;
+ guild: Snowflake;
+ roles: Snowflake[];
+}
+
+export class StickyRole extends BaseModel<StickyRoleModel, StickyRoleModelCreationAttributes> implements StickyRoleModel {
+ user: Snowflake;
+ guild: Snowflake;
+ roles: Snowflake[];
+ static initModel(sequelize: Sequelize): void {
+ StickyRole.init(
+ {
+ user: {
+ type: DataTypes.STRING,
+ allowNull: false
+ },
+ guild: {
+ type: DataTypes.STRING,
+ allowNull: false
+ },
+
+ roles: {
+ type: DataTypes.ARRAY(DataTypes.STRING),
+ allowNull: false
+ }
+ },
+ { sequelize }
+ );
+ }
+}