Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.nio.file.NoSuchFileException: bot.properties #63

Open
ravirupareliya opened this issue Apr 28, 2016 · 7 comments
Open

java.nio.file.NoSuchFileException: bot.properties #63

ravirupareliya opened this issue Apr 28, 2016 · 7 comments

Comments

@ravirupareliya
Copy link
Contributor

ravirupareliya commented Apr 28, 2016

I had this file along with src, javadoc, pom.xml and other files. But still it is showing me that NoSuchFileException for bot.properties.

and here what i have inside bot.properties:

LOGIN-EMAIL=myEmailAddressPASSWORD=accountPasswordROOMS=TRIGGER=**
SITE=stackoverflow

Where should i put that?

@Vogel612
Copy link
Collaborator

the bot.properties goes into the root of the project, if you run with maven. Otherwise it needs to be in your current working directory, IOW the directory where you invoke your java process.

Also remember that the format of bot.properties requires linebreaks (I assume they just didn't get formatted correctly)

Furthermore the login to chat may currently be non-functional, because there have been breaking changes to the way SE exposes chat-login. Drop me a note regarding how it goes :)

@ravirupareliya
Copy link
Contributor Author

yes, its working now, i have just copied bot.properties in root where jar is created.

As you said there might be some change in SE login, yes there is small change in login page of SE.

This is the line we need to change in StackExchangeChat.java inorder to login with stackoverflow.

HtmlForm loginForm = loginPage.getFirstByXPath("//*[@id=\"se-login-form\"]");

replace it with

HtmlForm loginForm = loginPage.getFirstByXPath("//*[@id=\"login-form\"]");

Apart from this, there is one more query i have, i have successfully logged in to SE chat and bot has posted welcome message also, but how can i interect with my bot.

I have set trigger value to ** but how should i use it? because i have tried a lot and seems bot is not listening any request. Do i need to upload my jar file on live server? or is it ok to run it in local?

@Vogel612
Copy link
Collaborator

It should be okay to run the bot locally. To interact with the bot it should be sufficient to just write a message beginning with the trigger value. That should invoke a command.

Make sure to have a look at your immediate window. The bot may log diagnostic information there, when it doesn't respond in chat.

example message:

**help

@ravirupareliya
Copy link
Contributor Author

ravirupareliya commented Apr 29, 2016

yes i tried that, here is the room i am doing all this things http://chat.stackoverflow.com/rooms/110563/nothing-to-do

it is not responding, neither it is showing any message in my console. You can refer this screenshot.

chat bot

@Vogel612
Copy link
Collaborator

can you verify for me whether StackExchangeChat#queryMessages is invoked? and if it is invoked whether it actually propagates any results?

@ravirupareliya
Copy link
Contributor Author

ravirupareliya commented Apr 29, 2016

yes it is invoked, but error is in StackExchangeChat#handleChatEvents , it is going in catch block.

   java.lang.NullPointerException
    at com.gmail.inverseconduit.datatype.ChatMessage.toString(ChatMessage.java:38)
    at java.lang.String.valueOf(Unknown Source)
    at java.lang.StringBuilder.append(Unknown Source)
    at com.gmail.inverseconduit.chat.StackExchangeChat.lambda$null$24(StackExchangeChat.java:322)
    at com.gmail.inverseconduit.chat.StackExchangeChat$$Lambda$34/2000460090
.accept(Unknown Source)
    at java.lang.Iterable.forEach(Unknown Source)
    at com.gmail.inverseconduit.chat.StackExchangeChat.lambda$handleChatEvents$25(StackExchangeChat.java:320)
    at com.gmail.inverseconduit.chat.StackExchangeChat$$Lambda$33/2064677091.accept(Unknown Source)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
    at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
    at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
    at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)
    at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
    at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
    at java.util.stream.ReferencePipeline.forEach(Unknown Source)
    at com.gmail.inverseconduit.chat.StackExchangeChat.handleChatEvents(StackExchangeChat.java:318)
    at com.gmail.inverseconduit.chat.StackExchangeChat.queryAndHandleRoomEvents(StackExchangeChat.java:264)
    at com.gmail.inverseconduit.chat.StackExchangeChat.lambda$queryMessages$20(StackExchangeChat.java:254)
    at com.gmail.inverseconduit.chat.StackExchangeChat$$Lambda$30/1376907859.accept(Unknown Source)

after lot of debugging i found that events.getSite() is returning null in StackExchangeChat#handleChatEvents

@Unihedro
Copy link
Owner

Is this still happening?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants