diff --git a/package.json b/package.json index c4182d1..f8476e2 100755 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "dev": "NODE_ENV=development ts-node -r tsconfig-paths/register src/index.ts" }, "dependencies": { - "@tryforge/forge.db": "github:tryforge/forgedb#dev", + "@tryforge/forge.db": "github:tryforge/ForgeDB#dev", "@tryforge/forge.topgg": "github:tryforge/ForgeTopGG#dev", "axios": "^1.7.9", "discord.js": "^14.16.3", diff --git a/src/commands/events/onReady.ts b/src/commands/events/onReady.ts index 9bfc34d..8ae789d 100644 --- a/src/commands/events/onReady.ts +++ b/src/commands/events/onReady.ts @@ -8,10 +8,6 @@ const onReady: Event[] = [{ version: '1.0', code: ` $logger[Info;$username[$clientID] | Running with "$commandCount" commands] - $setGlobalVar[sessionMessageUses;0] - $setGlobalVar[sessionSlashUses;0] - $setGlobalVar[sessionButtonUses;0] - $setGlobalVar[sessionErrors;0] ` }]; diff --git a/src/dataBase/connect.ts b/src/dataBase/connect.ts new file mode 100644 index 0000000..b230d79 --- /dev/null +++ b/src/dataBase/connect.ts @@ -0,0 +1,8 @@ +module.exports = { + type: "connect", + code: `$logger[Info;Database Connected with ping of "$dbPingms"] + $setGlobalVar[sessionMessageUses;0] + $setGlobalVar[sessionSlashUses;0] + $setGlobalVar[sessionButtonUses;0] + $setGlobalVar[sessionErrors;0]` +}; \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 5b3b7f9..e8f0b85 100755 --- a/src/index.ts +++ b/src/index.ts @@ -44,15 +44,15 @@ const topgg = new ForgeTopGG({ // [ Database Setup ] // /// //////////////////////////// -/* const database = new ForgeDB({ type: 'mysql', host: process.env.DATABASE_IP, port: 4020, username: process.env.DATABASE_USERNAME, password: process.env.DATABASE_PASSWORD, - database: "akiradb" -});*/ + database: "akiradb", + events: ['connect'] +}); /// //////////////////////////// // [ Client Setup ] // @@ -74,8 +74,7 @@ const client = new ForgeClient({ '<@$clientID>' ], extensions: [ - // database, - new ForgeDB(), + database, new ForgeQuirks(), // topgg ] @@ -83,9 +82,12 @@ const client = new ForgeClient({ // Load functions, variables and commands client.functions.load(join(__dirname, 'functions')); -ForgeDB.variables(variables); client.commands.load(commandsPath); client.applicationCommands.load(slashCommandsPath); + +database.commands.load(join(__dirname, 'dataBase')); +database.variables(variables); + //topgg.commands.load(topGgPath); /// //////////////////////////// diff --git a/src/types.ts b/src/types.ts index 33cf923..f41319f 100755 --- a/src/types.ts +++ b/src/types.ts @@ -1,8 +1,9 @@ import { CommandType, IForgeFunction, IBaseCommand, IApplicationCommandData } from "@tryforge/forgescript"; +import { IDBEvents } from "@tryforge/forge.db/dist/structures"; type ModuleList = 'clientSpecific' | 'dev' | 'automation' | 'automod' | 'economy' | 'leveling' | 'moderation' | 'fun' | 'permissions' | 'premium' | 'profile' | 'reactionRoles' | 'roleplay' | 'search' | 'settings' | 'utility'; type topggEvent = 'voted' | 'error' | 'posted'; -type ForgeEvent = 'ready' | 'guildCreate' | 'error' | 'messageCreate' | 'shardReady' | 'shardDisconnect'; +type ForgeEvent = 'ready' | 'guildCreate' | 'error' | 'messageCreate' | 'shardReady' | 'shardDisconnect' ; export interface CustomFunction extends IForgeFunction { version?: string; @@ -39,4 +40,9 @@ export interface Event { export interface ISlash extends IApplicationCommandData { usage?: string; module?: ModuleList +} + +export interface DBEvent { + type: 'connect'; + code: string; } \ No newline at end of file