前提・実現したいこと
Pythonを使ってRaspberry pi上にSlackbot を作成しているのですが、レスポンス,リッスンの反応がうまくできません。
エラーは出ていないので文法等を間違えてるはずはないのですが...
ソースコード
#---run.py # coding: utf-8 from slackbot.bot import Bot def main(): bot = Bot() bot.run() if __name__=='__main__': print('start slackbot') main()
#---slackbot_settings.py #coding: utf-8 #botアカウントトークン API_TOKEN="-------------------------------------" DEFAULT_REPLY = "It's words that's not registered on me." PLUGINS = ['plugins',]
#---plugins---my_mention.py from slackbot.bot import respond_to # @botname: で反応するデコーダ from slackbot.bot import listen_to # チャネル内発言で反応するデコーダ from slackbot.bot import default_reply # 該当する応答がない場合に反応するデコーダ @respond_to('Hello') def mention_func(message): message.reply('私にメンションと言ってどうするのだ') # メンション @listen_to('リッスン') def listen_func(message): message.send('誰かがリッスンと投稿したようだ') # ただの投稿 message.reply('君だね?') # メンション
回答1件
あなたの回答
tips
プレビュー