kybus-bot 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7751ec07a20b41b400f7d49dbc5dcb8b4951a3dd07a4ea32f0cccefb9985336e
4
- data.tar.gz: 1806738e2740b0d626b19a11ae843503fb5171516ef80a64d644ab70c3520dc1
3
+ metadata.gz: c7c076fdf29d45a346d07aa5639349a66cff1a83ed15f0cfbafc4e6d4698cbd9
4
+ data.tar.gz: 0fa6891cd37efd3a37b87b59e3dc90fd1628384c43863237e70ea6f757f2086a
5
5
  SHA512:
6
- metadata.gz: deabacf971edc2c6b8dbe52736ba5c1bcb6a95aa1bc4253bef5b13de7d37b10068111c618aa5f05f171c0bfb721a546e4a4a3f66781a6773a4c318c644338a3a
7
- data.tar.gz: e8b73239aa929d94a85cc831eb8515411a76e6f19fbb1a5d6d3fff7b2157130f328de70e1b0f27e08c8f5af1a5696c6d9da52c56ef6e371edf252bfea18cf4ee
6
+ metadata.gz: f620f4d3674eb392f61f7a50abf378c1fa2fef5b718a93cf4ec1c340f906b1d924948f374fc0214d817664c26a97e4d5cdfa301c6588ba0c2e30bf5af8d7fb75
7
+ data.tar.gz: f2b708234bb392bfaf98d75f29720ea081ead5e3ea4cba36a7703abd9dcc7516e8328eb8f2583604c0de819e15c391ba1a7066cb3b74bf4ef39c0713186f6e96
@@ -159,7 +159,7 @@ module Kybus
159
159
  end
160
160
 
161
161
  # interface for sending messages
162
- def send_message(channel_name, contents, attachment = nil)
162
+ def send_message(contents, channel_name, attachment = nil)
163
163
  channel(channel_name).answer(contents, attachment)
164
164
  end
165
165
 
@@ -47,12 +47,12 @@ module Kybus
47
47
  end
48
48
 
49
49
  # interface for sending messages
50
- def send_message(channel_name, contents)
50
+ def send_message(contents, channel_name)
51
51
  puts "#{channel_name} => #{contents}" if @config['debug']
52
- @client.api.send_message(chat_id: channel_name, text: contents)
52
+ @client.api.send_message(chat_id: channel_name.to_i, text: contents, parse_mode: @config['parse_mode'])
53
53
  # :nocov:
54
54
  rescue ::Telegram::Bot::Exceptions::ResponseError => e
55
- return if e[:error_code] == '403'
55
+ return if e.error_code == '403'
56
56
  end
57
57
  # :nocov:
58
58
 
@@ -123,7 +123,7 @@ module Kybus
123
123
  def ask_param(param, label = nil)
124
124
  provider = bot.provider
125
125
  msg = label || "I need you to tell me #{param}"
126
- bot.send_message(provider.last_message.channel_id, msg)
126
+ bot.send_message(msg, provider.last_message.channel_id)
127
127
  execution_context.next_param = param
128
128
  end
129
129
  end
@@ -15,7 +15,7 @@ module Kybus
15
15
  def send_message(content, channel = nil)
16
16
  raise(Base::EmptyMessageError) unless content
17
17
 
18
- provider.send_message(channel || current_channel, content)
18
+ @bot.send_message(content, channel || current_channel)
19
19
  end
20
20
 
21
21
  def send_image(content, channel = nil, caption: nil)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Kybus
4
4
  module Bot
5
- VERSION = '0.8.1'
5
+ VERSION = '0.8.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kybus-bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gilberto Vargas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-05 00:00:00.000000000 Z
11
+ date: 2023-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kybus-core