Giter Site home page Giter Site logo

Comments (5)

raLaaaa avatar raLaaaa commented on August 12, 2024

Hey, thanks for the hint! You are right the readme is missing the variable name.
I'll adapt that :)

You indeed need to import the library. The terminal output you pasted hints that the library is not correctly imported.
import io.taliox.zulip.ZulipRestExecutor; should fix that.

from zulip-java-rest.

JonathanLindsey avatar JonathanLindsey commented on August 12, 2024

Thanks, that import helped! However, when I added the code to send a message it does not compile again. Of course I understand it won't send the message until I fill in my API key, stream and such but it should at least compile. Do I need another import line? I already tried import io.taliox.zulip.PostMessage; and import io.taliox.zulip.*;

Sorry for the newbie questions.

BTW you made a small typo in your commit this morning of the spelling of executor.

Code:

import io.taliox.zulip.ZulipRestExecutor;

class Main {
  public static void main(String[] args) {
    ZulipRestExecutor executor  = new ZulipRestExecutor("[email protected]", "apikey","https://zulip.example.com/");

    PostMessage postMessage = new PostMessage("streamname", "topicname", "hello world");
    String response = executor.executeCall(postMessage);
  }
}

Terminal output:

 javac -classpath .:/run_dir/junit-4.12.jar:target/dependency/* -d . Main.java
Main.java:7: error: cannot find symbol
    PostMessage postMessage = new PostMessage("streamname", "topicname", "hello world");
    ^
  symbol:   class PostMessage
  location: class Main
Main.java:7: error: cannot find symbol
    PostMessage postMessage = new PostMessage("streamname", "topicname", "hello world");
                                  ^
  symbol:   class PostMessage
  location: class Main
2 errors
compiler exit status 1


from zulip-java-rest.

raLaaaa avatar raLaaaa commented on August 12, 2024

I guess I shouldn't do things in a hurry, fixed it.

You have to do import io.taliox.zulip.calls.messages.PostMessage; to access this class.
I'm not sure why import io.taliox.zulip.*; did not work though.

from zulip-java-rest.

raLaaaa avatar raLaaaa commented on August 12, 2024

I'm assuming you could fix it. I'll cose this issue.

from zulip-java-rest.

JonathanLindsey avatar JonathanLindsey commented on August 12, 2024

That is fine. Thank you.

Just for your information this explains why import io.taliox.zulip.*; doesn't work.
https://stackoverflow.com/questions/18245483/recursive-import-java

from zulip-java-rest.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.