Skip to content

Commit b81ca61

Browse files
authored
Merge pull request #6 from 10Nates/dev
Dockerize
2 parents a8cb4d0 + f3aacce commit b81ca61

9 files changed

+493
-8
lines changed

.dockerignore

+140
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/macos,linux,windows,go,visualstudiocode
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,linux,windows,go,visualstudiocode
3+
4+
### Go ###
5+
# If you prefer the allow list template instead of the deny list, see community template:
6+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
7+
#
8+
# Binaries for programs and plugins
9+
*.exe
10+
*.exe~
11+
*.dll
12+
*.so
13+
*.dylib
14+
15+
# Test binary, built with `go test -c`
16+
*.test
17+
18+
# Output of the go coverage tool, specifically when used with LiteIDE
19+
*.out
20+
21+
# Dependency directories (remove the comment below to include it)
22+
# vendor/
23+
24+
# Go workspace file
25+
# go.work
26+
27+
### Go Patch ###
28+
/vendor/
29+
/Godeps/
30+
31+
### Linux ###
32+
*~
33+
34+
# temporary files which can be created if a process still has a handle open of a deleted file
35+
.fuse_hidden*
36+
37+
# KDE directory preferences
38+
.directory
39+
40+
# Linux trash folder which might appear on any partition or disk
41+
.Trash-*
42+
43+
# .nfs files are created when an open file is removed but is still being accessed
44+
.nfs*
45+
46+
### macOS ###
47+
# General
48+
.DS_Store
49+
.AppleDouble
50+
.LSOverride
51+
52+
# Icon must end with two \r
53+
Icon
54+
55+
56+
# Thumbnails
57+
._*
58+
59+
# Files that might appear in the root of a volume
60+
.DocumentRevisions-V100
61+
.fseventsd
62+
.Spotlight-V100
63+
.TemporaryItems
64+
.Trashes
65+
.VolumeIcon.icns
66+
.com.apple.timemachine.donotpresent
67+
68+
# Directories potentially created on remote AFP share
69+
.AppleDB
70+
.AppleDesktop
71+
Network Trash Folder
72+
Temporary Items
73+
.apdisk
74+
75+
### VisualStudioCode ###
76+
.vscode/*
77+
!.vscode/settings.json
78+
!.vscode/tasks.json
79+
!.vscode/launch.json
80+
!.vscode/extensions.json
81+
!.vscode/*.code-snippets
82+
83+
# Local History for Visual Studio Code
84+
.history/
85+
86+
# Built Visual Studio Code Extensions
87+
*.vsix
88+
89+
### VisualStudioCode Patch ###
90+
# Ignore all local history of files
91+
.history
92+
.ionide
93+
94+
# Support for Project snippet scope
95+
96+
### Windows ###
97+
# Windows thumbnail cache files
98+
Thumbs.db
99+
Thumbs.db:encryptable
100+
ehthumbs.db
101+
ehthumbs_vista.db
102+
103+
# Dump file
104+
*.stackdump
105+
106+
# Folder config file
107+
[Dd]esktop.ini
108+
109+
# Recycle Bin used on file shares
110+
$RECYCLE.BIN/
111+
112+
# Windows Installer files
113+
*.cab
114+
*.msi
115+
*.msix
116+
*.msm
117+
*.msp
118+
119+
# Windows shortcuts
120+
*.lnk
121+
122+
# End of https://www.toptal.com/developers/gitignore/api/macos,linux,windows,go,visualstudiocode
123+
124+
dist/
125+
README-old.md
126+
temp.txt
127+
*.prof
128+
tras
129+
src/data.json
130+
psql_tras_db/
131+
132+
# Docker specific
133+
.git/
134+
.gitignore
135+
Dockerfile
136+
docker-compose.yml
137+
.dockerignore
138+
LICENSE
139+
README.md
140+
parse_test.go

.gitignore

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/macos,linux,windows,go,visualstudiocode
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,linux,windows,go,visualstudiocode
3+
4+
### Go ###
5+
# If you prefer the allow list template instead of the deny list, see community template:
6+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
7+
#
8+
# Binaries for programs and plugins
9+
*.exe
10+
*.exe~
11+
*.dll
12+
*.so
13+
*.dylib
14+
15+
# Test binary, built with `go test -c`
16+
*.test
17+
18+
# Output of the go coverage tool, specifically when used with LiteIDE
19+
*.out
20+
21+
# Dependency directories (remove the comment below to include it)
22+
# vendor/
23+
24+
# Go workspace file
25+
# go.work
26+
27+
### Go Patch ###
28+
/vendor/
29+
/Godeps/
30+
31+
### Linux ###
32+
*~
33+
34+
# temporary files which can be created if a process still has a handle open of a deleted file
35+
.fuse_hidden*
36+
37+
# KDE directory preferences
38+
.directory
39+
40+
# Linux trash folder which might appear on any partition or disk
41+
.Trash-*
42+
43+
# .nfs files are created when an open file is removed but is still being accessed
44+
.nfs*
45+
46+
### macOS ###
47+
# General
48+
.DS_Store
49+
.AppleDouble
50+
.LSOverride
51+
52+
# Icon must end with two \r
53+
Icon
54+
55+
56+
# Thumbnails
57+
._*
58+
59+
# Files that might appear in the root of a volume
60+
.DocumentRevisions-V100
61+
.fseventsd
62+
.Spotlight-V100
63+
.TemporaryItems
64+
.Trashes
65+
.VolumeIcon.icns
66+
.com.apple.timemachine.donotpresent
67+
68+
# Directories potentially created on remote AFP share
69+
.AppleDB
70+
.AppleDesktop
71+
Network Trash Folder
72+
Temporary Items
73+
.apdisk
74+
75+
### VisualStudioCode ###
76+
.vscode/*
77+
!.vscode/settings.json
78+
!.vscode/tasks.json
79+
!.vscode/launch.json
80+
!.vscode/extensions.json
81+
!.vscode/*.code-snippets
82+
83+
# Local History for Visual Studio Code
84+
.history/
85+
86+
# Built Visual Studio Code Extensions
87+
*.vsix
88+
89+
### VisualStudioCode Patch ###
90+
# Ignore all local history of files
91+
.history
92+
.ionide
93+
94+
# Support for Project snippet scope
95+
96+
### Windows ###
97+
# Windows thumbnail cache files
98+
Thumbs.db
99+
Thumbs.db:encryptable
100+
ehthumbs.db
101+
ehthumbs_vista.db
102+
103+
# Dump file
104+
*.stackdump
105+
106+
# Folder config file
107+
[Dd]esktop.ini
108+
109+
# Recycle Bin used on file shares
110+
$RECYCLE.BIN/
111+
112+
# Windows Installer files
113+
*.cab
114+
*.msi
115+
*.msix
116+
*.msm
117+
*.msp
118+
119+
# Windows shortcuts
120+
*.lnk
121+
122+
# End of https://www.toptal.com/developers/gitignore/api/macos,linux,windows,go,visualstudiocode
123+
124+
dist/
125+
README-old.md
126+
temp.txt
127+
*.prof
128+
tras
129+
src/data.json
130+
psql_tras_db/

Dockerfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM golang:alpine
2+
3+
WORKDIR /app
4+
5+
COPY . .
6+
7+
RUN mkdir dist
8+
9+
RUN go build -ldflags="-s -w" -o dist/tras .
10+
11+
#unnecessary for operation
12+
RUN rm *.go
13+
RUN rm go.*
14+
RUN rm -rf db/
15+
RUN rm -rf discordless/
16+
17+
CMD [ "dist/tras" ]
18+
19+
STOPSIGNAL SIGTERM

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ This may sound like any other bot at first, but this is **much** more than basic
2828

2929
__LIST OF COMMANDS__
3030
---
31-
### `@TRAS help` / `/help`
31+
### `@TRAS help` or `/help`
3232
> Summons a help list.
3333
> Slash command doesn't require DMs
3434
35-
### `@TRAS about` / `/about`
35+
### `@TRAS about` or `/about`
3636
> Gives information about the bot.
3737
> Add "NoCB" for devices that don't support links with command blocks.
3838
> Slash command doesn't require DMs

commands.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,8 @@ func getUserRankInfo(msg *disgord.Message, s *disgord.Session, user disgord.Snow
552552
}
553553
levelStr := strconv.Itoa(level)
554554
progStr := strconv.Itoa(int(rankMem.Progress))
555-
nextMilestone := strconv.Itoa(int(math.Pow(float64(level+1), 2)))
556-
baseReply(msg, s, "Level:"+levelStr+"\n"+"Progress:"+progStr+"/"+nextMilestone)
555+
nextMilestone := strconv.Itoa(int(math.Pow(2, float64(level+1))))
556+
baseReply(msg, s, "Level: "+levelStr+"\n"+"Progress: "+progStr+"/"+nextMilestone)
557557
}
558558

559559
// simple replace

constants.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const BOT_AUTHOR_ID = "186507006008360960"
1010

1111
const FIGFONT_DIR = "src/figfonts/"
1212

13-
const DB_HOST = "localhost"
13+
const DB_HOST = "db"
1414

1515
const DB_PORT = 5432
1616

@@ -35,7 +35,7 @@ Text Response Automation System
3535
''''''py
3636
#################''''''md
3737
## Links'''
38-
'- '['[Website]'](https://tras.almostd.one/)')
38+
'- '['[Website]'](https://tras.almostd.one/)
3939
'- '['[Add Link]'](https://bit.ly/gotras)
4040
'- '['[Top.gg Page]'](https://top.gg/bot/494273862427738113)
4141
'- '['[Community]'](https://discord.gg/nMprsNGewJ)

0 commit comments

Comments
 (0)