We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I try to use ctx.update.chats with master branch I get the following error:
ctx.update.chats
master
In src/main.cr:6:14 6 | ctx.update.chats do |chat| ^---- Error: instantiating 'Tourmaline::Update#chats()' In lib/tourmaline/src/tourmaline/types/custom/update.cr:72:12 72 | self.chats.each { |c| block.call(c) } ^---- Error: instantiating 'Tourmaline::Update#chats()' In lib/tourmaline/src/tourmaline/types/custom/update.cr:54:30 54 | chats.concat(message.chats) if message ^---- Error: instantiating 'Tourmaline::Message#chats()' In lib/tourmaline/src/tourmaline/types/custom/message.cr:61:31 61 | if reply_message = self.reply_message ^------------ Error: undefined method 'reply_message' for Tourmaline::Message Did you mean 'reply_to_message'? Tourmaline::Message trace: lib/tourmaline/src/tourmaline/types/custom/message.cr:61 if reply_message = self.reply_message
# shard.yml dependencies: tourmaline: github: protoncr/tourmaline branch: master
# src/main.cr require "tourmaline" client = Tourmaline::Client.new(ENV["BOT_TOKEN"]) echo_handler = Tourmaline::CommandHandler.new("echo") do |ctx| ctx.update.chats do |chat| puts chat.id end end client.register(echo_handler) client.poll
As mentioned in the error itself: "Did you mean 'reply_to_message'?" When the changed reply_message to reply_to_message, it seems to work as expected.
reply_message
reply_to_message
diff --git a/src/tourmaline/types/custom/message.cr b/src/tourmaline/types/custom/message.cr index f0ccdf00..5e49e4e9 100644 --- a/src/tourmaline/types/custom/message.cr +++ b/src/tourmaline/types/custom/message.cr @@ -58,8 +58,8 @@ module Tourmaline chats << self.chat chats << self.sender_chat chats << self.forward_from_chat - if reply_message = self.reply_message - chats.concat(reply_message.chats) + if reply_to_message = self.reply_to_message + chats.concat(reply_to_message.chats) end chats.compact.uniq end
The text was updated successfully, but these errors were encountered:
Update message.cr
eb77810
protoncr#64
No branches or pull requests
When I try to use
ctx.update.chats
withmaster
branch I get the following error:How to replicate
Possible fix
As mentioned in the error itself: "Did you mean 'reply_to_message'?"
When the changed
reply_message
toreply_to_message
, it seems to work as expected.The text was updated successfully, but these errors were encountered: