feat: add internal role manager plugin; add role buttons plugin

This commit is contained in:
Dragory 2022-04-23 16:31:41 +03:00
parent 9314d57645
commit 3fe71b3e27
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
23 changed files with 732 additions and 1 deletions

View file

@ -0,0 +1,50 @@
import { MigrationInterface, QueryRunner, Table } from "typeorm";
export class CreateRoleQueueTable1650709103864 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: "role_queue",
columns: [
{
name: "id",
type: "int",
isPrimary: true,
isGenerated: true,
generationStrategy: "increment",
},
{
name: "guild_id",
type: "bigint",
},
{
name: "user_id",
type: "bigint",
},
{
name: "role_id",
type: "bigint",
},
{
name: "should_add",
type: "boolean",
},
{
name: "priority",
type: "smallint",
default: 0,
},
],
indices: [
{
columnNames: ["guild_id"],
},
],
}),
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable("role_queue");
}
}

View file

@ -0,0 +1,51 @@
import { MigrationInterface, QueryRunner, Table } from "typeorm";
export class CreateRoleButtonsTable1650712828384 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: "role_buttons",
columns: [
{
name: "id",
type: "int",
isPrimary: true,
isGenerated: true,
generationStrategy: "increment",
},
{
name: "guild_id",
type: "bigint",
},
{
name: "name",
type: "varchar",
length: "255",
},
{
name: "channel_id",
type: "bigint",
},
{
name: "message_id",
type: "bigint",
},
{
name: "hash",
type: "text",
},
],
indices: [
{
columnNames: ["guild_id", "name"],
isUnique: true,
},
],
}),
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable("role_buttons");
}
}