3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-18 15:45:03 +00:00

Created new DB column for role removal mute

This commit is contained in:
roflmaoqwerty 2020-05-18 00:10:43 +10:00
parent b4e034e3d8
commit 46515f0fb3
3 changed files with 24 additions and 0 deletions

View file

@ -15,4 +15,6 @@ export class Mute {
@Column() expires_at: string; @Column() expires_at: string;
@Column() case_id: number; @Column() case_id: number;
@Column() roles_to_restore: string[];
} }

View file

@ -0,0 +1,18 @@
import { MigrationInterface, QueryRunner, TableColumn } from "typeorm";
export class CreateRestoredRolesColumn1589701998928 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<any> {
await queryRunner.addColumn(
"mutes",
new TableColumn({
name: "roles_to_restore",
type: "text",
isNullable: true,
}),
);
}
public async down(queryRunner: QueryRunner): Promise<any> {
await queryRunner.dropColumn("mutes", "roles_to_restore");
}
}

View file

@ -45,6 +45,8 @@ const ConfigSchema = t.type({
mute_message: tNullable(t.string), mute_message: tNullable(t.string),
timed_mute_message: tNullable(t.string), timed_mute_message: tNullable(t.string),
update_mute_message: tNullable(t.string), update_mute_message: tNullable(t.string),
remove_roles_on_mute: t.union([t.boolean, t.array(t.string)]),
role_restore_blacklist: t.union([t.boolean, t.array(t.string)]),
can_view_list: t.boolean, can_view_list: t.boolean,
can_cleanup: t.boolean, can_cleanup: t.boolean,
@ -103,6 +105,8 @@ export class MutesPlugin extends ZeppelinPlugin<TConfigSchema> {
mute_message: "You have been muted on the {guildName} server. Reason given: {reason}", mute_message: "You have been muted on the {guildName} server. Reason given: {reason}",
timed_mute_message: "You have been muted on the {guildName} server for {time}. Reason given: {reason}", timed_mute_message: "You have been muted on the {guildName} server for {time}. Reason given: {reason}",
update_mute_message: "Your mute on the {guildName} server has been updated to {time}.", update_mute_message: "Your mute on the {guildName} server has been updated to {time}.",
remove_roles_on_mute: false,
role_restore_blacklist: false,
can_view_list: false, can_view_list: false,
can_cleanup: false, can_cleanup: false,