add Dockerfile

This commit is contained in:
Dawid Wysokiński 2020-05-30 13:24:42 +02:00
parent 9ec3357780
commit d5a977ade0
2 changed files with 29 additions and 1 deletions

15
Dockerfile Normal file
View File

@ -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

View File

@ -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) {