Major bugfixes & improvements for v4.1
This commit is contained in:
@@ -147,7 +147,7 @@ export class ODPlugin extends ODManagerData {
|
||||
if ((this.enabled && !this.crashed) || force){
|
||||
try{
|
||||
//import relative plugin directory path (works on windows & unix based systems)
|
||||
const pluginPath = nodepath.join("../../../../plugins/",this.getStartFile())
|
||||
const pluginPath = nodepath.join("../../../../plugins/",this.getStartFile()).replaceAll("\\","/")
|
||||
await import(pluginPath)
|
||||
debug.console.log("Plugin \""+this.id.value+"\" loaded successfully!","plugin")
|
||||
this.executed = true
|
||||
|
||||
@@ -417,7 +417,7 @@ export class ODCommandResponderInstance {
|
||||
/**Defer this command. */
|
||||
async defer(ephemeral:boolean){
|
||||
if (this.type != "interaction" || !(this.interaction instanceof discord.ChatInputCommandInteraction)) return false
|
||||
if (this.interaction.deferred) return false
|
||||
if (this.interaction.deferred || this.interaction.replied) return false
|
||||
const msgFlags: number[] = ephemeral ? [discord.MessageFlags.Ephemeral] : []
|
||||
await this.interaction.deferReply({flags:msgFlags})
|
||||
this.didReply = true
|
||||
@@ -589,7 +589,7 @@ export class ODButtonResponderInstance {
|
||||
}
|
||||
/**Defer this button. */
|
||||
async defer(type:"reply"|"update", ephemeral:boolean){
|
||||
if (this.interaction.deferred) return false
|
||||
if (this.interaction.deferred || this.interaction.replied) return false
|
||||
if (type == "reply"){
|
||||
const msgFlags: number[] = ephemeral ? [discord.MessageFlags.Ephemeral] : []
|
||||
await this.interaction.deferReply({flags:msgFlags})
|
||||
@@ -877,7 +877,7 @@ export class ODDropdownResponderInstance {
|
||||
}
|
||||
/**Defer this dropdown. */
|
||||
async defer(type:"reply"|"update", ephemeral:boolean){
|
||||
if (this.interaction.deferred) return false
|
||||
if (this.interaction.deferred || this.interaction.replied) return false
|
||||
if (type == "reply"){
|
||||
const msgFlags: number[] = ephemeral ? [discord.MessageFlags.Ephemeral] : []
|
||||
await this.interaction.deferReply({flags:msgFlags})
|
||||
@@ -1096,7 +1096,7 @@ export class ODModalResponderInstance {
|
||||
}
|
||||
/**Defer this modal. */
|
||||
async defer(type:"reply"|"update", ephemeral:boolean){
|
||||
if (this.interaction.deferred) return false
|
||||
if (this.interaction.deferred || this.interaction.replied) return false
|
||||
if (type == "reply"){
|
||||
const msgFlags: number[] = ephemeral ? [discord.MessageFlags.Ephemeral] : []
|
||||
await this.interaction.deferReply({flags:msgFlags})
|
||||
@@ -1251,7 +1251,7 @@ export class ODContextMenuResponderInstance {
|
||||
}
|
||||
/**Defer this context menu. */
|
||||
async defer(type:"reply", ephemeral:boolean){
|
||||
if (this.interaction.deferred) return false
|
||||
if (this.interaction.deferred || this.interaction.replied) return false
|
||||
if (type == "reply"){
|
||||
const msgFlags: number[] = ephemeral ? [discord.MessageFlags.Ephemeral] : []
|
||||
await this.interaction.deferReply({flags:msgFlags})
|
||||
|
||||
Reference in New Issue
Block a user