diff options
Diffstat (limited to 'src/lib/models/StickyRole.ts')
-rw-r--r-- | src/lib/models/StickyRole.ts | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/lib/models/StickyRole.ts b/src/lib/models/StickyRole.ts index b49af80..d304370 100644 --- a/src/lib/models/StickyRole.ts +++ b/src/lib/models/StickyRole.ts @@ -6,11 +6,13 @@ export interface StickyRoleModel { user: Snowflake; guild: Snowflake; roles: Snowflake[]; + nickname: string; } export interface StickyRoleModelCreationAttributes { user: Snowflake; guild: Snowflake; roles: Snowflake[]; + nickname?: string; } const NEVER_USED = 'This should never be executed'; @@ -46,6 +48,16 @@ export class StickyRole extends BaseModel<StickyRoleModel, StickyRoleModelCreati throw new Error(NEVER_USED); } + /** + * The user's previous nickname + */ + public get nickname(): string { + throw new Error(NEVER_USED); + } + public set nickname(_: string) { + throw new Error(NEVER_USED); + } + public static initModel(sequelize: Sequelize): void { StickyRole.init( { @@ -57,7 +69,6 @@ export class StickyRole extends BaseModel<StickyRoleModel, StickyRoleModelCreati type: DataTypes.STRING, allowNull: false }, - roles: { type: DataTypes.STRING, get: function () { @@ -67,6 +78,10 @@ export class StickyRole extends BaseModel<StickyRoleModel, StickyRoleModelCreati return this.setDataValue('roles', JSON.stringify(val) as unknown as Snowflake[]); }, allowNull: true + }, + nickname: { + type: DataTypes.STRING, + allowNull: true } }, { sequelize } |