Estal
Estal
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Estal on 12/7/2023 in #djs-questions
Unknown Interaction. Not sure what the cause is
I'm using openai for chat gpt for general chat. It works sometimes and other times it does not. The error I'm getting is
DiscordAPIError[10062]: Unknown interaction
at handleErrors (E:\My Projects\EstalOBot\node_modules\@discordjs\rest\dist\index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (E:\My Projects\EstalOBot\node_modules\@discordjs\rest\dist\index.js:826:23)
at async _REST.request (E:\My Projects\EstalOBot\node_modules\@discordjs\rest\dist\index.js:1266:22)
at async ChatInputCommandInteraction.reply (E:\My Projects\EstalOBot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:111:5)
at async Object.execute (E:\My Projects\EstalOBot\commands\utility\askgpt.js:38:13)
at async Client.<anonymous> (E:\My Projects\EstalOBot\CrisisBot.js:58:3) {
requestBody: { files: [], json: { type: 4, data: [Object] } },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1182356437758918788/aW50ZXJhY3Rpb246MTE4MjM1NjQzNzc1ODkxODc4ODpwOFFIMmtMdFE0Zk54SFZxT0dLNlJRQVJ0b3U3QU4wT3NJQm1KUWw5OVlyeUNHYUpKbDBiSEs0N0FOOUZ5Vjl1aEs4WEhEUkJLcHNHbFozTmNQaERWVXc5cXp1WVBGQjR1eDJndVJxOTY1eGFPcmhjZmNlbEdiMkFNc0o1amVZbw/callback'
}
DiscordAPIError[10062]: Unknown interaction
at handleErrors (E:\My Projects\EstalOBot\node_modules\@discordjs\rest\dist\index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (E:\My Projects\EstalOBot\node_modules\@discordjs\rest\dist\index.js:826:23)
at async _REST.request (E:\My Projects\EstalOBot\node_modules\@discordjs\rest\dist\index.js:1266:22)
at async ChatInputCommandInteraction.reply (E:\My Projects\EstalOBot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:111:5)
at async Object.execute (E:\My Projects\EstalOBot\commands\utility\askgpt.js:38:13)
at async Client.<anonymous> (E:\My Projects\EstalOBot\CrisisBot.js:58:3) {
requestBody: { files: [], json: { type: 4, data: [Object] } },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1182356437758918788/aW50ZXJhY3Rpb246MTE4MjM1NjQzNzc1ODkxODc4ODpwOFFIMmtMdFE0Zk54SFZxT0dLNlJRQVJ0b3U3QU4wT3NJQm1KUWw5OVlyeUNHYUpKbDBiSEs0N0FOOUZ5Vjl1aEs4WEhEUkJLcHNHbFozTmNQaERWVXc5cXp1WVBGQjR1eDJndVJxOTY1eGFPcmhjZmNlbEdiMkFNc0o1amVZbw/callback'
}
6 replies
DIAdiscord.js - Imagine an app
Created by Estal on 12/5/2023 in #djs-questions
Global / Commands
How long does it it take for global / commands to register? Anytime I add a command I have to invite the bot back and it'll show that it has a new command, but it doesn't actually work and instead gives the data that the command wasn't found.
6 replies
DIAdiscord.js - Imagine an app
Created by Estal on 11/14/2023 in #djs-questions
First Example from the site doesn't work.
The very first example to work with and get an idea of tells me "Cannot use import statement outside a module" Do we have to use const? Using 14.14.1 discordjs and Node 18.17.1
4 replies
CC#
Created by Estal on 1/22/2023 in #help
❔ Transitional Timer
I'm Trying to create an animated Menu Expansion and to do so I opted for a winforms timer and have the following code:
WinForms.Timer menuTimer = new WinForms.Timer();

private void settingsDock_MouseDown(object sender, MouseButtonEventArgs e)
{
if(menuBorder.Height == 0)
{
menuTimer.Tick += new EventHandler(MenuTimerOpen);
} else
{
menuTimer.Tick += new EventHandler(MenuTimerClose);
}
menuTimer.Interval = 1;
menuTimer.Start();

}
private void MenuTimerClose(object sender, EventArgs e)
{
if(menuBorder.Height == 0)
{
menuTimer.Stop();
}
else
{
menuBorder.Height = menuBorder.Height - 10;
}
}

private void MenuTimerOpen(object sender, EventArgs e)
{
if(menuBorder.Height == 150)
{
menuTimer.Stop();
}
else
{
menuBorder.Height = menuBorder.Height + 10;
}
}
WinForms.Timer menuTimer = new WinForms.Timer();

private void settingsDock_MouseDown(object sender, MouseButtonEventArgs e)
{
if(menuBorder.Height == 0)
{
menuTimer.Tick += new EventHandler(MenuTimerOpen);
} else
{
menuTimer.Tick += new EventHandler(MenuTimerClose);
}
menuTimer.Interval = 1;
menuTimer.Start();

}
private void MenuTimerClose(object sender, EventArgs e)
{
if(menuBorder.Height == 0)
{
menuTimer.Stop();
}
else
{
menuBorder.Height = menuBorder.Height - 10;
}
}

private void MenuTimerOpen(object sender, EventArgs e)
{
if(menuBorder.Height == 150)
{
menuTimer.Stop();
}
else
{
menuBorder.Height = menuBorder.Height + 10;
}
}
If I have the menuBorder set to 150 when I begin debugging it has no problem closing, but has a problem opening. If I set it to 0 when I begin debugging then it has no problem opening, but has issues closing. Any ideas what I'm doing wrong here?
2 replies
CC#
Created by Estal on 1/20/2023 in #help
❔ Centering in dockpanel
I'm using the WPF Fontawesome package and am looking to center some of the font awesome icons in dock panels. I've tried running HorizontalAlignment="Center" on the dock and on the fa source and it still goes to the right. Does anyone know how to do this with DockPanel.Dock="Right" Setup?
2 replies
CC#
Created by Estal on 1/13/2023 in #help
❔ Replace multiple Lines
What I had before was
C#
string SessionName = File.ReadAllText(ConfigFile);
SessionName = SessionName.Replace("SessionName=\"" + LoadSetting(ConfigFile, "SessionName") + "\"", "SessionName=\"" + serverName.Text + "\"");
File.WriteAllText(ConfigFile, SessionName);

string Password = File.ReadAllText(ConfigFile);
Password = Password.Replace("JoinPassword=\"" + LoadSetting(ConfigFile, "JoinPassword") + "\"", "JoinPassword=\"" + serverPass.Text + "\"");
File.WriteAllText(ConfigFile, Password);
C#
string SessionName = File.ReadAllText(ConfigFile);
SessionName = SessionName.Replace("SessionName=\"" + LoadSetting(ConfigFile, "SessionName") + "\"", "SessionName=\"" + serverName.Text + "\"");
File.WriteAllText(ConfigFile, SessionName);

string Password = File.ReadAllText(ConfigFile);
Password = Password.Replace("JoinPassword=\"" + LoadSetting(ConfigFile, "JoinPassword") + "\"", "JoinPassword=\"" + serverPass.Text + "\"");
File.WriteAllText(ConfigFile, Password);
I now realize that I'm essentially opening the file every iteration. What I'm trying to figure out is how I can go through multiple lines and write them all at once time. If anyone knows it'd be appreciated. Gonna keep trying to figure it out for the time being.
12 replies
CC#
Created by Estal on 1/12/2023 in #help
❔ Updating text on main thread from running application WPF C Sharp
Heyo All. I have a wrapper I'm wrapping steamcmd in and the launcher is supposed to intercept the text output by steamcmd and put it into the launcher. The current code works
private void OutputHandler(object sendingProcess, DataReceivedEventArgs outLine)
{
if (!String.IsNullOrEmpty(outLine.Data))
{

App.Current.Dispatcher.Invoke((Action)delegate
{
textbox.AppendText(outLine.Data + Environment.NewLine);
});
}
}
private void OutputHandler(object sendingProcess, DataReceivedEventArgs outLine)
{
if (!String.IsNullOrEmpty(outLine.Data))
{

App.Current.Dispatcher.Invoke((Action)delegate
{
textbox.AppendText(outLine.Data + Environment.NewLine);
});
}
}
It works in the fact that it outputs and changes the textbox data on the main GUI. What I'm having issues with is it waits until the output is complete rather than a running line of information coming from the console. Does anyone by chance have any suggestions as to what I'm doing wrong?
6 replies