nice new update

This commit is contained in:
404invalid-user 2025-01-18 01:27:58 +00:00
parent e136522421
commit 666638c956
136 changed files with 4483 additions and 9190 deletions

View file

@ -0,0 +1,42 @@
import { DataTypes, Sequelize, Model, Optional } from 'sequelize';
export interface BanReactionAttributes {
id: number;
guild: string;
channel: string;
reaction: string;
}
export interface BanReactionCreationAttributes extends Optional<BanReactionAttributes, 'id'> { }
export interface BanReactionInstance
extends Model<BanReactionAttributes, BanReactionCreationAttributes>,
BanReactionAttributes { }
export default function BanRole(sequelize: Sequelize) {
const BanReaction = sequelize.define<BanReactionInstance>('BanReaction', {
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryKey: true,
},
guild: {
type: DataTypes.STRING,
allowNull: false,
},
channel: {
type: DataTypes.STRING,
allowNull: false,
},
reaction: {
type: DataTypes.STRING,
allowNull: false,
},
});
// Sync the model with the database
BanReaction.sync({ alter: true });
return BanReaction;
}

View file

@ -0,0 +1,74 @@
import { DataTypes, Sequelize, Model, Optional } from 'sequelize';
export interface GuildAttributes {
id: string;
name: string;
icon: string | null;
owner: string;
prefix: string;
modAddOnEnableCaps: boolean;
modAddOnEnableFilter: boolean;
modAddOnEnableEmojiSpam: boolean;
logChannel: boolean | null;
webhookURI: string
}
export interface GuildCreationAttributes extends Optional<GuildAttributes, 'id' | 'icon' | 'prefix' | 'modAddOnEnableCaps' | 'modAddOnEnableFilter' | 'modAddOnEnableEmojiSpam' | 'logChannel' | 'webhookURI'> { }
export interface GuildInstance
extends Model<GuildAttributes, GuildCreationAttributes>,
GuildAttributes { }
export default function Guild(sequelize: Sequelize) {
const Guild = sequelize.define<GuildInstance>('Guild', {
id: {
type: DataTypes.STRING,
primaryKey: true,
},
name: {
type: DataTypes.STRING,
allowNull: false,
},
icon: {
type: DataTypes.STRING,
allowNull: true,
},
owner: {
type: DataTypes.STRING,
allowNull: false,
},
prefix: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: '.',
},
modAddOnEnableCaps: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
},
modAddOnEnableFilter: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
},
modAddOnEnableEmojiSpam: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
},
logChannel: {
type: DataTypes.STRING,
allowNull: true,
},
webhookURI: {
type: DataTypes.STRING,
allowNull: true,
}
});
// Sync the model with the database
Guild.sync({ alter: true });
return Guild;
}

View file

@ -0,0 +1,41 @@
import { DataTypes, Sequelize, Model, Optional } from 'sequelize';
export interface KickReactionAttributes {
id: number;
guild: string;
channel: string;
reaction: string;
}
export interface KickReactionCreationAttributes extends Optional<KickReactionAttributes, 'id'> { }
export interface KickReactionInstance
extends Model<KickReactionAttributes, KickReactionCreationAttributes>,
KickReactionAttributes { }
export default function KickRole(sequelize: Sequelize) {
const KickReaction = sequelize.define<KickReactionInstance>('KickReaction', {
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryKey: true,
},
guild: {
type: DataTypes.STRING,
allowNull: false,
},
channel: {
type: DataTypes.STRING,
allowNull: false,
},
reaction: {
type: DataTypes.STRING,
allowNull: false,
},
});
// Sync the model with the database
KickReaction.sync({ alter: true });
return KickReaction;
}

View file

