Implemented ODStates (Message States)

This commit is contained in:
DJj123dj
2026-05-06 21:11:53 +02:00
parent 5763659900
commit 7dd8a57a83
10 changed files with 63 additions and 5 deletions
+2 -2
View File
@@ -78,7 +78,7 @@ export const loadDatabaseCleanersCode = async () => {
if (!validPanels.includes(panel.key)){
try{
const splittedId = panel.key.split("_")
const message = await opendiscord.client.fetchGuildChannelMessage(mainServer,splittedId[0],splittedId[1])
const message = await opendiscord.client.fetchChannelMessage(splittedId[0],splittedId[1])
if (message) validPanels.push(panel.key)
}catch{}
}
@@ -302,7 +302,7 @@ export const loadPanelAutoUpdateCode = async () => {
const splittedId = panelId.key.split("_")
const channel = await opendiscord.client.fetchGuildTextChannel(mainServer,splittedId[0])
if (!channel) return
const message = await opendiscord.client.fetchGuildChannelMessage(mainServer,channel,splittedId[1])
const message = await opendiscord.client.fetchChannelMessage(channel,splittedId[1])
if (!message || !message.editable) return
message.edit((await opendiscord.builders.messages.getSafe("opendiscord:panel").build("auto-update",{guild:mainServer,channel,user:opendiscord.client.client.user,panel})).message)
+6
View File
@@ -96,6 +96,12 @@ export const loadAllEvents = () => {
"onTextCommandLoad",
"afterTextCommandsLoaded",
//states
"onStateLoad",
"afterStatesLoaded",
"onStateInit",
"afterStatesInitiated",
//plugin loading before managers
"onPluginBeforeManagerLoad",
"afterPluginBeforeManagerLoaded",
+5
View File
@@ -0,0 +1,5 @@
import {opendiscord, api, utilities} from "../../index.js"
export const loadAllStates = async () => {
}