-
Notifications
You must be signed in to change notification settings - Fork 48
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
Q-Code #29
Q-Code #29
Conversation
@Sandarr95 Are you can create a unittest? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally (in 2 years!) got to read about the naming behind this PR and really liked it.
It needs some polishing, maybe you can do it if you have time and energy, or I'd do it soon.
Q-Codes in Morse are shorthands for common patterns. `morse.qcodes/direct-reply` & `morse.qcodes/req-morse` are the Q-Codes already available. Here is an example usage of both. | ||
|
||
```clojure | ||
(ns look.anotherbadlynamedns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the rest of the docs uses slightly different style of imports
[morse.handlers :as h] | ||
[somehttpserver :as http])) | ||
|
||
(def token "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the is no need repeat what was there before
@@ -0,0 +1,11 @@ | |||
{:paths ["src"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is quite confusing to have two sources of dependencies, because people would need to keep them both up to date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot about this PR as well, this was added to do some troubleshooting. I'll look into fixing up this PR again next weekend.
#{(s/tuple "getMe" ::getMe) | ||
(s/tuple "sendMessage" ::sendMessage)}) | ||
|
||
(s/def ::request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see it used anywhere, maybe left here by mistake?
Cleaned this up in #56 |
I left it really simple for now, just 2 functions in qcodes.clj.
One will auto reply any text returned by the handler.
The other is middleware, causing the handler to work the same for polling and webhooks (and can also be made secure).
Let me know what you think.
Also had the idea to make a single function to start the bot, so if you provide a webhook it will use a server, but not sure how to make people choose what server they want to use.