Coder Social home page Coder Social logo

channel-bot's Introduction

channel-bot

Slackの中のチャンネル情報を通知してくれるbotです。
以下のことができます。

  • 指定した文字列が打ち込まれるとチャンネル一覧を表示する
  • 新しいチャンネルが作成されると、チャンネル名を通知する
  • 新しいemojiが追加されると、チャンネルに通知する

チャンネル一覧と新しいチャンネル通知はリンクとして表示されるため、すぐにそのチャンネルを見に行くことができます。 SlackのReal Time Messaging APIを使用しており、 ライブラリとしてpyton-slackclientを使用しています。

Installation

Githubからクローンしてきます

$ git clone https://github.com/ymym3412/channel-bot
$ cd channel-bot

ライブラリのインストールを行います

$ pip install -r requirements.txt

Usage

config.iniに必要な情報を記述します

token={your slack token or bot token}
command={show all channels}
room={room name that you want to nortificate like general}

token ・・・ユーザーのtoken、あるいはbot用のトークンを指定します
command ・・・ここで指定した文字列を含むメッセージが特定のチャンネルなどで使用されると指定したチャンネルに現在のチャンネル一覧が表示されます
room ・・・通知を行いたいSlackのチャンネル名を指定します(トークンの持ち主が所属するチャンネルである必要があります)

スクリプトを実行し、botを立ち上げます。

$ python channel-bot.py

config.iniでbot用のtokenを使用した場合は、そのbotをconfig.iniのroomで指定したroomに招待してください。

Example

チャンネル一覧の表示

config.inicommandで指定した文字列がroomで指定したチャンネルで使用されると、チャンネルの一覧と各チャンネルのpurposeが表示されます。
アーカイブされたチャンネルは表示されません。またチャンネル名はリンクとして表示されます。

「channels」を指定した場合

user:channels
bot:チャンネル一覧
    #general : This channel is for team-wide...

    #random : A place for non-work banter, links, articles ...
    
    #sample-room : {purpose of sample-room}

新しく作成されたチャンネルの通知

Slack内で新しいチャンネルが作成されると、指定されたチャンネルに通知が飛びます。
チャンネル名はリンクとして表示されます。

bot:New Channel!
    #new-channel-name

新しく追加されたemojiの通知

Slackに新しいemojiが追加されると、emoji名とオリジナルのファイルを表示します。

bot:New Stamp!`:zoi:`
    Original: https://emoji.slack-edge.com/T03JDMZLZ/zoi1/c3e... 

channel-bot's People

Contributors

subarunari avatar yasu-miura avatar ymym3412 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.