-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Bot doesn't understand its command #113
Comments
Are you DMing the bot or sending a message to the bot in a channel? When you DM the bot you don't need to say |
I am sending a message to the bot in a channel. |
There's one more thing, something about the bot user, does addressing the bot with |
It's the same. This is what the log shows:
|
I don't see anything wrong. This is unmodified code? Which version of slack-ruby-bot? You should dig this a bit deeper, try to look inside the |
D, [2017-02-12T14:41:18.135824 #3145] DEBUG -- Slack::RealTime::Concurrency::Celluloid::Socket#handle_read: �~{"type":"desktop_notification","title":"TaiwanDigger","subtitle":"#test","msg":"1486881671.000007","content":"fifiteen82726: @test-bot ping","channel":"C44A6GP26","launchUri":"slack://channel?id=C44A6GP26&message=1486881671000007&team=T3CQFPT7C","avatarImage":"https://secure.gravatar.com/avatar/7c69390748f64982df87bc19af781d6f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2F7fa9%2Fimg%2Favatars%2Fava_0018-192.png","ssbFilename":"knock_brush.mp3","imageUri":null,"is_shared":false,"event_ts":"1486881677.692802"}
D, [2017-02-12T14:41:18.136042 #3145] DEBUG -- SlackRubyBot::Client#run_loop: WebSocket::Driver::MessageEvent, {"type":"desktop_notification","title":"TaiwanDigger","subtitle":"#test","msg":"1486881671.000007","content":"fifiteen82726: @test-bot ping","channel":"C44A6GP26","launchUri":"slack://channel?id=C44A6GP26&message=1486881671000007&team=T3CQFPT7C","avatarImage":"https://secure.gravatar.com/avatar/7c69390748f64982df87bc19af781d6f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2F7fa9%2Fimg%2Favatars%2Fava_0018-192.png","ssbFilename":"knock_brush.mp3","imageUri":null,"is_shared":false,"event_ts":"1486881677.692802"}
D, [2017-02-12T14:41:18.138727 #3145] DEBUG -- SlackRubyBot::Client#dispatch: avatarImage=https://secure.gravatar.com/avatar/7c69390748f64982df87bc19af781d6f.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2F7fa9%2Fimg%2Favatars%2Fava_0018-192.png, channel=C44A6GP26, content=fifiteen82726: @test-bot ping, event_ts=1486881677.692802, imageUri=, is_shared=false, launchUri=slack://channel?id=C44A6GP26&message=1486881671000007&team=T3CQFPT7C, msg=1486881671.000007, ssbFilename=knock_brush.mp3, subtitle=#test, title=TaiwanDigger, type=desktop_notification |
I'm having the same issue with version I've tried with |
A failing spec is pretty easy to write too: bot.rb: require "slack-ruby-bot"
class Bot < SlackRubyBot::Bot
command "ping" do |client, data, _|
client.say(text: "pong", channel: data.channel)
end
end bot_spec.rb: require "bot"
require "rspec-helper"
describe Bot do
it "responds to ping" do
expect({ message: "#{SlackBotRuby.config.user} ping")
.to respond_with_slack_message("pong")
end
end
|
I can confirm this is a problem. We have a spec for this exact scenario, but it only fails if run standalone. I'm looking into it. |
I have a fix in #114. Can @tomchipchase and @fifiteen82726 please confirm that it works? I'll cut a release. |
Fix #113: commands in subclassed SlackRubyBot::Bot.
Released 0.10.1. |
@dblock That fix works for me. Thanks for the quick fix, and for your work on this gem! |
Hi!
I run a simple pong bot but it doesn't understand its commands:
I am using this example code:
I registered the bot and I am running it with:
Is there something basic that I am doing wrong?
Thanks!
The text was updated successfully, but these errors were encountered: