From d5a977ade0c8db17cf47b322c48cd74bbef6275f Mon Sep 17 00:00:00 2001 From: Kichiyaki Date: Sat, 30 May 2020 13:24:42 +0200 Subject: [PATCH] add Dockerfile --- Dockerfile | 15 +++++++++++++++ discord/commands.go | 15 ++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ef6a236 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM golang:alpine + +ENV MODE=production + +WORKDIR /go/src/app +COPY . . + +RUN go build -o main . + +EXPOSE 8080 + +ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.2.1/wait ./wait +RUN chmod +x ./wait + +CMD ./wait && ./main \ No newline at end of file diff --git a/discord/commands.go b/discord/commands.go index 8bf9082..df9abcb 100644 --- a/discord/commands.go +++ b/discord/commands.go @@ -1,6 +1,7 @@ package discord import ( + "fmt" "strings" ) @@ -24,7 +25,19 @@ func (cmd Command) WithPrefix(prefix string) string { } func (s *Session) sendHelpMessage(mention, channelID string) { - s.SendMessage(channelID, mention+" zaraz ogarnę help cmd") + s.SendMessage(channelID, mention+"```Dostępne komendy \n"+fmt.Sprintf(` +- %s [świat] [id] - dodaje plemię z danego świata do obserwowanych +- %s - wyświetla wszystkie obserwowane plemiona +- %s [id z %s] - usuwa plemię z obserwowanych +- %s - ustawia kanał na którym będą wyświetlać się informacje o straconych wioskach +- %s - ustawia kanał na którym będą wyświetlać się informacje o podbitych wioskach + `, + AddCommand.WithPrefix(s.cfg.CommandPrefix), + ListCommand.WithPrefix(s.cfg.CommandPrefix), + DeleteCommand.WithPrefix(s.cfg.CommandPrefix), + ListCommand.WithPrefix(s.cfg.CommandPrefix), + LostVillagesCommand.WithPrefix(s.cfg.CommandPrefix), + ConqueredVillagesCommand.WithPrefix(s.cfg.CommandPrefix))+"```") } func (s *Session) sendUnknownCommandError(mention, channelID string, command ...string) {