egebilecen / PZServerDiscordBot

A Project Zomboid Discord Bot written in C# using Discord.NET to manage and execute commands on Project Zomboid Server.
GNU General Public License v3.0
67 stars 14 forks source link

Translation - Can't compile the source correctly #40

Closed whatahelll closed 1 year ago

whatahelll commented 1 year ago

When the project has compiled, the .exe is just a black screen, the server doesn't exec neither bot.

whatahelll commented 1 year ago

image

egebilecen commented 1 year ago

Hey, source code is compiled succesfully, actually. Check pzbot.log file. You will probably see some messages like this:

[01.12.2022 09:44:31 UTC]BotUtility.NotifyLatestBotVersion() - commandChannel is null.

And if you check your discord channel, you should see bot instructing you about setup: (If last created channel is visible to bot, that is. Otherwise bot won't send messages)

Screenshot_1

But maybe I should add a message to console that saying bot is running.

whatahelll commented 1 year ago

ooh, those messages haven't showed up to me when i type the command to create the channels i get the message that the bot is not configured yet.

whatahelll commented 1 year ago

and yeah, the pzlogs show me that

whatahelll commented 1 year ago

np, thank you

egebilecen commented 1 year ago

np, thank you

facepalms Sorry, I just checked out and there isn't any issue with setup commands.

image Try to use the command like this. Tag a channel you want bot to work in. If bot doesn't respond, that means bot has no access to channel that you just sent your message.

Edit: Be sure to check intent configuration as well. You can find more details in README.md file.

egebilecen commented 1 year ago

By the way, I added some warning messages onto console as well. Just in case of someone builds the source code themselves and try to test some stuff. It will be added with the release of v1.8.0.

whatahelll commented 1 year ago

hmm i tried but nothing, when i turn on the bot the command channel back to "0" in config.

whatahelll commented 1 year ago

and just give me a black screen, the server don't turn on

whatahelll commented 1 year ago

just the bot, not like the compiled version

egebilecen commented 1 year ago

It seems like you able to configure public and log channels but not command channel. Try to run !set_command_channel in one of those (public or log) channels.

whatahelll commented 1 year ago

same error, i ran in a public channel. "the bot isn't configured yet"

whatahelll commented 1 year ago

ps: i just made a translations change in source

egebilecen commented 1 year ago

Translation shouldn't create any problem. Procedure follows as: Screenshot_1

If bot doesn't respond with any reaction, it means it doesn't received the command at all. Which means two things: bot has no access to channel or wrong intent configuration.

whatahelll commented 1 year ago

yeah, the bot responds with a "x" reaction

egebilecen commented 1 year ago

Does it respond with any message?

whatahelll commented 1 year ago

react then send this message: Bot configuration haven't done yet.

whatahelll commented 1 year ago

when i use the command to define the command channel etc

egebilecen commented 1 year ago

Can you send me screenshot of the channel? With your messages visible. (Just like the picture that I sent above)

egebilecen commented 1 year ago

Okay, there is a check going on which fails because of translation. These checks are done in CommandHandler.cs. You might want to take a look at it.

whatahelll commented 1 year ago

image

egebilecen commented 1 year ago

Did you change any translation in CommandHandler.cs line 122?

This is the original line:

else if(!isBotConfigured && commandModule != "BotCommands")
whatahelll commented 1 year ago

yes i do maybe i messed the source... let me try compile without changes

egebilecen commented 1 year ago

there shouldn't be any problem as long as file names aren't changed or class names

whatahelll commented 1 year ago

worked i messed the class names. one more question how can i make the bot work with pz?

egebilecen commented 1 year ago

worked i messed the class names. one more question how can i make the bot work with pz?

First, you need to build (&run) it in release configuration. Second, just follow the steps in README.md and you are good to go.

whatahelll commented 1 year ago

Nice. It worked, thanks for you time!

egebilecen commented 1 year ago

Nice. It worked, thanks for you time!

You are welcome, good luck! :)

egebilecen commented 1 year ago

Hey there, I am planning to add a localization system which will allow people to easily change the command names, their descriptions, bot responses etc. to their own language. My plan is to add this feature with v1.8.0 along with auto-update system. No release date though so I am just writing this to give a heads up :)