Giter Club home page Giter Club logo

tourmaline's People

Contributors

banashek avatar dammer avatar dependabot[bot] avatar drvtiny avatar etra0 avatar f1reflyyyylmao avatar github-actions[bot] avatar h4ckm03d avatar hmnd avatar jacotsu avatar kalinon avatar morigm avatar nilsding avatar nordborn avatar oprypin avatar staraway225 avatar tomsotte avatar watzon avatar yashko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tourmaline's Issues

how to get username

hello im new on tourmaline and telegram how i got user username like:

Hello username! how are you?

note: im using this script

require "tourmaline"

class StudioBot < Tourmaline::Client
  @[Command("start")]
  def start_command(ctx)
    ctx.message.reply("Ola!, eu sou o studio bot mas pode me chamar de puppy, sou uma inteligencia artificial feita para te ajudar!, digite /ajuda para ver meus comandos e /catalogo para ver meus itens!")
  end

  @[Command("ajuda")]
    def ajuda_command(ctx)
    ctx.message.reply("Ola!, meus atuais comandos sao:
		/start - Mostra a mensagem do comeco
		/catalogo - Lhe da o nosso catalogo")
  end
end

bot = StudioBot.new(bot_token: "Secret Token LOL")
bot.poll

Ignore what his says im brazilian

Command parsing are broken

Hi! First of all thanks for your work, it is really pleasure to play with such well organized lib.

I took the bot from echo example and trying to get response for echo command, but nothing happens. I had debugged until this line, the handler execution breaks here. Seems the last major changes with messages parsing had broke the feature. The commands are not parsed in both webhook and polling modes.

I had tried the previous release v0.25.1 and it is parsing commands correctly.

Don't work ENV["API_KEY"] in README example

Hi! I tried to run example bot in README and I get unhandled exception.

require "tourmaline"

class EchoBot < Tourmaline::Client
  @[Command("echo")]
  def echo_command(ctx)
    ctx.message.reply(ctx.text)
  end
end

bot = EchoBot.new(ENV["5952279715:AAGEVsV3Y_t64zZ7QSndK..."])
bot.poll

Unhandled exception: Missing ENV key: "5952279715:AAGEVsV3Y_t64zZ7QSndK..." (KeyError)

Then I went to the site and took another example of the same code.

require "tourmaline"

class EchoBot < Tourmaline::Client
  @[Command("echo")]
  def echo_command(ctx)
    ctx.message.respond(ctx.text)
  end
end

bot = EchoBot.new("5952279715:AAGEVsV3Y_t64zZ7QSndK...")
bot.poll

And this code work!
Is it a bug in my code or in a framework?
The token was complete this one I came up with for an example...

Rate limiting

Telegram has two separate rate limit conditions in place. The first is that a bot cannot send more than 30 (or so) messages per second. The second is that a bot cannot send more than 20 messages to the same group per minute. If either of these limits are hit the bot will start getting 429 errors.

It would be nice, though not absolutely imperative, to have a rate limiter in place to keep the bot from hitting these limits. The challenge is not so much the first condition, but the second.

Convenience class for paged messages using keyboards

Had this idea earlier and figured it would be a good thing to get down here. The idea is to have a convenience class, maybe PagedKeyboard or something, which could be used to create a message with a keyboard featuring << Previous and Next >> buttons (or something of the sort).

It is possible this could be a part of a larger convenience class for generating messages with keyboards that hold on to their own state.

get_chat_member usage

Hi, i've just picked up crystal programming so this may be an incorrect usage, why do i have to manually bind the client in get_chat_member?

external_commenter = self.get_chat_member discussion_chat, sender
external_commenter.client = self
# Remove all permissions except message read/join
unless external_commenter.is_member
    external_commenter.restrict(false)
    msg.delete
end

The restrict method doesn't work unless i manually bind external_commenter.client with the client instance. Shouldn't self.get_chat_member automatically bind the client? Or maybe there is another way to change users permissions?

How to contribute to the website?

It's not clear how to send PR's for the website. There is a tourmaline-website repo and this repo has a gh-pages branch. I see multiple typo's in de code examples or examples that do not work anymore.

It would help if this was clearly documented and if the website-repo is outdated it would be wise to remove it.

Thanks

Add support for Passport

I have had no need for the passport features, nor really the ability to test them, but this does need to be implemented pre-v1

control and collaboration

Let’s get started with GitHub!GitHub is a code hosting platform for version control #7 collaboration, your project needs. We recommend including a README, or a file with information about your project, considered to be the definitive branch. associated commit message Started and managed a new branch you’ll see your new.

Is the project maintained?

Hello,

I've checked your project and it either:

  • Has specs failed with the latest Crystal (0.26.1)
  • Has no any specs to run so it cannot be validated to be up to date
  • Has the latest commit dated more than a year ago

Your project is in Awesome Crystal list, so I'd like to ask if the project maintained?

I'll initiate a PR to remove your project from the list if you don't respond positively within 7 days.

I'm sorry if I'm wrong, because I've been checking many shards with automated script.

Thanks,
Vlad.

SSL error after sendingMessage

Hi,
I'm receiving the error below when sending message with my bot.
I'm not sure if it's based on tourmaline, tourmaline's shards, or Crystal OpenSSL binding.

Can you help me understanding this error.
Thanks.

E, [2020-05-25T00:05:02.950958000Z #14264]   ERROR -- crystal-run-main.tmp:tourmaline.client: SSL_read: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac (OpenSSL::SSL::Error)
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/openssl/ssl/socket.cr:124:9 in 'unbuffered_read'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/io/buffered.cr:240:12 in 'fill_buffer'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/io/buffered.cr:103:7 in 'peek'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/io.cr:623:37 in 'gets'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/io.cr:582:5 in 'gets'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client/response.cr:126:5 in 'from_io?'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:588:5 in 'exec_internal_single'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:574:5 in 'exec_internal'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:570:5 in 'exec'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:692:5 in 'exec:method:headers:body:path'
  from lib/tourmaline/src/tourmaline/client.cr:80:9 in 'request'
  from lib/tourmaline/src/tourmaline/client/core.cr:33:7 in 'get_updates'
  from lib/tourmaline/src/tourmaline/client/core.cr:27:5 in 'get_updates'
  from lib/tourmaline/src/tourmaline/client/core.cr:1177:21 in 'poll'
  from src/main.cr:19:1 in '__crystal_main'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/crystal/main.cr:105:5 in 'main_user_code'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/crystal/main.cr:91:7 in 'main'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/crystal/main.cr:114:3 in 'main'
  from __libc_start_main
  from _start
  from ???

�[31m[Error  ] [tourmaline.client] - SSL_read: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac (OpenSSL::SSL::Error)
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/openssl/ssl/socket.cr:124:9 in 'unbuffered_read'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/io/buffered.cr:240:12 in 'fill_buffer'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/io/buffered.cr:103:7 in 'peek'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/io.cr:623:37 in 'gets'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/io.cr:582:5 in 'gets'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client/response.cr:126:5 in 'from_io?'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:588:5 in 'exec_internal_single'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:574:5 in 'exec_internal'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:570:5 in 'exec'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:692:5 in 'exec:method:headers:body:path'
  from lib/tourmaline/src/tourmaline/client.cr:80:9 in 'request'
  from lib/tourmaline/src/tourmaline/client/core.cr:33:7 in 'get_updates'
  from lib/tourmaline/src/tourmaline/client/core.cr:27:5 in 'get_updates'
  from lib/tourmaline/src/tourmaline/client/core.cr:1177:21 in 'poll'
  from src/main.cr:19:1 in '__crystal_main'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/crystal/main.cr:105:5 in 'main_user_code'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/crystal/main.cr:91:7 in 'main'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/crystal/main.cr:114:3 in 'main'
  from __libc_start_main
  from _start
  from ???
�[0m
E, [2020-05-25T00:05:02.956773000Z #14264]   ERROR -- crystal-run-main.tmp:tourmaline.client: SSL_write: I/O error (OpenSSL::SSL::Error)
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/openssl/ssl/socket.cr:137:7 in 'unbuffered_write'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/io/buffered.cr:218:5 in 'flush'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:651:5 in 'send_request'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:587:5 in 'exec_internal_single'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:574:5 in 'exec_internal'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:570:5 in 'exec'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:692:5 in 'exec:method:headers:body:path'
  from lib/tourmaline/src/tourmaline/client.cr:80:9 in 'request'
  from lib/tourmaline/src/tourmaline/client/core.cr:33:7 in 'get_updates'
  from lib/tourmaline/src/tourmaline/client/core.cr:27:5 in 'get_updates'
  from lib/tourmaline/src/tourmaline/client/core.cr:1177:21 in 'poll'
  from src/main.cr:19:1 in '__crystal_main'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/crystal/main.cr:105:5 in 'main_user_code'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/crystal/main.cr:91:7 in 'main'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/crystal/main.cr:114:3 in 'main'
  from __libc_start_main
  from _start
  from ???
Caused by: SSL_write: Success (RuntimeError)

�[31m[Error  ] [tourmaline.client] - SSL_write: I/O error (OpenSSL::SSL::Error)
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/openssl/ssl/socket.cr:137:7 in 'unbuffered_write'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/io/buffered.cr:218:5 in 'flush'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:651:5 in 'send_request'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:587:5 in 'exec_internal_single'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:574:5 in 'exec_internal'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:570:5 in 'exec'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/http/client.cr:692:5 in 'exec:method:headers:body:path'
  from lib/tourmaline/src/tourmaline/client.cr:80:9 in 'request'
  from lib/tourmaline/src/tourmaline/client/core.cr:33:7 in 'get_updates'
  from lib/tourmaline/src/tourmaline/client/core.cr:27:5 in 'get_updates'
  from lib/tourmaline/src/tourmaline/client/core.cr:1177:21 in 'poll'
  from src/main.cr:19:1 in '__crystal_main'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/crystal/main.cr:105:5 in 'main_user_code'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/crystal/main.cr:91:7 in 'main'
  from /home/christian/opt/crystal-0.34.0-1/share/crystal/src/crystal/main.cr:114:3 in 'main'
  from __libc_start_main
  from _start
  from ???
Caused by: SSL_write: Success (RuntimeError)

Missing example of test spec

I am looking for an example of effective spec testing of the bots with Tourmaline.

I am willing to contribute and add to all the example bots, but I would like to have some guidance/advice before starting this endeavor.

Cheers

Undefined method 'reply_message' for Tourmaline::Message

When I try to use ctx.update.chats with master branch I get the following error:

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

How to replicate

# 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

Possible fix

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.

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

Compile(r) error, the compiler can't find files under a weird name

I wrote a simple echo bot, just like in the documentation, compiling it raises this:

Invalid memory access (signal 11) at address 0x0
[0xaaaad9170424] ???
[0xaaaad90d1180] __crystal_sigfault_handler +400
[0xaaaad917faa0] sigfault_handler +40
[0xffffaf52d5e4] ???
[0xffffac6e45c8] ???
[0xffffac6e91f4] ???
[0xffffab5a4760] _ZNK4llvm12CallLowering9lowerCallERNS_16MachineIRBuilderENS_17ImmutableCallSiteENS_8ArrayRefINS_8RegisterEEENS4_IS6_EES5_St8functionIFjvEE +2176
[0xffffab5bf140] _ZN4llvm12IRTranslator17translateCallSiteERKNS_17ImmutableCallSiteERNS_16MachineIRBuilderE +848
[0xffffab5bfa94] _ZN4llvm12IRTranslator13translateCallERKNS_4UserERNS_16MachineIRBuilderE +500
[0xffffab5c3eb0] _ZN4llvm12IRTranslator20runOnMachineFunctionERNS_15MachineFunctionE +6064
[0xffffab020ae8] _ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE +232
[0xffffaade71bc] _ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE +1180
[0xffffaade86a0] _ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE +64
[0xffffaade8ad8] _ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE +968
[0xffffac6d1118] ???
[0xffffac6d1294] LLVMTargetMachineEmitToFile +324
[0xaaaad8e1a0b4] ???
[0xaaaad8e1a8b8] ???
[0xaaaad8915fa0] ???
[0x0] ???
Invalid memory access (signal 11) at address 0x0
[0xaaaad9170424] ???
[0xaaaad90d1180] __crystal_sigfault_handler +400
[0xaaaad917faa0] sigfault_handler +40
[0xffffaf52d5e4] ???
[0xffffac6e45c8] ???
[0xffffac6e91f4] ???
[0xffffab5a4760] _ZNK4llvm12CallLowering9lowerCallERNS_16MachineIRBuilderENS_17ImmutableCallSiteENS_8ArrayRefINS_8RegisterEEENS4_IS6_EES5_St8functionIFjvEE +2176
[0xffffab5bf140] _ZN4llvm12IRTranslator17translateCallSiteERKNS_17ImmutableCallSiteERNS_16MachineIRBuilderE +848
[0xffffab5bfa94] _ZN4llvm12IRTranslator13translateCallERKNS_4UserERNS_16MachineIRBuilderE +500
[0xffffab5c3eb0] _ZN4llvm12IRTranslator20runOnMachineFunctionERNS_15MachineFunctionE +6064
[0xffffab020ae8] _ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE +232
[0xffffaade71bc] _ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE +1180
[0xffffaade86a0] _ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE +64
[0xffffaade8ad8] _ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE +968
[0xffffac6d1118] ???
[0xffffac6d1294] LLVMTargetMachineEmitToFile +324
[0xaaaad8e1a0b4] ???
[0xaaaad8e1a8b8] ???
[0xaaaad8915fa0] ???
[0x0] ???
Invalid memory access (signal 11) at address 0x2400000
[0xaaaad9170424] ???
[0xaaaad90d1180] __crystal_sigfault_handler +400
[0xaaaad917faa0] sigfault_handler +40
[0xffffaf52d5e4] ???
[0xffffac6e45c8] ???
[0xffffac6e978c] ???
[0xffffab5a4760] _ZNK4llvm12CallLowering9lowerCallERNS_16MachineIRBuilderENS_17ImmutableCallSiteENS_8ArrayRefINS_8RegisterEEENS4_IS6_EES5_St8functionIFjvEE +2176
[0xffffab5bf140] _ZN4llvm12IRTranslator17translateCallSiteERKNS_17ImmutableCallSiteERNS_16MachineIRBuilderE +848
[0xffffab5bfa94] _ZN4llvm12IRTranslator13translateCallERKNS_4UserERNS_16MachineIRBuilderE +500
[0xffffab5c3eb0] _ZN4llvm12IRTranslator20runOnMachineFunctionERNS_15MachineFunctionE +6064
[0xffffab020ae8] _ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE +232
[0xffffaade71bc] _ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE +1180
[0xffffaade86a0] _ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE +64
[0xffffaade8ad8] _ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE +968
[0xffffac6d1118] ???
[0xffffac6d1294] LLVMTargetMachineEmitToFile +324
[0xaaaad8e1a0b4] ???
[0xaaaad8e1a8b8] ???
[0xaaaad8915fa0] ???
[0x0] ???
Invalid memory access (signal 11) at address 0x0
[0xaaaad9170424] ???
[0xaaaad90d1180] __crystal_sigfault_handler +400
[0xaaaad917faa0] sigfault_handler +40
[0xffffaf52d5e4] ???
[0xffffac6e45c8] ???
[0xffffac6e91f4] ???
[0xffffab5a4760] _ZNK4llvm12CallLowering9lowerCallERNS_16MachineIRBuilderENS_17ImmutableCallSiteENS_8ArrayRefINS_8RegisterEEENS4_IS6_EES5_St8functionIFjvEE +2176
[0xffffab5bf140] _ZN4llvm12IRTranslator17translateCallSiteERKNS_17ImmutableCallSiteERNS_16MachineIRBuilderE +848
[0xffffab5bfa94] _ZN4llvm12IRTranslator13translateCallERKNS_4UserERNS_16MachineIRBuilderE +500
[0xffffab5c3eb0] _ZN4llvm12IRTranslator20runOnMachineFunctionERNS_15MachineFunctionE +6064
[0xffffab020ae8] _ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE +232
[0xffffaade71bc] _ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE +1180
[0xffffaade86a0] _ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE +64
[0xffffaade8ad8] _ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE +968
[0xffffac6d1118] ???
[0xffffac6d1294] LLVMTargetMachineEmitToFile +324
[0xaaaad8e1a0b4] ???
[0xaaaad8e1a8b8] ???
[0xaaaad8915fa0] ???
[0x0] ???
Invalid memory access (signal 11) at address 0x0
[0xaaaad9170424] ???
[0xaaaad90d1180] __crystal_sigfault_handler +400
[0xaaaad917faa0] sigfault_handler +40
[0xffffaf52d5e4] ???
[0xffffac6e45c8] ???
[0xffffac6e91f4] ???
[0xffffab5a4760] _ZNK4llvm12CallLowering9lowerCallERNS_16MachineIRBuilderENS_17ImmutableCallSiteENS_8ArrayRefINS_8RegisterEEENS4_IS6_EES5_St8functionIFjvEE +2176
[0xffffab5bf140] _ZN4llvm12IRTranslator17translateCallSiteERKNS_17ImmutableCallSiteERNS_16MachineIRBuilderE +848
Invalid memory access (signal 11) at address 0x0
[0xffffab5bfa94] _ZN4llvm12IRTranslator13translateCallERKNS_4UserERNS_16MachineIRBuilderE +500
[0xaaaad9170424] ???
[0xaaaad90d1180] __crystal_sigfault_handler +400
[0xaaaad917faa0] sigfault_handler +40
[0xffffaf52d5e4] ???
[0xffffab5c3eb0] _ZN4llvm12IRTranslator20runOnMachineFunctionERNS_15MachineFunctionE +6064
[0xffffab020ae8] _ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE +232
[0xffffaade71bc] _ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE +1180
[0xffffaade86a0] _ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE +64
[0xffffaade8ad8] _ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE +968
[0xffffac6d1118] ???
[0xffffac6d1294] LLVMTargetMachineEmitToFile +324
[0xaaaad8e1a0b4] ???
[0xaaaad8e1a8b8] ???
[0xaaaad8915fa0] ???
[0x0] ???
[0xffffac6e45c8] ???
[0xffffac6e91f4] ???
[0xffffab5a4760] _ZNK4llvm12CallLowering9lowerCallERNS_16MachineIRBuilderENS_17ImmutableCallSiteENS_8ArrayRefINS_8RegisterEEENS4_IS6_EES5_St8functionIFjvEE +2176
[0xffffab5bf140] _ZN4llvm12IRTranslator17translateCallSiteERKNS_17ImmutableCallSiteERNS_16MachineIRBuilderE +848
[0xffffab5bfa94] _ZN4llvm12IRTranslator13translateCallERKNS_4UserERNS_16MachineIRBuilderE +500
[0xffffab5c3eb0] _ZN4llvm12IRTranslator20runOnMachineFunctionERNS_15MachineFunctionE +6064
[0xffffab020ae8] _ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE +232
[0xffffaade71bc] _ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE +1180
[0xffffaade86a0] _ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE +64
[0xffffaade8ad8] _ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE +968
[0xffffac6d1118] ???
[0xffffac6d1294] LLVMTargetMachineEmitToFile +324
[0xaaaad8e1a0b4] ???
[0xaaaad8e1a8b8] ???
[0xaaaad8915fa0] ???
[0x0] ???
Invalid memory access (signal 11) at address 0x2000018
[0xaaaad9170424] ???
[0xaaaad90d1180] __crystal_sigfault_handler +400
[0xaaaad917faa0] sigfault_handler +40
[0xffffaf52d5e4] ???
[0xffffab5eea34] _ZNK4llvm13LegalizerInfo9getActionERKNS_12MachineInstrERKNS_19MachineRegisterInfoE +612
[0xffffab5ebfb0] _ZN4llvm15LegalizerHelper17legalizeInstrStepERNS_12MachineInstrE +96
[0xffffab5ce91c] _ZN4llvm9Legalizer23legalizeMachineFunctionERNS_15MachineFunctionERKNS_13LegalizerInfoENS_8ArrayRefIPNS_19GISelChangeObserverEEERNS_16MachineIRBuilderE +2092
[0xffffab5d101c] ???
[0xffffab020ae8] _ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE +232
[0xffffaade71bc] _ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE +1180
[0xffffaade86a0] _ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE +64
[0xffffaade8ad8] _ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE +968
[0xffffac6d1118] ???
[0xffffac6d1294] LLVMTargetMachineEmitToFile +324
[0xaaaad8e1a0b4] ???
[0xaaaad8e1a8b8] ???
[0xaaaad8915fa0] ???
[0x0] ???
gcc: error: _main.o: No such file or directory
gcc: error: S-lice40U-I-nt841.o: No such file or directory
gcc: error: P-ointer40U-I-nt841.o: No such file or directory
gcc: error: A-rgumentE-rror.o: No such file or directory
gcc: error: E-xception5858C-allS-tack.o: No such file or directory
gcc: error: A-rray40P-ointer40V-oid4141.o: No such file or directory
gcc: error: P-ointer40P-ointer40V-oid4141.o: No such file or directory
gcc: error: E-xception.o: No such file or directory
gcc: error: P-ointer40L-ibU-nwind5858E-xception41.o: No such file or directory
gcc: error: U-I-nt64.o: No such file or directory
gcc: error: U-I-nt8.o: No such file or directory
gcc: error: A-rray40S-tring41.o: No such file or directory
gcc: error: P-ointer40S-tring41.o: No such file or directory
gcc: error: I-terator5858S-top.o: No such file or directory
gcc: error: P-ointer40V-oid41.o: No such file or directory
gcc: error: P-roc40I-nt324432N-il41.o: No such file or directory
gcc: error: S-taticA-rray40I-nt8443225641.o: No such file or directory
gcc: error: P-ointer40I-nt841.o: No such file or directory
gcc: error: F-iber5858S-tackP-ool.o: No such file or directory
gcc: error: D-eque40P-ointer40V-oid4141.o: No such file or directory
gcc: error: T-hread5858M-utex.o: No such file or directory
gcc: error: R-untimeE-rror.o: No such file or directory
gcc: error: E-rrno.o: No such file or directory
gcc: error: S-tring.o: No such file or directory
gcc: error: G-C-.o: No such file or directory
gcc: error: E-numerable5858R-eflect40I-nt3241.o: No such file or directory
gcc: error: I-nt32.o: No such file or directory
gcc: error: F-ile5858P-ermissions.o: No such file or directory
gcc: error: A-rray40T-uple40U-I-nt644432I-nt164432I-nt164141.o: No such file or directory
gcc: error: S-tring5858B-uilder.o: No such file or directory
gcc: error: S-lice40T-41.o: No such file or directory
gcc: error: M-ath.o: No such file or directory
gcc: error: I-ndexE-rror.o: No such file or directory
gcc: error: C-har.o: No such file or directory
gcc: error: I-O-5858E-ncoder.o: No such file or directory
gcc: error: C-rystal5858I-conv.o: No such file or directory
gcc: error: S-taticA-rray40U-I-nt84432102441.o: No such file or directory
gcc: error: S-taticA-rray40U-I-nt84432441.o: No such file or directory
gcc: error: S-taticA-rray40U-I-nt8443212941.o: No such file or directory
gcc: error: I-nt64.o: No such file or directory
gcc: error: D-ivisionB-yZ-eroE-rror.o: No such file or directory
gcc: error: I-nvalidB-yteS-equenceE-rror.o: No such file or directory
gcc: error: P-ointer40T-uple40U-I-nt644432I-nt164432I-nt164141.o: No such file or directory
gcc: error: A-rray40F-loat585-7322d6c8fe1296c88edebdcd115c89ad.o: No such file or directory
gcc: error: P-ointer40F-loat5-36d63b0ae213f3427e187530ef6f5ab5.o: No such file or directory
gcc: error: F-loat5858P-rinter5858C-achedP-owers5858P-ower.o: No such file or directory
gcc: error: F-iber.o: No such file or directory
gcc: error: T-hread5858L-inkedL-ist40F-iber41.o: No such file or directory
gcc: error: C-rystal5858S-ystem5858R-andom.o: No such file or directory
gcc: error: C-rystal5858S-cheduler.o: No such file or directory
gcc: error: T-hread.o: No such file or directory
gcc: error: A-tomic40U-I-nt841.o: No such file or directory
gcc: error: A-tomic40T-hread3212432N-il41.o: No such file or directory
gcc: error: F-iber5858C-ontext.o: No such file or directory
gcc: error: T-hread5858L-inkedL-ist40T-hread41.o: No such file or directory
gcc: error: N-il.o: No such file or directory
gcc: error: N-ilA-ssertionE-rror.o: No such file or directory
gcc: error: C-rystal5858S-pinL-ock.o: No such file or directory
gcc: error: D-eque40F-iber41.o: No such file or directory
gcc: error: P-ointer40F-iber41.o: No such file or directory
gcc: error: T-ime5858S-pan.o: No such file or directory
gcc: error: C-rystal5858E-ventL-oop.o: No such file or directory
gcc: error: C-rystal5858E-vent5858B-ase.o: No such file or directory
gcc: error: C-rystal5858E-vent.o: No such file or directory
gcc: error: L-ibC-5858T-imeval.o: No such file or directory
gcc: error: F-loat64.o: No such file or directory
gcc: error: C-rystal5858S-ystem.o: No such file or directory
gcc: error: E-N-V-.o: No such file or directory
gcc: error: C-rystal5858S-ystem5858E-nv.o: No such file or directory
gcc: error: P-rocess.o: No such file or directory
gcc: error: F-ile.o: No such file or directory
gcc: error: C-rystal5858S-ystem5858F-ile.o: No such file or directory
gcc: error: F-ile5858E-rror.o: No such file or directory
gcc: error: C-har5858R-eader.o: No such file or directory
gcc: error: U-I-nt32.o: No such file or directory
gcc: error: F-ile5858N-otF-oundE-rror.o: No such file or directory
gcc: error: F-ile5858A-lreadyE-xistsE-rror.o: No such file or directory
gcc: error: F-ile5858A-ccessD-eniedE-rror.o: No such file or directory
gcc: error: F-ile5858E-rror43.o: No such file or directory
gcc: error: C-rystal5858T-hre-1a3c0c3e3b0f8107f598df47513fbad7.o: No such file or directory
gcc: error: H-ash40T-hread4432D-eque40F-iber4141.o: No such file or directory
gcc: error: P-ointer40H-ash58-ba622b1c6ea9db0b943e2b37ba0c5af2.o: No such file or directory
gcc: error: C-rystal5858T-hre-328ba26086c06ca27f79c0f6529d7399.o: No such file or directory
gcc: error: H-ash40T-hread4432C-rystal5858E-vent41.o: No such file or directory
gcc: error: P-ointer40H-ash58-e27196573eea5e5746b383aacfde8695.o: No such file or directory
gcc: error: A-tomic40T-41.o: No such file or directory
gcc: error: A-tomic40I-nt3241.o: No such file or directory
gcc: error: C-rystal5858S-ystem5858F-ileD-escriptor.o: No such file or directory
gcc: error: I-O-5858E-rror.o: No such file or directory
gcc: error: H-ash5858E-ntry40T-hread4432D-eque40F-iber4141.o: No such file or directory
gcc: error: C-rystal5858H-asher.o: No such file or directory
gcc: error: S-taticA-rray40U-I-nt644432241.o: No such file or directory
gcc: error: P-ointer40U-I-nt6441.o: No such file or directory
gcc: error: P-ointer40U-I-nt1641.o: No such file or directory
gcc: error: P-ointer40U-I-nt3241.o: No such file or directory
gcc: error: C-rystal5858E-L-F-.o: No such file or directory
gcc: error: I-O-5858F-ileD-escriptor43.o: No such file or directory
gcc: error: C-rystal5858E-L-F-5858E-rror.o: No such file or directory
gcc: error: C-rystal5858E-L-F-5858E-ndianness.o: No such file or directory
gcc: error: C-rystal5858E-L-F-5858O-S-A-B-I-.o: No such file or directory
gcc: error: S-taticA-rray40U-I-nt84432409641.o: No such file or directory
gcc: error: I-O-5858E-O-F-E-rror.o: No such file or directory
gcc: error: C-rystal5858E-L-F-5858I-dent.o: No such file or directory
gcc: error: U-I-nt16.o: No such file or directory
gcc: error: I-O-5858B-yteF-ormat5858B-igE-ndian.o: No such file or directory
gcc: error: S-taticA-rray40U-I-nt84432241.o: No such file or directory
gcc: error: I-O-5858B-yteF-ormat5858L-ittleE-ndian.o: No such file or directory
gcc: error: C-rystal5858E-L-F-5858K-lass.o: No such file or directory
gcc: error: S-taticA-rray40U-I-nt84432841.o: No such file or directory
gcc: error: A-rray40C-rystal5858E-L-F-5858S-ectionH-eader41.o: No such file or directory
gcc: error: P-ointer40C-rystal5858E-L-F-5858S-ectionH-eader41.o: No such file or directory
gcc: error: I-O-5858S-eek.o: No such file or directory
gcc: error: C-rystal5858E-L-F-5858S-ectionH-eader.o: No such file or directory
gcc: error: I-O-5858D-ecoder.o: No such file or directory
gcc: error: C-rystal5858D-W-A-R-F-5858L-ineN-umbers.o: No such file or directory
gcc: error: A-rray40A-rray40C-636f430173768b1ef8a4f1bb1b26b618.o: No such file or directory
gcc: error: P-ointer40A-rray4-591a888aad3429ab878e7889f98d6cb6.o: No such file or directory
gcc: error: C-rystal5858D-W-A-876b67c856caed70209876736196f578.o: No such file or directory
gcc: error: A-rray40T-uple40S-5992430a1a7ef1627717adfb71332538.o: No such file or directory
gcc: error: P-ointer40T-uple4-13415771527eed75ea796bf4f3711255.o: No such file or directory
gcc: error: A-rray40U-I-nt841.o: No such file or directory
gcc: error: I-nt8.o: No such file or directory
gcc: error: S-taticA-rray40U-I-nt84432141.o: No such file or directory
gcc: error: C-rystal5858D-W-A-R-F-.o: No such file or directory
gcc: error: C-rystal5858D-W-A-937402c393dd6d3042bf0fc736d67b34.o: No such file or directory
gcc: error: C-rystal5858D-W-A-R-F-5858L-ineN-umbers5858R-ow.o: No such file or directory
gcc: error: A-rray40C-rystal5-a16bd51dfcaca30f4af2725dbdd7bd16.o: No such file or directory
gcc: error: P-ointer40C-rysta-75a3b5062ef2a02254d15f4644e701c0.o: No such file or directory
gcc: error: C-rystal5858D-W-A-R-F-5858L-N-E-.o: No such file or directory
gcc: error: C-rystal5858D-W-A-R-F-5858L-N-S-.o: No such file or directory
gcc: error: C-rystal5858D-W-A-R-F-5858S-trings.o: No such file or directory
gcc: error: A-rray40T-uple40U-997f9e533f193da5e605a2014e7947d9.o: No such file or directory
gcc: error: P-ointer40T-uple4-aa2454898accd295538d997a0365d41d.o: No such file or directory
gcc: error: C-rystal5858D-W-A-R-F-5858I-nfo.o: No such file or directory
gcc: error: C-rystal5858D-W-A-R-F-5858A-bbrev.o: No such file or directory
gcc: error: A-rray40C-rystal5858D-W-A-R-F-5858A-bbrev41.o: No such file or directory
gcc: error: P-ointer40C-rystal5858D-W-A-R-F-5858A-bbrev41.o: No such file or directory
gcc: error: A-rray40C-rystal5-85d16306ed99e9d40f38f1fabbf60a71.o: No such file or directory
gcc: error: P-ointer40C-rysta-412258c0a74d56232e18d2b8d2d1d319.o: No such file or directory
gcc: error: C-rystal5858D-W-A-R-F-5858A-bbrev5858A-ttribute.o: No such file or directory
gcc: error: A-rray40T-uple40C-27a23361f858e0007f08b6743d9d6989.o: No such file or directory
gcc: error: P-ointer40T-uple4-43d652c2a9bf3a222802e6afe6647968.o: No such file or directory
gcc: error: C-rystal5858D-W-A-R-F-5858F-O-R-M-.o: No such file or directory
gcc: error: U-nicode5858C-aseO-ptions.o: No such file or directory
gcc: error: U-nicode.o: No such file or directory
gcc: error: A-rray40T-uple40I-nt324432I-nt324432I-nt324141.o: No such file or directory
gcc: error: P-ointer40T-uple40I-nt324432I-nt324432I-nt324141.o: No such file or directory
gcc: error: H-ash40I-nt324432-c36c7b59ada9577e04b34b7156d26117.o: No such file or directory
gcc: error: P-ointer40H-ash58-df002967aa38240c2ffc8370480b96df.o: No such file or directory
gcc: error: H-ash5858E-ntry40-ea883736b6a497e8c0f2d29083b2162a.o: No such file or directory
gcc: error: A-rray40T-uple40I-nt324432I-nt324141.o: No such file or directory
gcc: error: P-ointer40T-uple40I-nt324432I-nt324141.o: No such file or directory
gcc: error: C-rystal5858D-W-A-R-F-5858T-A-G-.o: No such file or directory
gcc: error: C-rystal5858D-W-A-R-F-5858A-T-.o: No such file or directory
gcc: error: B-ool.o: No such file or directory
gcc: error: T-ypeC-astE-rror.o: No such file or directory
gcc: error: S-tring5858T-oU-64I-nfo.o: No such file or directory
gcc: error: P-ath.o: No such file or directory
gcc: error: P-ath5858K-ind.o: No such file or directory
gcc: error: D-ir.o: No such file or directory
gcc: error: C-rystal5858S-ystem5858D-ir.o: No such file or directory
gcc: error: T-uple40C-har41.o: No such file or directory
gcc: error: T-uple40C-har4432C-har41.o: No such file or directory
gcc: error: T-uple40S-tring4432S-tring41.o: No such file or directory
gcc: error: P-ath5858P-artI-terator.o: No such file or directory
gcc: error: I-terator40T-41.o: No such file or directory
gcc: error: C-rystal5858A-tE-xitH-andlers.o: No such file or directory
gcc: error: A-rray40P-roc40I--412183da1a81233e2c20c488cb2e890d.o: No such file or directory
gcc: error: P-ointer40P-roc40-6252237c86bac28658266374d639ebc8.o: No such file or directory
gcc: error: I-O-5858F-ileD-escriptor.o: No such file or directory
gcc: error: S-taticA-rray40U-I-nt8443225641.o: No such file or directory
gcc: error: C-rystal5858S-ystem5858F-ileI-nfo.o: No such file or directory
gcc: error: F-ile5858T-ype.o: No such file or directory
gcc: error: C-rystal5858S-ystem5858P-rocess.o: No such file or directory
gcc: error: C-rystal5858S-ystem5858F-iber.o: No such file or directory
gcc: error: E-xception43.o: No such file or directory
gcc: error: X-M-L-5858E-rror.o: No such file or directory
gcc: error: T-ourmaline5858E-rror5858N-etworkE-rror.o: No such file or directory
gcc: error: T-ourmaline5858E-rror5858C-antT-alkW-ithB-ots.o: No such file or directory
gcc: error: T-ourmaline5858E--9e71e80795870dde4d93e100b5044137.o: No such file or directory
gcc: error: T-ourmaline5858E-rror5858U-serD-eactivated.o: No such file or directory
gcc: error: T-ourmaline5858E-rror5858B-otB-locked.o: No such file or directory
gcc: error: T-ourmaline5858E-rror5858B-otK-icked.o: No such file or directory
gcc: error: T-ourmaline5858E-rror5858U-nauthorized.o: No such file or directory
gcc: error: T-ourmaline5858E-rror5858C-antG-etU-pdates.o: No such file or directory
gcc: error: T-ourmaline5858E-rror.o: No such file or directory
gcc: error: J-S-O-N-5858M-appingE-rror.o: No such file or directory
gcc: error: J-S-O-N-5858P-arseE-xception.o: No such file or directory
gcc: error: J-S-O-N-5858E-rror.o: No such file or directory
gcc: error: H-T-T-P-5858S-erver5858C-lientE-rror.o: No such file or directory
gcc: error: H-T-T-P-5858F-ormD-ata5858E-rror.o: No such file or directory
gcc: error: M-I-M-E-5858M-ultipart5858E-rror.o: No such file or directory
gcc: error: C-ompress5858G-zip5858E-rror.o: No such file or directory
gcc: error: C-ompress5858D-eflate5858E-rror.o: No such file or directory
gcc: error: M-I-M-E-5858E-rror.o: No such file or directory
gcc: error: D-igest5858F-inalizedE-rror.o: No such file or directory
gcc: error: O-penS-S-L-5858C-ipher5858E-rror.o: No such file or directory
gcc: error: O-penS-S-L-5858D-igest5858U-nsupportedE-rror.o: No such file or directory
gcc: error: O-penS-S-L-5858D-igest5858E-rror.o: No such file or directory
gcc: error: O-penS-S-L-5858S-S-L-5858E-rror.o: No such file or directory
gcc: error: O-penS-S-L-5858E-rror.o: No such file or directory
gcc: error: T-ime5858L-ocation.o: No such file or directory
gcc: error: A-rray40T-ime5858L-ocation5858Z-oneT-ransition41.o: No such file or directory
gcc: error: P-ointer40T-ime5858L-ocation5858Z-oneT-ransition41.o: No such file or directory
gcc: error: H-ash40S-tring443-d0ef6a484ca24b5e9e1cd150630d96a3.o: No such file or directory
gcc: error: P-ointer40H-ash58-78e716075e5ec360a5549c235b8e9c11.o: No such file or directory
gcc: error: H-ash40S-tring4432I-nt3241.o: No such file or directory
gcc: error: P-ointer40H-ash5858E-ntry40S-tring4432I-nt324141.o: No such file or directory
gcc: error: H-ash5858E-ntry40S-tring4432I-nt3241.o: No such file or directory
gcc: error: O-penS-S-L-5858B-I-O-.o: No such file or directory
gcc: error: B-ox40I-O-41.o: No such file or directory
gcc: error: H-T-T-P-5858W-ebS-4cb2ca367ffc5472ff9cc10ba3782e30.o: No such file or directory
gcc: error: H-T-T-P-5858W-ebS-ocket5858P-rotocol.o: No such file or directory
gcc: error: H-T-T-P-5858S-erver5858R-esponse5858O-utput.o: No such file or directory
gcc: error: H-T-T-P-5858H-eaders.o: No such file or directory
gcc: error: H-T-T-P-5858H-eaders5858K-ey.o: No such file or directory
gcc: error: H-ash40H-T-T-P-58-326889f6e4af597efb1be91689fda4df.o: No such file or directory
gcc: error: P-ointer40H-ash58-03ea88bd25fc901bb271095486fce1b5.o: No such file or directory
gcc: error: H-ash5858E-ntry40-eb9419e0928ab6795e39cae0bfd2e2ca.o: No such file or directory
gcc: error: H-T-T-P-5858S-erver5858R-esponse.o: No such file or directory
gcc: error: H-T-T-P-5858C-ookies.o: No such file or directory
gcc: error: H-ash40S-tring4432H-T-T-P-5858C-ookie41.o: No such file or directory
gcc: error: P-ointer40H-ash58-022bb543ee1a8b891781f4b4b6f3c0ee.o: No such file or directory
gcc: error: A-rray40H-T-T-P-5858C-ookie41.o: No such file or directory
gcc: error: P-ointer40H-T-T-P-5858C-ookie41.o: No such file or directory
gcc: error: H-ash5858E-ntry40S-tring4432H-T-T-P-5858C-ookie41.o: No such file or directory
gcc: error: H-T-T-P-5858C-ookie.o: No such file or directory
gcc: error: U-R-I-.o: No such file or directory
gcc: error: T-uple40C-har4432C-har4432C-har4432C-har41.o: No such file or directory
gcc: error: H-T-T-P-.o: No such file or directory
gcc: error: T-ime5858F-ormat5858H-T-T-P-_D-A-T-E-.o: No such file or directory
gcc: error: T-ime5858L-ocation5858Z-oneT-ransition.o: No such file or directory
gcc: error: T-ime5858F-ormat5858F-ormatter.o: No such file or directory
gcc: error: I-O-43.o: No such file or directory
gcc: error: H-T-T-P-5858C-hunkedC-ontent.o: No such file or directory
gcc: error: H-T-T-P-5858U-nknownL-engthC-ontent.o: No such file or directory
gcc: error: C-ompress5858G-zip5858H-eader.o: No such file or directory
gcc: error: C-ompress5858G-zip5858R-eader.o: No such file or directory
gcc: error: C-ompress5858D-eflate5858R-eader.o: No such file or directory
gcc: error: O-penS-S-L-5858S-S-L-5858S-ocket43.o: No such file or directory
gcc: error: L-ibS-S-L-5858S-S-L-E-rror.o: No such file or directory
gcc: error: S-taticA-rray40U-I-nt84432819241.o: No such file or directory
gcc: error: O-penS-S-L-5858D-igestI-O-.o: No such file or directory
gcc: error: O-penS-S-L-5858D-igestI-O-5858D-igestM-ode.o: No such file or directory
gcc: error: O-penS-S-L-5858D-igest.o: No such file or directory
gcc: error: S-ocket43.o: No such file or directory
gcc: error: F-ile5858P-R-eader.o: No such file or directory
gcc: error: I-O-5858S-tapled.o: No such file or directory
gcc: error: H-T-T-P-5858F-ixedL-engthC-ontent.o: No such file or directory
gcc: error: I-O-5858S-ized43.o: No such file or directory
gcc: error: I-O-5858M-ultiW-riter.o: No such file or directory
gcc: error: A-rray40I-O-41.o: No such file or directory
gcc: error: P-ointer40I-O-41.o: No such file or directory
gcc: error: I-O-5858M-emory.o: No such file or directory
gcc: error: I-O-5858H-exdump.o: No such file or directory
gcc: error: I-O-5858D-elimited.o: No such file or directory
gcc: error: I-O-5858A-R-G-F-.o: No such file or directory
gcc: error: C-ompress5858G-zip5858H-eader5858F-lg.o: No such file or directory
gcc: error: D-igest5858C-R-C-32.o: No such file or directory
gcc: error: T-uple40I-nt32443-ae04c9525469ed0d0491c8672a000146.o: No such file or directory
gcc: error: H-T-T-P-5858C-ookie5858S-ameS-ite.o: No such file or directory
gcc: error: H-T-T-P-5858S-tatus.o: No such file or directory
gcc: error: T-uple40U-I-nt644432U-I-nt6441.o: No such file or directory
gcc: error: U-N-I-X-S-erver.o: No such file or directory
gcc: error: S-ocket5858E-rror43.o: No such file or directory
gcc: error: S-taticA-rray40U-I-nt844321041.o: No such file or directory
gcc: error: C-rystal5858S-ystem5858T-ime.o: No such file or directory
gcc: error: T-uple40U-I-nt84432I-nt324432I-nt3241.o: No such file or directory
gcc: error: T-uple40N-il4432U-I-nt841.o: No such file or directory
gcc: error: T-uple40E-rrno4432E-rrno41.o: No such file or directory
gcc: error: H-ash5858E-ntry40-6cdc1dbc4d0144c7acda0795671bf054.o: No such file or directory
gcc: error: I-nt16.o: No such file or directory
gcc: error: H-ash40S-tring4432S-tring41.o: No such file or directory
gcc: error: P-ointer40H-ash5858E-ntry40S-tring4432S-tring4141.o: No such file or directory
gcc: error: H-ash40S-tring4432S-et40S-tring4141.o: No such file or directory
gcc: error: P-ointer40H-ash58-f5be98ebb297cfcdb64b536a254d9069.o: No such file or directory
gcc: error: L-og5858M-etadata.o: No such file or directory
gcc: error: N-amedT-uple40T-41.o: No such file or directory
gcc: error: T-uple40I-nt324432I-nt3241.o: No such file or directory
gcc: error: T-uple40T-41.o: No such file or directory
gcc: error: T-uple40I-nt3241.o: No such file or directory
gcc: error: L-og5858B-uilder.o: No such file or directory
gcc: error: H-ash40S-tring4432W-eakR-ef40L-og4141.o: No such file or directory
gcc: error: P-ointer40H-ash58-362f7eee022f72865c226a8536023007.o: No such file or directory
gcc: error: A-rray40L-og5858B-uilder5858B-inding41.o: No such file or directory
gcc: error: P-ointer40L-og5858B-uilder5858B-inding41.o: No such file or directory
gcc: error: L-og.o: No such file or directory
gcc: error: L-og5858I-O-B-ackend.o: No such file or directory
gcc: error: H-ash5858E-ntry40S-tring4432W-eakR-ef40L-og4141.o: No such file or directory
gcc: error: W-eakR-ef40L-og41.o: No such file or directory
gcc: error: L-og5858B-uilder5858B-inding.o: No such file or directory
gcc: error: L-og5858B-roadcastB-ackend.o: No such file or directory
gcc: error: H-ash40L-og5858B-ackend4432L-og5858S-everity41.o: No such file or directory
gcc: error: P-ointer40H-ash58-5720daa83c64097152e5f552cc4405a6.o: No such file or directory
gcc: error: L-og5858B-ackend43.o: No such file or directory
gcc: error: H-ash5858E-ntry40-5debd9ef659443b8bbb6c621ab2b75c4.o: No such file or directory
gcc: error: H-ash5858V-alueI--bcd915030ae6d36c205b65c4941b5524.o: No such file or directory
gcc: error: L-og5858S-everity.o: No such file or directory
gcc: error: H-ash40S-tring4432T-uple40S-tring4432S-tring4141.o: No such file or directory
gcc: error: P-ointer40H-ash58-b6e5934f78b58997e74f8a8e6773608f.o: No such file or directory
gcc: error: H-ash5858E-ntry40-f3377161bf5265d9fc578041fc7425d1.o: No such file or directory
gcc: error: A-rray40X-M-L-5858E-rror41.o: No such file or directory
gcc: error: P-ointer40X-M-L-5858E-rror41.o: No such file or directory
gcc: error: W-eakR-ef40T-41.o: No such file or directory
gcc: error: S-lavebot5858B-ot.o: No such file or directory
gcc: error: T-ourmaline5858N-ilP-ersistence.o: No such file or directory
gcc: error: H-T-T-P-5858P-roxy5858C-lient.o: No such file or directory
gcc: error: U-R-I-5858P-arser.o: No such file or directory
gcc: error: H-ash40I-nt324432-75cf0889665a4e7008b9d865daf34063.o: No such file or directory
gcc: error: P-ointer40H-ash58-82aeac833e95b8d7e4bebe696c9eebf5.o: No such file or directory
gcc: error: H-ash5858E-ntry40-2cbbc8b2d8a06e2b1695995f1b4f7cb2.o: No such file or directory
gcc: error: H-T-T-P-5858C-lient.o: No such file or directory
gcc: error: T-uple40C-har4432-da0bae55c641cf3666f281b8fea01988.o: No such file or directory
gcc: error: O-penS-S-L-5858S-S-L-5858C-ontext5858C-lient.o: No such file or directory
gcc: error: O-penS-S-L-5858S-S-L-5858C-ontext.o: No such file or directory
gcc: error: L-ibS-S-L-5858O-ptions.o: No such file or directory
gcc: error: L-ibS-S-L-5858M-odes.o: No such file or directory
gcc: error: T-C-P-S-ocket.o: No such file or directory
gcc: error: U-R-I-5858P-unycode.o: No such file or directory
gcc: error: A-rray40C-har41.o: No such file or directory
gcc: error: P-ointer40C-har41.o: No such file or directory
gcc: error: S-lice40C-har41.o: No such file or directory
gcc: error: L-ibC-5858A-ddrinfo.o: No such file or directory
gcc: error: S-ocket5858F-amily.o: No such file or directory
gcc: error: S-ocket5858T-ype.o: No such file or directory
gcc: error: S-ocket5858P-rotocol.o: No such file or directory
gcc: error: S-ocket5858A-ddrinfo.o: No such file or directory
gcc: error: T-ourmaline5858C-ommandH-andler.o: No such file or directory
gcc: error: T-ourmaline5858M-essage.o: No such file or directory
gcc: error: T-ourmaline5858C-ontainer.o: No such file or directory
gcc: error: T-ourmaline5858C-lient43.o: No such file or directory
gcc: error: T-ourmaline5858P-arseM-ode.o: No such file or directory
gcc: error: N-amedT-uple40cha-780c186252ff03004280c2a0e2a56120.o: No such file or directory
gcc: error: L-og5858E-mitter.o: No such file or directory
gcc: error: J-S-O-N-5858B-uilder.o: No such file or directory
gcc: error: A-rray40J-S-O-N-5-c2d4f74c646ffbf3dd93f427b57d313d.o: No such file or directory
gcc: error: P-ointer40J-S-O-N-83d21aa30ccddf0b224a036af4e15add.o: No such file or directory
gcc: error: J-S-O-N-5858B-uilder5858S-tartS-tate.o: No such file or directory
gcc: error: J-S-O-N-5858B-uilder5858D-ocumentS-tartS-tate.o: No such file or directory
gcc: error: J-S-O-N-5858B-uilder5858O-bjectS-tate.o: No such file or directory
gcc: error: J-S-O-N-5858B-uilder5858D-ocumentE-ndS-tate.o: No such file or directory
gcc: error: J-S-O-N-5858B-uilder5858A-rrayS-tate.o: No such file or directory
gcc: error: N-amedT-uple4041.o: No such file or directory
gcc: error: L-og5858E-ntry.o: No such file or directory
gcc: error: L-og5858C-ontext.o: No such file or directory
gcc: error: L-og5858P-rocF-ormatter.o: No such file or directory
gcc: error: L-og5858S-taticF-ormatter43.o: No such file or directory
gcc: error: L-og5858S-hortF-ormat.o: No such file or directory
gcc: error: T-ime5858F-ormat5858R-F-C-_3339.o: No such file or directory
gcc: error: P-ointer40N-amedT-48a2c403e75e9a1bf3f02025c2951997.o: No such file or directory
gcc: error: L-og5858M-etadata5858V-alue.o: No such file or directory
gcc: error: A-rray40L-og5858M-etadata5858V-alue41.o: No such file or directory
gcc: error: P-ointer40L-og5858M-etadata5858V-alue41.o: No such file or directory
gcc: error: F-loat32.o: No such file or directory
gcc: error: F-loat5858P-rinter.o: No such file or directory
gcc: error: F-loat5858P-rinter5858I-E-E-E-.o: No such file or directory
gcc: error: S-taticA-rray40U-I-nt8443212841.o: No such file or directory
gcc: error: F-loat5858P-rinter5858G-risu3.o: No such file or directory
gcc: error: F-loat5858P-rinter5858D-iyF-P-.o: No such file or directory
gcc: error: F-loat5858P-rinter5858C-achedP-owers.o: No such file or directory
gcc: error: T-uple40I-nt32443-afadb9c45253e8355fa608b917562caf.o: No such file or directory
gcc: error: H-ash40S-tring4432L-og5858M-etadata5858V-alue41.o: No such file or directory
gcc: error: P-ointer40H-ash58-eee092988250ebc7f4d4453c571eea5e.o: No such file or directory
gcc: error: H-ash5858E-ntry40-899e563b3bd29522ae3a4ddbbd237b43.o: No such file or directory
gcc: error: T-ime5858F-ormat.o: No such file or directory
gcc: error: T-ime5858D-ayO-fW-eek.o: No such file or directory
gcc: error: T-ourmaline5858E-rror5858U-nauthorized43.o: No such file or directory
gcc: error: T-ourmaline5858E-rror5858C-onflictE-rror43.o: No such file or directory
gcc: error: T-ourmaline5858E-rror5858N-otF-ound43.o: No such file or directory
gcc: error: T-ourmaline5858E-rror5858B-adW-ebhook43.o: No such file or directory
gcc: error: T-ourmaline5858E-rror5858P-ollE-rror43.o: No such file or directory
gcc: error: T-ourmaline5858E-rror5858M-essageE-rror43.o: No such file or directory
gcc: error: T-ourmaline5858E-rror5858B-adR-equest43.o: No such file or directory
gcc: error: T-ourmaline5858E-rror43.o: No such file or directory
gcc: error: J-S-O-N-5858P-arseE-xception43.o: No such file or directory
gcc: error: J-S-O-N-5858E-rror43.o: No such file or directory
gcc: error: O-penS-S-L-5858D-igest5858E-rror43.o: No such file or directory
gcc: error: O-penS-S-L-5858E-rror43.o: No such file or directory
gcc: error: T-ourmaline5858L-ogger5858F-ormatter.o: No such file or directory
gcc: error: S-tring5858F-ormatter40T-uple40S-tring4141.o: No such file or directory
gcc: error: T-uple40S-tring41.o: No such file or directory
gcc: error: S-tring5858F-ormatter5858F-lags.o: No such file or directory
gcc: error: C-olorize5858O-bject40T-41.o: No such file or directory
gcc: error: C-olorize5858O-bject40S-tring41.o: No such file or directory
gcc: error: C-olorize.o: No such file or directory
gcc: error: C-olorize5858O-bj-2317b727765d1b8f124ded8d8f727af1.o: No such file or directory
gcc: error: C-olorize5858C-olor256.o: No such file or directory
gcc: error: C-olorize5858C-olorA-N-S-I-.o: No such file or directory
gcc: error: C-olorize5858C-olorR-G-B-.o: No such file or directory
gcc: error: N-amedT-uple40for-b44cc120e9ca6237e372b7d1e1b03dfc.o: No such file or directory
gcc: error: L-og5858M-emoryB-ackend.o: No such file or directory
gcc: error: H-T-T-P-5858C-lient5858R-esponse.o: No such file or directory
gcc: error: H-T-T-P-5858E-ndO-fR-equest.o: No such file or directory
gcc: error: H-T-T-P-5858H-eaderL-ine.o: No such file or directory
gcc: error: H-T-T-P-5858B-odyT-ype.o: No such file or directory
gcc: error: M-I-M-E-5858M-ediaT-ype.o: No such file or directory
gcc: error: T-uple40C-har4432-5076d935c82cc22ad85a508790e91913.o: No such file or directory
gcc: error: H-ash40S-tring4432H-ash40S-tring4432S-tring4141.o: No such file or directory
gcc: error: P-ointer40H-ash58-29b4b6166c512529c3bd76e80f5c61e2.o: No such file or directory
gcc: error: H-ash5858E-ntry40-62007bf8fb439a44a7dae3146056081e.o: No such file or directory
gcc: error: I-O-5858E-ncodingO-ptions.o: No such file or directory
gcc: error: S-tring5858C-harI-terator.o: No such file or directory
gcc: error: H-ash40S-ymbol443-2b5d314e45dc5f2451d53cf3bf979d38.o: No such file or directory
gcc: error: P-ointer40H-ash58-faee483ef2ce7f09fc8592c4dc4191ab.o: No such file or directory
gcc: error: H-ash5858E-ntry40-a1a7e9c9e2b19916a80cf533e4d1c9b6.o: No such file or directory
gcc: error: H-ash40S-ymbol443-c41455033e02f524cc9f5c9cb36db890.o: No such file or directory
gcc: error: P-ointer40H-ash58-7566ac1d776ef51481be1a43c89eda06.o: No such file or directory
gcc: error: H-ash5858E-ntry40-2c866207f600bb7cb78852e8cab8f4a2.o: No such file or directory
gcc: error: R-ange40I-nt324432N-il41.o: No such file or directory
gcc: error: J-S-O-N-.o: No such file or directory
gcc: error: J-S-O-N-5858P-arser.o: No such file or directory
gcc: error: J-S-O-N-5858L-exer.o: No such file or directory
gcc: error: J-S-O-N-5858L-exer5858S-tringB-ased.o: No such file or directory
gcc: error: J-S-O-N-5858T-oken.o: No such file or directory
gcc: error: S-tringP-ool.o: No such file or directory
gcc: error: J-S-O-N-5858L-exer43.o: No such file or directory
gcc: error: J-S-O-N-5858L-exer5858I-O-B-ased.o: No such file or directory
gcc: error: J-S-O-N-5858T-oken5858K-ind.o: No such file or directory
gcc: error: J-S-O-N-5858A-ny.o: No such file or directory
gcc: error: A-rray40J-S-O-N-5858A-ny41.o: No such file or directory
gcc: error: P-ointer40J-S-O-N-5858A-ny41.o: No such file or directory
gcc: error: H-ash40S-tring4432J-S-O-N-5858A-ny41.o: No such file or directory
gcc: error: P-ointer40H-ash58-dae9c5ff39ccb033f7178f45732412c3.o: No such file or directory
gcc: error: H-ash5858E-ntry40S-tring4432J-S-O-N-5858A-ny41.o: No such file or directory
gcc: error: J-S-O-N-5858P-ullP-arser.o: No such file or directory
gcc: error: A-rray40J-S-O-N-5-2af91d4d9e0b0bd8e0d3d7f3b6188e2e.o: No such file or directory
gcc: error: P-ointer40J-S-O-N-b34df55bcdd3029f2564c0b008341953.o: No such file or directory
gcc: error: A-rray40T-ourmaline5858M-essageE-ntity41.o: No such file or directory
gcc: error: P-ointer40T-ourmaline5858M-essageE-ntity41.o: No such file or directory
gcc: error: A-rray40T-ourmaline5858P-hotoS-ize41.o: No such file or directory
gcc: error: P-ointer40T-ourmaline5858P-hotoS-ize41.o: No such file or directory
gcc: error: A-rray40T-ourmaline5858U-ser41.o: No such file or directory
gcc: error: P-ointer40T-ourmaline5858U-ser41.o: No such file or directory
gcc: error: J-S-O-N-5858P-ullP-arser5858K-ind.o: No such file or directory
gcc: error: J-S-O-N-5858P-ullP-arser5858O-bjectS-tackK-ind.o: No such file or directory
gcc: error: 40T-ourmaline5858U-ser3212432N-il41.o: No such file or directory
gcc: error: T-ourmaline5858U-ser.o: No such file or directory
gcc: error: 40S-tring3212432N-il41.o: No such file or directory
gcc: error: 40B-ool3212432N-il41.o: No such file or directory
gcc: error: T-ime5858E-pochC-onverter.o: No such file or directory
gcc: error: T-ourmaline5858C-hat.o: No such file or directory
gcc: error: T-ourmaline5858C-hat5858T-ype.o: No such file or directory
gcc: error: 40T-ourmaline5858C-hatP-hoto3212432N-il41.o: No such file or directory
gcc: error: T-ourmaline5858C-hatP-hoto.o: No such file or directory
gcc: error: 40T-ourmaline5858M-essage3212432N-il41.o: No such file or directory
gcc: error: 40T-ourmaline5858C-hatP-ermissions3212432N-il41.o: No such file or directory
gcc: error: T-ourmaline5858C-hatP-ermissions.o: No such file or directory
gcc: error: 40I-nt323212432N-il41.o: No such file or directory
gcc: error: 40T-ourmaline5858C-hat3212432N-il41.o: No such file or directory
gcc: error: 40I-nt643212432N-il41.o: No such file or directory
gcc: error: T-ourmaline5858M-essageE-ntity.o: No such file or directory
gcc: error: 40T-ourmaline5858A-udio3212432N-il41.o: No such file or directory
gcc: error: T-ourmaline5858A-udio.o: No such file or directory
gcc: error: 40T-ourmaline5858P-hotoS-ize3212432N-il41.o: No such file or directory
gcc: error: T-ourmaline5858P-hotoS-ize.o: No such file or directory
gcc: error: 40T-ourmaline5858D-ocument3212432N-il41.o: No such file or directory
gcc: error: T-ourmaline5858D-ocument.o: No such file or directory
gcc: error: 40T-ourmaline5858G-ame3212432N-il41.o: No such file or directory
gcc: error: T-ourmaline5858G-ame.o: No such file or directory
gcc: error: 40A-rray40T-ourma-ec5bf8a422dbcbd4678109133271eca1.o: No such file or directory
gcc: error: 40T-ourmaline5858A-nimation3212432N-il41.o: No such file or directory
gcc: error: T-ourmaline5858A-nimation.o: No such file or directory
gcc: error: 40T-ourmaline5858S-ticker3212432N-il41.o: No such file or directory
gcc: error: T-ourmaline5858S-ticker.o: No such file or directory
gcc: error: 40T-ourmaline5858M-askP-osition3212432N-il41.o: No such file or directory
gcc: error: T-ourmaline5858M-askP-osition.o: No such file or directory
gcc: error: 40T-ourmaline5858V-ideo3212432N-il41.o: No such file or directory
gcc: error: T-ourmaline5858V-ideo.o: No such file or directory
gcc: error: 40T-ourmaline5858V-oice3212432N-il41.o: No such file or directory
gcc: error: T-ourmaline5858V-oice.o: No such file or directory
gcc: error: 40T-ourmaline5858V-ideoN-ote3212432N-il41.o: No such file or directory
gcc: error: T-ourmaline5858V-ideoN-ote.o: No such file or directory
gcc: error: 40T-ourmaline5858C-ontact3212432N-il41.o: No such file or directory
gcc: error: T-ourmaline5858C-ontact.o: No such file or directory
gcc: error: 40T-ourmaline5858L-ocation3212432N-il41.o: No such file or directory
gcc: error: T-ourmaline5858L-ocation.o: No such file or directory
Error: execution of command failed with code: 1: `/usr/bin/gcc "${@}" -o /home/g/.cache/crystal/crystal-run-slavebot.tmp  -rdynamic -lxml2  -lz `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'` -lpcre -lm -lgc -lpthread /home/g/Public/software/crystal/src/ext/libcrystal.a -levent  -lrt -ldl`

I don't know if it's a compiler bug or a tourmaline bug, but why would the compiler look for files under that name?

Bug, switch_to_current_chat_button is not generated correctly

Hi Chris,
in sample:

MY_MENU = Tourmaline::RoutedMenu.build do
  route "/" do
    content "Welcome"
    buttons(columns: 1) do
      switch_to_current_chat_button("txt", "test")
    end
  end
end
  
@[Command("help")]
def start_command(ctx)
  ctx.message.respond_with_menu(MY_MENU)
end

Tourmaline prodroguce that:

web          |  ▸ sending ►► sendMessage({
web          |   "chat_id": 302869059,
web          |   "text": "Welcome",
web          |   "parse_mode": null,
web          |   "entities": [],
web          |   "disable_web_page_preview": true,
web          |   "disable_notification": false,
web          |   "reply_to_message_id": null,
web          |   "allow_sending_without_reply": false,
web          |   "reply_markup": "{\"inline_keyboard\":[[{\"text\":\"txt\"}]]}"
web          | })

and receive error from tg:

web          |  ▸ receiving ◄◄ {
web          |   "ok": false,
web          |   "error_code": 400,
web          |   "description": "Bad Request: can't parse inline keyboard button: Text buttons are unallowed in the inline keyboard"
web          | }

same time if i change switch_to_current_chat_button to switch_to_chat_button with same params Tourmaline prodroguce good keyboard

web          |  ▸ Handled by Bot::Webhooks::Create
web          |  ▸ Sent 200 OK (3.44ms)
web          |  ▸ sending ►► sendMessage({
web          |   "chat_id": 302869059,
web          |   "text": "Welcome",
web          |   "parse_mode": null,
web          |   "entities": [],
web          |   "disable_web_page_preview": true,
web          |   "disable_notification": false,
web          |   "reply_to_message_id": null,
web          |   "allow_sending_without_reply": false,
web          |   "reply_markup": "{\"inline_keyboard\":[[{\"text\":\"txt\",\"switch_inline_query\":\"test\"}]]}"
web          | })

and receive ok from tg:

web          |  ▸ Performing request
web          |  ▸ receiving ◄◄ {
web          |   "ok": true,
web          |   "result": {
web          |     "message_id": 59,
---skipped-------------------------------
web          |     "date": 1614956741,
web          |     "text": "Welcome",
web          |     "reply_markup": {
web          |       "inline_keyboard": [
web          |         [
web          |           {
web          |             "text": "txt",
web          |             "switch_inline_query": "test"
web          |           }
web          |         ]
web          |       ]
web          |     }
web          |   }
web          | }

I see deep in code but can't find the error(
Any variants with button("txt", switch_inline_query_current_chat: "test") etc does not help.

Manual polling feature

Add method in Tourmaline::Poller to manually poll updates.
It can be useful if you want to do other events in main loop (because I don't understand Crystal concurrency yet and I didn't find other way to do other things while bot is running).

I did it such way in my code but I have no time to make proper PR

# Modification of Tourmaline::Poller with manual poll feature
require "tourmaline"

module Burservis
  class PollingNotStarted < Exception; end

  # The `Poller` class is responsible for polling Telegram's API for updates,
  # and then passing them to the `Dispatcher` for processing.
  class Poller
    Log = ::Log.for(self)

    getter offset : Int64

    def initialize(client : Tourmaline::Client)
      @client = client
      @offset = 0_i64
      @polling = false
    end

    def poll
      if !@polling
        raise PollingNotStarted.new("Polling is not started")
      end

      updates = @client.get_updates(offset: offset, timeout: 30)
      updates.each do |update|
        @client.dispatcher.process(update)
        @offset = Int64.new(update.update_id + 1)
      end
    end

    # Starts polling Telegram's API for updates.
    def start(manual_poll : Bool?)
      @client.delete_webhook
      Log.info { "Polling for updates..." }
      @polling = true

      if !manual_poll
        while @polling
          poll
        end
      end
    end

    def stop
      @polling = false
    end
  end
end

also could be nice to make poller getter in Client

Error: undefined method 'persisted_users' for Tourmaline::NilPersistence (compile-time type is Tourmaline::Persistence+)

With the code below the @persistence instance is a Tourmaline::JsonPersistence: #<Tourmaline::JsonPersistence:0x7f12bf279100 @filename="tourmaline_persistence.json", @persisted_users=

I need to add @persistence.as(Tourmaline::JsonPersistence) to avoid the error:

Error: undefined method 'persisted_users' for Tourmaline::NilPersistence (compile-time type is Tourmaline::Persistence+)
@[Command("seen")]
    def seen_command(client_, update)
      puts @persistence.inspect
      users = @persistence.as(Tourmaline::JsonPersistence).persisted_users.map(&.[1].username).join('\n')
      update.message.try &.reply(users)
    end

Broken examples

Trying to run the example in the readme results in a broken build:

Resolving dependencies
Fetching https://github.com/protoncr/tourmaline.git
Fetching https://github.com/crystal-lang/crystal-db.git
Fetching https://github.com/mamantoha/http_proxy.git
Using db (0.11.0)
Using http_proxy (0.10.3 at ea17189)
Installing tourmaline (0.29.0 at 08717e7)
Writing shard.lock
Building: bot
Error target bot failed to compile:
Showing last frame. Use --error-trace for full trace.

In lib/tourmaline/src/tourmaline/context.cr:69:17

 69 | @client.send_message(**kwargs, chat_id: message.chat.id, text: text)
              ^-----------
Error: no parameter named 'reply_to_message_id'

Overloads are:
 - Tourmaline::Client::Api#send_message(chat_id : Int32 | Int64 | String, text : String, message_thread_id : Int32 | Int64 | ::Nil = nil, parse_mode : ParseMode = default_parse_mode, entities : Array(Tourmaline::MessageEntity) | ::Nil = nil, link_preview_options : Tourmaline::LinkPreviewOptions | ::Nil = nil, disable_notification : Bool | ::Nil = nil, protect_content : Bool | ::Nil = nil, reply_parameters : Tourmaline::ReplyParameters | ::Nil = nil, reply_markup : Tourmaline::InlineKeyboardMarkup | Tourmaline::ReplyKeyboardMarkup | Tourmaline::ReplyKeyboardRemove | Tourmaline::ForceReply | ::Nil = nil)

Seems to be related to #68, 5772091 seems to be working fine.

Rename File to something else

The model named File conflicts with the Crystal builtin class File, which means if you want to reference File anywhere in your bot (for File.join, File.open, etc) you have to use the ::File notation, which is obviously not ideal.

Connection pooling

The commit b758815 fixed a concurrency issue by removing the global HTTP::Client and instead just using the HTTP::Client.exec class method. This isn't super great for performance though, so connection pooling should be added (maybe with the ability to process jobs and handle rate limiting?)

Figure out ORM

I want Tourmaline to be as easy to use as possible. As such it would really behoove us to have an ORM that we have absolute compatibility with so you can just use it. I have a couple qualifications:

  • Needs to be easy to use and well documented
  • Should have some kind of migration system
  • The base Model should be a module if at all possible, if not something like DB::Serializable for the models will be a must. This is because I want to make it possible to store Tourmaline models in the database with minimal effort.

Possible candidates:

Any ideas?

Figure out better event handling

So currently the event system isn't bad, but it could be better. As things sit right now EventHandler has no context as to what might be available for any given event. For instance:

@[On(:text)]
def on_text(ctx)
  puts ctx.message.text
end

One might expect this to compile, but it won't. This is because all events are handed the same EventContext object which may or may not have a message attached. Ideally the context should be aware of what events will certainly have what properties.

Additionally, since all On events have the same context, there's no good way to handle filters. I would like to implement filters similar to what python-telegram-bot has, but to do so the filters should be context aware so that we can have certain filters specific to certain event types.

A good implementation may look something like this:

@[On(:text, filters: [ Filters::RegexFilter.new(/^hello/) ])]
def on_hello(ctx)
  ctx.message.reply("https://nohello.com")
end

Though I'd like to find a somewhat cleaner way of handling filters.

I'm 100% open to comments and suggestions on this.

Accumulate as many errors as possible

I have been working on tracking as many errors as possible and adding them to error.cr to allow more fine grained control of the errors you want to catch and handle. Telegram, however, has a lot of errors, so there are still likely many more that need to be added.

If you come across an error while experimenting and see that it's not listed in error.cr, please add it here.

Update shards is not working with Crystal 0.35.0 or 0.35.1.

If you are experiencing Unable to satisfy the following requirements with crystal 0.35+, use crystal shards update command from version 0.34.0 and compile with crystal 0.35+ like : /opt/crystal-0.35.1-1/bin/crystal build --no-debug --release -o bin/investbot src/main.cr

image

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.