Git Product home page Git Product logo

emojibot's Introduction

Slack emojibot

これはテキストから自動的に絵文字を作成する絵文字ぼっとです。

動作イメージ

こんな感じで動きます。 動作イメージ

セットアップ

git clone https://github.com/toshi17/emojibot.git
cd emojibot
pip install -r requirements.txt

以下の操作を終えたら、以下に示すCookieの設定を行なってください。

  • https://{teamname}.slack.com/customize/emojiを開く
  • 開発者ツールを起動し、ネットワークタブを開く
  • ページをリロードし、"name"が"emoji"の項目を開く
  • 新たに開いたタブから"Headers"を選ぶ
  • "Request-Headers"までスクロールし、"Cookie"の値をコピーし,slackbot_settings.pyに追加する

起動

上記のセットアップを終えたら

python run.py

で動きます。

docker

dockerが入っている場合には上記のセットアップをしなくとも

docker build -t <img_name>
docker run -it --rm <img_name>

で動きます。

emojibot's People

Contributors

toshi17 avatar

Stargazers

Katsuhito Nakashima avatar Yui Ichioka avatar Pine Mizune avatar

Watchers

James Cloos avatar

emojibot's Issues

api_tokenの出力の仕様が変わったように思えます

return API_TOKEN_PATTERN.match(line.strip()).group(1)

この行で正規表現にマッチするものがなくてエラーが起きます。

具体的には、

@bot add あ a
とすると
'NoneType' object has no attribute 'group'
と出ます。

正規表現を弄ってみたのですが動かなかったので、うまいことやれば一瞬のはずなのですが無理やり
line_= line.strip()
line_=line_[line_.find('"api_token":'):]
line_=line_[:line_.find(",")]
line_=line_[len('"api_token":"'):-1]
とすると動きました。(雑ですいません)

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.