@ -0,0 +1,63 @@
import { DataTypes, Sequelize, Model, Optional } from 'sequelize';
export interface MessageMacroAttributes {
id: number;
guild: string;
channel: string | null;
shortCode: string;
message: string;
role: string;
impersonate: boolean;
deleteShortCode: boolean;
}
export interface MessageMacroCreationAttributes extends Optional<MessageMacroAttributes, 'id'> { }
export interface MessageMacroInstance
extends Model<MessageMacroAttributes, MessageMacroCreationAttributes>,
MessageMacroAttributes { }
export default function MessageMacro(sequelize: Sequelize) {
const MessageMacro = sequelize.define<MessageMacroInstance>('MessageMacro', {
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryKey: true,
},
guild: {
type: DataTypes.STRING,
allowNull: false,
},
channel: {
type: DataTypes.STRING,
allowNull: true,
},
shortCode: {
type: DataTypes.STRING(5),
allowNull: false,
},
message: {
type: DataTypes.STRING(2000),
allowNull: false,
},
role: {
type: DataTypes.STRING,
allowNull: true,
},
impersonate: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
},
deleteShortCode: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
}
});
// Sync the model with the database
MessageMacro.sync({ alter: true });
return MessageMacro;
}

View file

@ -0,0 +1,52 @@
import { DataTypes, Sequelize, Model, Optional } from 'sequelize';
export interface ReactionRoleAttributes {
id: number;
guild: string;
channel: string;
role: string;
reaction: string;
reactionRemove: boolean;
}
export interface ReactionRoleCreationAttributes extends Optional<ReactionRoleAttributes, 'id' | 'reactionRemove'> { }
export interface ReactionRoleInstance
extends Model<ReactionRoleAttributes, ReactionRoleCreationAttributes>,
ReactionRoleAttributes { }
export default function ReactionRole(sequelize: Sequelize) {
const ReactionRole = sequelize.define<ReactionRoleInstance>('ReactionRole', {
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryKey: true,
},
guild: {
type: DataTypes.STRING,
allowNull: false,
},
channel: {
type: DataTypes.STRING,
allowNull: false,
},
role: {
type: DataTypes.STRING,
allowNull: false,
},
reaction: {
type: DataTypes.STRING,
allowNull: false,
},
reactionRemove: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: true,
},
});
// Sync the model with the database
ReactionRole.sync({ alter: true });
return ReactionRole;
}

View file

@ -0,0 +1,66 @@
import { flatten } from 'discord.js';
import { DataTypes, Sequelize, Model, Optional } from 'sequelize';
export interface ReactionRoleEmbedAttributes {
id: number;
guild: string;
channel: string;
title: string;
icon: string | null;
color: string;
roleSeparator: string;
listItemTemplate: string;
}
export interface ReactionRoleEmbedCreationAttributes extends Optional<ReactionRoleEmbedAttributes, 'id' | 'title' | 'icon' | 'color' | 'roleSeparator' | 'listItemTemplate'> { }
export interface ReactionRoleEmbedInstance
extends Model<ReactionRoleEmbedAttributes, ReactionRoleEmbedCreationAttributes>,
ReactionRoleEmbedAttributes { }
export default function ReactionRoleEmbed(sequelize: Sequelize) {
const ReactionRoleEmbed = sequelize.define<ReactionRoleEmbedInstance>('ReactionRoleEmbed', {
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryKey: true,
},
guild: {
type: DataTypes.STRING,
allowNull: false,
},
channel: {
type: DataTypes.STRING,
allowNull: false,
},
title: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: "Reaction Roles",
},
icon: {
type: DataTypes.STRING,
allowNull: true,
},
color: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: "#ff0000",
},
roleSeparator: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: ', '
},
listItemTemplate: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: "[[icon]] - [[roles]]",
},
});
// Synchronize the model with the database
ReactionRoleEmbed.sync({ alter: true });
return ReactionRoleEmbed;
}

View file

@ -0,0 +1,45 @@
import { DataTypes, Sequelize, Model, Optional } from 'sequelize';
export interface UserAttributes {
id: string;
username: string;
avatar: string | null;
admin: boolean;
suspended: boolean;
}
export interface UserCreationAttributes extends Optional<UserAttributes, 'id' | 'avatar' | 'suspended'> { }
export interface UserInstance extends Model<UserAttributes, UserCreationAttributes>, UserAttributes { }
export default function defineUser(sequelize: Sequelize) {
const User = sequelize.define<UserInstance>('User', {
id: {
type: DataTypes.STRING,
primaryKey: true,
},
username: {
type: DataTypes.STRING,
allowNull: false,
},
avatar: {
type: DataTypes.STRING,
allowNull: true,
},
admin: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
},
suspended: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
},
});
// Sync the model with the database (optional in production)
User.sync({ alter: true });
return User;
}