Compare commits

..

No commits in common. 'feature/fortune' and 'develop' have entirely different histories.

  1. 4
      Makefile
  2. 16
      deps/Dockerfile
  3. 1485
      deps/fortune/fortunes
  4. 1365
      deps/fortune/kenm
  5. 38122
      deps/fortune/showerthoughts
  6. 40
      lorebot/lorebot.go

4
Makefile

@ -7,9 +7,6 @@ all: lorebot
depends:
go get github.com/nlopes/slack
go get github.com/unixvoid/glogger
go get gopkg.in/gcfg.v1
go get gopkg.in/redis.v5
lorebot:
$(GOC) lorebot/lorebot.go
@ -31,7 +28,6 @@ docker: stat
cp deps/redis.conf stage.tmp/
chmod +x deps/run.sh
cp deps/run.sh stage.tmp/
cp -R deps/fortune stage.tmp/
cp config.gcfg stage.tmp/
cd stage.tmp/ && \
sudo docker build -t $(IMAGE_NAME) .

16
deps/Dockerfile vendored

@ -1,19 +1,11 @@
FROM alpine
FROM scratch
RUN apk --update add ca-certificates redis fortune
RUN mkdir /redisbackup/
RUN rm -rf /usr/share/fortune
COPY fortune/ /usr/share/fortune
WORKDIR /usr/share/fortune/
RUN strfile -c % fortunes fortunes.dat
RUN strfile -c % kenm kenm.dat
RUN strfile -c % showerthoughts showerthoughts.dat
#ADD rootfs.tar.gz /
#RUN apk --update add ca-certificates redis
#RUN mkdir /redisbackup/
ADD rootfs.tar.gz /
COPY redis.conf /
COPY config.gcfg /
COPY lorebot /
COPY run.sh /
WORKDIR /
CMD ["/run.sh"]

1485
deps/fortune/fortunes vendored

File diff suppressed because it is too large Load Diff

1365
deps/fortune/kenm vendored

File diff suppressed because it is too large Load Diff

38122
deps/fortune/showerthoughts vendored

File diff suppressed because it is too large Load Diff

40
lorebot/lorebot.go

@ -10,7 +10,6 @@ import (
"net/http"
"net/textproto"
"os"
"os/exec"
"strconv"
"strings"
"time"
@ -239,12 +238,6 @@ func staticCommandHandler(rtm *slack.RTM, ev *slack.MessageEvent, redisClient *r
dicerollhandler(rtm, ev)
case "ceelo":
ceelorollhandler(rtm, ev)
case "fortune":
fortunehandler(rtm, ev)
case "kenm":
kenmhandler(rtm, ev)
case "showerthoughts":
showerthoughtshandler(rtm, ev)
case "listen":
rtm.SendMessage(rtm.NewOutgoingMessage("*it's what you hearin*", ev.Channel))
case "lorelist":
@ -382,39 +375,6 @@ func ceelorollhandler(rtm *slack.RTM, ev *slack.MessageEvent) {
}
}
func fortunehandler(rtm *slack.RTM, ev *slack.MessageEvent) {
fortune, err := exec.Command("fortune", "-e", "fortunes").CombinedOutput()
if err != nil {
fmt.Printf("%v\n", err)
rtm.SendMessage(rtm.NewOutgoingMessage("Fortune command is broken, contact HFIC", ev.Channel))
return
}
rtm.SendMessage(rtm.NewOutgoingMessage(fmt.Sprintf("%s", fortune), ev.Channel))
}
func kenmhandler(rtm *slack.RTM, ev *slack.MessageEvent) {
fortune, err := exec.Command("fortune", "-e", "kenm").CombinedOutput()
if err != nil {
fmt.Printf("%v\n", err)
rtm.SendMessage(rtm.NewOutgoingMessage("kenm command is broken, contact HFIC", ev.Channel))
return
}
rtm.SendMessage(rtm.NewOutgoingMessage(fmt.Sprintf("%s", fortune), ev.Channel))
}
func showerthoughtshandler(rtm *slack.RTM, ev *slack.MessageEvent) {
fortune, err := exec.Command("fortune", "-e", "showerthoughts").CombinedOutput()
if err != nil {
fmt.Printf("%v\n", err)
rtm.SendMessage(rtm.NewOutgoingMessage("showerthoughts command is broken, contact HFIC", ev.Channel))
return
}
rtm.SendMessage(rtm.NewOutgoingMessage(fmt.Sprintf("%s", fortune), ev.Channel))
}
func rrhandler(rtm *slack.RTM, ev *slack.MessageEvent) {
//fmt.Print(rand.Intn(100))
dice := []string{"*click*", "*BANG*", "*click*", "*click*", "*click*", "*click*"}

Loading…
Cancel
Save