osoji to-ban bot

36
Osoji to-ban bot 2016/08/04(Thu) meguro.es #5 @treby006

Upload: treby

Post on 16-Apr-2017

290 views

Category:

Technology


2 download

TRANSCRIPT

Osoji to-ban bot2016/08/04(Thu) meguro.es #5

@treby006

treby.info(){

name: ‘treby / Hiroaki Ninomiya’,

description: ‘freelance (Ruby(Shinjuku.rb), PHP, Vue.js)’,

portfolio: ‘http://treby.info/’,

twitter: ‘@treby006’,

facebook: ‘Hiroaki.Ninomiya’

}

[PR] LINE Blog

http://lineblog.me/treby/

Freelance diary, almost poems :)

AgendaI like making bots, so I’m familiar with Hubot.

Hubot was made by GitHub. And written in CoffeeScript.

I made an bot for the business purpose.

Introduce background, solution, implementation, feedbacks.

Moto-neta

http://qiita.com/treby/items/3e6cb3f4ac835dcc6017

Are you ready?

Go!!!

BackgroundI worked at a small team placed in a room (SOHO)

Background

There were no clean staffs, so we should clean our office ourselves.

We created weekly duty for clean.

To manage the duty, we used hand-mades plate…

Background

Problem

You know, most of people were very busy.

So, the duty were often forgot.

Our office became dirty, day by day. x(

Solution

Using Hubot

Osoji to-ban bot

To solve this problem, I made an bot named “cleanbear".

Management who should clean the office.

Function

Worked on Slack. Powered by Heroku.

Add or Remove slack account.

Notice and change the duty regularly.

Structure

common functions

redis

cron jobcommand interface

Implementation - commonFunctions to manage the duty.

getSweepers

getCurrentSweeper

getNextSweeper

rotateSweeper

https://gist.github.com/treby/f4dfa50e39c3725b6f13

Implementation - cron

Execution regularly

Every Monday noon.

Every Wednesday

Every Friday (Change duty)

https://gist.github.com/treby/826f09c054a71fa94bd1

Implementation - command

Commands for ChatOps

indexSweepers

createSweeper

destroySweeper

clearSweeper

https://gist.github.com/treby/b4daceacd6a385d2395c

Implementation - commandCommands

hubot sweepers list

hubot sweepers add <slack name>

hubot sweepers remove <slack name>

hubot sweepers current

hubot sweepers rotate

hubot sweepers set <slack name>

FeedbackPros

No longer annoying the management of the clean duty! yay!

Cons

Ignoring bot’s mention…

I believe the problem was totally solved. yes.

One more thing…

bot’s advantage - Interaction

The bot’s main factor is interaction.

Virtual communication

SABISHIKUNAI

By the way, I love imas.

bot x imas

ORE-TOKU

Twitter x Hubot

bot can make communications!

First, chatops should be helpful.

But, mainly chat bot should be your friend.

……I think :)

Have a good bot’s life!

Happy Hacking!!