Break api hook_chat -> on_chat

This commit is contained in:
ChillerDragon 2022-11-05 09:39:16 +01:00
parent 57dfc76588
commit 1d3076e34b
5 changed files with 6 additions and 6 deletions

View file

@ -15,7 +15,7 @@ require_relative 'lib/teeworlds-client'
client = TeeworldsClient.new(verbose: false)
client.hook_chat do |msg|
client.on_chat do |msg|
puts "[chat] #{msg}"
end

View file

@ -22,7 +22,7 @@
## TeeworldsClient
### #hook_chat(&block)
### #on_chat(&block)
**Parameter: block [Block]**
@ -34,7 +34,7 @@ The block takes one parameter of type [ChatMessage](#chatmessage).
```ruby
client = TeeworldsClient.new
client.hook_chat do |msg|
client.on_chat do |msg|
puts "[chat] #{msg}"
end

View file

@ -15,7 +15,7 @@ client = TeeworldsClient.new(verbose: false)
# msg.author.team
# msg.author.name
# msg.author.clan
client.hook_chat do |msg|
client.on_chat do |msg|
puts "[chat] #{msg}"
end

View file

@ -52,7 +52,7 @@ class TeeworldsClient
}
end
def hook_chat(&block)
def on_chat(&block)
@hooks[:chat] = block
end

View file

@ -30,7 +30,7 @@ client = TeeworldsClient.new(verbose: args[:verbose])
client.set_startinfo(
name: "ruby gamer")
client.hook_chat do |msg|
client.on_chat do |msg|
puts "[chat] #{msg}"
end