(v4.2) Open Discord Framework Update (Part 1)

This commit is contained in:
DJj123dj
2026-02-16 22:12:25 +01:00
parent ddae7b5e46
commit cb8139b8a0
75 changed files with 1494 additions and 14252 deletions
+83 -84
View File
@@ -1,8 +1,7 @@
///////////////////////////////////////
//DEFAULT CLIENT MODULE
///////////////////////////////////////
import { ODValidId } from "../modules/base"
import { ODClientManager, ODSlashCommand, ODTextCommand, ODSlashCommandManager, ODTextCommandManager, ODSlashCommandInteractionCallback, ODTextCommandInteractionCallback, ODContextMenu, ODContextMenuManager, ODContextMenuInteractionCallback } from "../modules/client"
import * as api from "@open-discord-bots/framework/api"
/** (CONTRIBUTOR GUIDE) HOW TO ADD NEW COMMANDS?
* - Register the command in loadAllSlashCommands() & loadAllTextCommands() in (./src/data/framework/commandLoader.ts)
@@ -20,7 +19,7 @@ import { ODClientManager, ODSlashCommand, ODTextCommand, ODSlashCommandManager,
*
* This default class is made for the global variable `opendiscord.client`!
*/
export class ODClientManager_Default extends ODClientManager {
export class ODClientManager_Default extends api.ODClientManager {
declare slashCommands: ODSlashCommandManager_Default
declare textCommands: ODTextCommandManager_Default
declare contextMenus: ODContextMenuManager_Default
@@ -31,28 +30,28 @@ export class ODClientManager_Default extends ODClientManager {
* It's used to generate typescript declarations for this class.
*/
export interface ODSlashCommandManagerIds_Default {
"opendiscord:help":ODSlashCommand,
"opendiscord:panel":ODSlashCommand,
"opendiscord:ticket":ODSlashCommand,
"opendiscord:close":ODSlashCommand,
"opendiscord:delete":ODSlashCommand,
"opendiscord:reopen":ODSlashCommand,
"opendiscord:claim":ODSlashCommand,
"opendiscord:unclaim":ODSlashCommand,
"opendiscord:pin":ODSlashCommand,
"opendiscord:unpin":ODSlashCommand,
"opendiscord:move":ODSlashCommand,
"opendiscord:rename":ODSlashCommand,
"opendiscord:add":ODSlashCommand,
"opendiscord:remove":ODSlashCommand,
"opendiscord:blacklist":ODSlashCommand,
"opendiscord:stats":ODSlashCommand,
"opendiscord:clear":ODSlashCommand,
"opendiscord:autoclose":ODSlashCommand,
"opendiscord:autodelete":ODSlashCommand,
"opendiscord:topic":ODSlashCommand,
"opendiscord:priority":ODSlashCommand,
"opendiscord:transfer":ODSlashCommand,
"opendiscord:help":api.ODSlashCommand,
"opendiscord:panel":api.ODSlashCommand,
"opendiscord:ticket":api.ODSlashCommand,
"opendiscord:close":api.ODSlashCommand,
"opendiscord:delete":api.ODSlashCommand,
"opendiscord:reopen":api.ODSlashCommand,
"opendiscord:claim":api.ODSlashCommand,
"opendiscord:unclaim":api.ODSlashCommand,
"opendiscord:pin":api.ODSlashCommand,
"opendiscord:unpin":api.ODSlashCommand,
"opendiscord:move":api.ODSlashCommand,
"opendiscord:rename":api.ODSlashCommand,
"opendiscord:add":api.ODSlashCommand,
"opendiscord:remove":api.ODSlashCommand,
"opendiscord:blacklist":api.ODSlashCommand,
"opendiscord:stats":api.ODSlashCommand,
"opendiscord:clear":api.ODSlashCommand,
"opendiscord:autoclose":api.ODSlashCommand,
"opendiscord:autodelete":api.ODSlashCommand,
"opendiscord:topic":api.ODSlashCommand,
"opendiscord:priority":api.ODSlashCommand,
"opendiscord:transfer":api.ODSlashCommand,
}
/**## ODSlashCommandManager_Default `default_class`
@@ -61,32 +60,32 @@ export interface ODSlashCommandManagerIds_Default {
*
* This default class is made for the global variable `opendiscord.client.slashCommands`!
*/
export class ODSlashCommandManager_Default extends ODSlashCommandManager {
export class ODSlashCommandManager_Default extends api.ODSlashCommandManager {
get<SlashCommandId extends keyof ODSlashCommandManagerIds_Default>(id:SlashCommandId): ODSlashCommandManagerIds_Default[SlashCommandId]
get(id:ODValidId): ODSlashCommand|null
get(id:api.ODValidId): api.ODSlashCommand|null
get(id:ODValidId): ODSlashCommand|null {
get(id:api.ODValidId): api.ODSlashCommand|null {
return super.get(id)
}
remove<SlashCommandId extends keyof ODSlashCommandManagerIds_Default>(id:SlashCommandId): ODSlashCommandManagerIds_Default[SlashCommandId]
remove(id:ODValidId): ODSlashCommand|null
remove(id:api.ODValidId): api.ODSlashCommand|null
remove(id:ODValidId): ODSlashCommand|null {
remove(id:api.ODValidId): api.ODSlashCommand|null {
return super.remove(id)
}
exists(id:keyof ODSlashCommandManagerIds_Default): boolean
exists(id:ODValidId): boolean
exists(id:api.ODValidId): boolean
exists(id:ODValidId): boolean {
exists(id:api.ODValidId): boolean {
return super.exists(id)
}
onInteraction(commandName:keyof ODSlashCommandManagerIds_Default, callback:ODSlashCommandInteractionCallback): void
onInteraction(commandName:string|RegExp, callback:ODSlashCommandInteractionCallback): void
onInteraction(commandName:keyof ODSlashCommandManagerIds_Default, callback:api.ODSlashCommandInteractionCallback): void
onInteraction(commandName:string|RegExp, callback:api.ODSlashCommandInteractionCallback): void
onInteraction(commandName:string|RegExp, callback:ODSlashCommandInteractionCallback): void {
onInteraction(commandName:string|RegExp, callback:api.ODSlashCommandInteractionCallback): void {
return super.onInteraction(commandName,callback)
}
}
@@ -96,37 +95,37 @@ export class ODSlashCommandManager_Default extends ODSlashCommandManager {
* It's used to generate typescript declarations for this class.
*/
export interface ODTextCommandManagerIds_Default {
"opendiscord:dump":ODTextCommand,
"opendiscord:help":ODTextCommand,
"opendiscord:panel":ODTextCommand,
"opendiscord:close":ODTextCommand,
"opendiscord:delete":ODTextCommand,
"opendiscord:reopen":ODTextCommand,
"opendiscord:claim":ODTextCommand,
"opendiscord:unclaim":ODTextCommand,
"opendiscord:pin":ODTextCommand,
"opendiscord:unpin":ODTextCommand,
"opendiscord:move":ODTextCommand,
"opendiscord:rename":ODTextCommand,
"opendiscord:add":ODTextCommand,
"opendiscord:remove":ODTextCommand,
"opendiscord:blacklist-view":ODTextCommand,
"opendiscord:blacklist-add":ODTextCommand,
"opendiscord:blacklist-remove":ODTextCommand,
"opendiscord:blacklist-get":ODTextCommand,
"opendiscord:stats-global":ODTextCommand,
"opendiscord:stats-reset":ODTextCommand,
"opendiscord:stats-ticket":ODTextCommand,
"opendiscord:stats-user":ODTextCommand,
"opendiscord:clear":ODTextCommand,
"opendiscord:autoclose-disable":ODTextCommand,
"opendiscord:autoclose-enable":ODTextCommand,
"opendiscord:autodelete-disable":ODTextCommand,
"opendiscord:autodelete-enable":ODTextCommand,
"opendiscord:topic-set":ODTextCommand,
"opendiscord:priority-set":ODTextCommand,
"opendiscord:priority-get":ODTextCommand,
"opendiscord:transfer":ODTextCommand,
"opendiscord:dump":api.ODTextCommand,
"opendiscord:help":api.ODTextCommand,
"opendiscord:panel":api.ODTextCommand,
"opendiscord:close":api.ODTextCommand,
"opendiscord:delete":api.ODTextCommand,
"opendiscord:reopen":api.ODTextCommand,
"opendiscord:claim":api.ODTextCommand,
"opendiscord:unclaim":api.ODTextCommand,
"opendiscord:pin":api.ODTextCommand,
"opendiscord:unpin":api.ODTextCommand,
"opendiscord:move":api.ODTextCommand,
"opendiscord:rename":api.ODTextCommand,
"opendiscord:add":api.ODTextCommand,
"opendiscord:remove":api.ODTextCommand,
"opendiscord:blacklist-view":api.ODTextCommand,
"opendiscord:blacklist-add":api.ODTextCommand,
"opendiscord:blacklist-remove":api.ODTextCommand,
"opendiscord:blacklist-get":api.ODTextCommand,
"opendiscord:stats-global":api.ODTextCommand,
"opendiscord:stats-reset":api.ODTextCommand,
"opendiscord:stats-ticket":api.ODTextCommand,
"opendiscord:stats-user":api.ODTextCommand,
"opendiscord:clear":api.ODTextCommand,
"opendiscord:autoclose-disable":api.ODTextCommand,
"opendiscord:autoclose-enable":api.ODTextCommand,
"opendiscord:autodelete-disable":api.ODTextCommand,
"opendiscord:autodelete-enable":api.ODTextCommand,
"opendiscord:topic-set":api.ODTextCommand,
"opendiscord:priority-set":api.ODTextCommand,
"opendiscord:priority-get":api.ODTextCommand,
"opendiscord:transfer":api.ODTextCommand,
}
/**## ODTextCommandManager_Default `default_class`
@@ -135,29 +134,29 @@ export interface ODTextCommandManagerIds_Default {
*
* This default class is made for the global variable `opendiscord.client.textCommands`!
*/
export class ODTextCommandManager_Default extends ODTextCommandManager {
export class ODTextCommandManager_Default extends api.ODTextCommandManager {
get<TextCommandId extends keyof ODTextCommandManagerIds_Default>(id:TextCommandId): ODTextCommandManagerIds_Default[TextCommandId]
get(id:ODValidId): ODTextCommand|null
get(id:api.ODValidId): api.ODTextCommand|null
get(id:ODValidId): ODTextCommand|null {
get(id:api.ODValidId): api.ODTextCommand|null {
return super.get(id)
}
remove<TextCommandId extends keyof ODTextCommandManagerIds_Default>(id:TextCommandId): ODTextCommandManagerIds_Default[TextCommandId]
remove(id:ODValidId): ODTextCommand|null
remove(id:api.ODValidId): api.ODTextCommand|null
remove(id:ODValidId): ODTextCommand|null {
remove(id:api.ODValidId): api.ODTextCommand|null {
return super.remove(id)
}
exists(id:keyof ODTextCommandManagerIds_Default): boolean
exists(id:ODValidId): boolean
exists(id:api.ODValidId): boolean
exists(id:ODValidId): boolean {
exists(id:api.ODValidId): boolean {
return super.exists(id)
}
onInteraction(commandPrefix:string, commandName:string|RegExp, callback:ODTextCommandInteractionCallback): void {
onInteraction(commandPrefix:string, commandName:string|RegExp, callback:api.ODTextCommandInteractionCallback): void {
return super.onInteraction(commandPrefix,commandName,callback)
}
}
@@ -176,32 +175,32 @@ export interface ODContextMenuManagerIds_Default {
*
* This default class is made for the global variable `opendiscord.client.contextMenus`!
*/
export class ODContextMenuManager_Default extends ODContextMenuManager {
export class ODContextMenuManager_Default extends api.ODContextMenuManager {
get<ContextMenuId extends keyof ODContextMenuManagerIds_Default>(id:ContextMenuId): ODContextMenuManagerIds_Default[ContextMenuId]
get(id:ODValidId): ODContextMenu|null
get(id:api.ODValidId): api.ODContextMenu|null
get(id:ODValidId): ODContextMenu|null {
get(id:api.ODValidId): api.ODContextMenu|null {
return super.get(id)
}
remove<ContextMenuId extends keyof ODContextMenuManagerIds_Default>(id:ContextMenuId): ODContextMenuManagerIds_Default[ContextMenuId]
remove(id:ODValidId): ODContextMenu|null
remove(id:api.ODValidId): api.ODContextMenu|null
remove(id:ODValidId): ODContextMenu|null {
remove(id:api.ODValidId): api.ODContextMenu|null {
return super.remove(id)
}
exists(id:keyof ODContextMenuManagerIds_Default): boolean
exists(id:ODValidId): boolean
exists(id:api.ODValidId): boolean
exists(id:ODValidId): boolean {
exists(id:api.ODValidId): boolean {
return super.exists(id)
}
onInteraction(menuName:keyof ODContextMenuManagerIds_Default, callback:ODContextMenuInteractionCallback): void
onInteraction(menuName:string|RegExp, callback:ODContextMenuInteractionCallback): void
onInteraction(menuName:keyof ODContextMenuManagerIds_Default, callback:api.ODContextMenuInteractionCallback): void
onInteraction(menuName:string|RegExp, callback:api.ODContextMenuInteractionCallback): void
onInteraction(menuName:string|RegExp, callback:ODContextMenuInteractionCallback): void {
onInteraction(menuName:string|RegExp, callback:api.ODContextMenuInteractionCallback): void {
return super.onInteraction(menuName,callback)
}
}