PolishDywan
Discord Module
Hello! I got a Discord module for a server script on GTAV. Unfortunately, it doesn't run on Ubuntu... Everything works fine on Windows. I have the correct path and permissions.
Code:
Error on startup:
public static void StartBotProcess()
{
try
{
KillBotProcess();
g_BotProcess = new Process();
g_BotProcess.StartInfo.FileName = Path.Combine(Directory.GetCurrentDirectory(), "netcoreapp3.1", Helpers.FormatString("DiscordBot{0}", RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : ""));
#if !DEBUG || RUN_DISCORD_BOT_IN_DEBUG
g_BotProcess.StartInfo.RedirectStandardOutput = true;
g_BotProcess.StartInfo.RedirectStandardError = true;
g_BotProcess.OutputDataReceived += new DataReceivedEventHandler(OutputHandler);
g_BotProcess.ErrorDataReceived += new DataReceivedEventHandler(OutputHandler);
g_BotProcess.StartInfo.UseShellExecute = false;
#else
g_BotProcess.StartInfo.UseShellExecute = true;
#endif
g_BotProcess.Start();
#if !DEBUG || RUN_DISCORD_BOT_IN_DEBUG
g_BotProcess.BeginOutputReadLine();
g_BotProcess.BeginErrorReadLine();
#endif
}
catch
{
}
}
public static void StartBotProcess()
{
try
{
KillBotProcess();
g_BotProcess = new Process();
g_BotProcess.StartInfo.FileName = Path.Combine(Directory.GetCurrentDirectory(), "netcoreapp3.1", Helpers.FormatString("DiscordBot{0}", RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : ""));
#if !DEBUG || RUN_DISCORD_BOT_IN_DEBUG
g_BotProcess.StartInfo.RedirectStandardOutput = true;
g_BotProcess.StartInfo.RedirectStandardError = true;
g_BotProcess.OutputDataReceived += new DataReceivedEventHandler(OutputHandler);
g_BotProcess.ErrorDataReceived += new DataReceivedEventHandler(OutputHandler);
g_BotProcess.StartInfo.UseShellExecute = false;
#else
g_BotProcess.StartInfo.UseShellExecute = true;
#endif
g_BotProcess.Start();
#if !DEBUG || RUN_DISCORD_BOT_IN_DEBUG
g_BotProcess.BeginOutputReadLine();
g_BotProcess.BeginErrorReadLine();
#endif
}
catch
{
}
}
No file or directory
No file or directory
36 replies