Skip to content

Commit e0b0bce

Browse files
author
lachlan
authored
feat: rewrite bot (chamburr#62)
1 parent ef38d34 commit e0b0bce

File tree

206 files changed

+26694
-3189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+26694
-3189
lines changed

Diff for: .editorconfig

+5-8
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@ root = true
44
charset = utf-8
55
end_of_line = lf
66
indent_size = 4
7+
indent_style = space
78
insert_final_newline = true
89
trim_trailing_whitespace = true
10+
max_line_length = 100
911

10-
[*.py]
11-
indent_style = space
12-
max_line_length = 120
13-
14-
[*.go]
15-
indent_style = tab
16-
max_line_length = off
12+
[{*.vue,*.js,*.json,*.scss,*.svg,*.yml}]
13+
indent_size = 2
1714

1815
[*.md]
19-
max_line_length = 100
16+
indent_size = 2
2017
trim_trailing_whitespace = false

Diff for: .env.example

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
################ ModMail Configuration ################
2+
3+
# Environment (development/production)
4+
ENVIRONMENT=development
5+
6+
###################### Bot #######################
7+
8+
# Bot information
9+
BOT_TOKEN=
10+
BOT_CLIENT_ID=
11+
BOT_CLIENT_SECRET=
12+
13+
# Default command prefix
14+
DEFAULT_PREFIX==
15+
16+
# Number of clusters
17+
BOT_CLUSTERS=
18+
19+
##################### Users ######################
20+
21+
# Main support server
22+
MAIN_SERVER=
23+
24+
# Bot owner and admin users
25+
OWNER_USERS=
26+
ADMIN_USERS=
27+
28+
# Premium user roles
29+
PREMIUM1_ROLE=
30+
PREMIUM3_ROLE=
31+
PREMIUM5_ROLE=
32+
33+
# Premium channels
34+
PAYMENT_CHANNEL=
35+
PATRON_CHANNEL=
36+
37+
#################### Database ####################
38+
39+
# PostgreSQL server
40+
POSTGRES_DATABASE=modmail
41+
POSTGRES_USERNAME=postgres
42+
POSTGRES_PASSWORD=
43+
POSTGRES_HOST=127.0.0.1
44+
POSTGRES_PORT=5432
45+
46+
# Redis server
47+
REDIS_HOST=127.0.0.1
48+
REDIS_PORT=6379
49+
REDIS_PASSWORD=
50+
51+
# RabbitMQ server
52+
RABBIT_USERNAME=guest
53+
RABBIT_PASSWORD=guest
54+
RABBIT_HOST=127.0.0.1
55+
RABBIT_PORT=5672
56+
57+
##################### Server #####################
58+
59+
# Web server
60+
BASE_URI=https://local.test
61+
HTTP_HOST=0.0.0.0
62+
HTTP_PORT=6000
63+
64+
# Web API server
65+
API_HOST=127.0.0.1
66+
API_PORT=6001
67+
API_WORKERS=5
68+
API_SECRET=
69+
70+
# Bot API server
71+
BOT_API_HOST=127.0.0.1
72+
BOT_API_PORT=6002
73+
74+
################### Statistics ###################
75+
76+
# Google analytics ID
77+
GOOGLE_ANALYTICS=
78+
79+
# Sentry DSN
80+
SENTRY_DSN=
81+
82+
# Bot list tokens
83+
TOPGG_TOKEN=
84+
DBOTS_TOKEN=
85+
DBL_TOKEN=
86+
BOD_TOKEN=
87+
BFD_TOKEN=
88+
DBOATS_TOKEN=

Diff for: .gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

Diff for: .github/dependabot.yml

-10
This file was deleted.

Diff for: .github/pull_request_template.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
**Summary**
2+
A clear description of what this pull request is about.
3+
4+
**Related issue(s)**
5+
Provide links to relevant issues here.
6+
7+
**Additional context**
8+
Add any other context or screenshots about the pull request here.

Diff for: .gitignore

+162-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# IDEA config files
2-
.idea/
3-
41
# Byte-compiled / optimized / DLL files
52
__pycache__/
63
*.py[cod]
@@ -23,6 +20,7 @@ parts/
2320
sdist/
2421
var/
2522
wheels/
23+
share/python-wheels/
2624
*.egg-info/
2725
.installed.cfg
2826
*.egg
@@ -41,14 +39,17 @@ pip-delete-this-directory.txt
4139
# Unit test / coverage reports
4240
htmlcov/
4341
.tox/
42+
.nox/
4443
.coverage
4544
.coverage.*
4645
.cache
4746
nosetests.xml
4847
coverage.xml
4948
*.cover
49+
*.py,cover
5050
.hypothesis/
5151
.pytest_cache/
52+
cover/
5253

5354
# Translations
5455
*.mo
@@ -58,6 +59,7 @@ coverage.xml
5859
*.log
5960
local_settings.py
6061
db.sqlite3
62+
db.sqlite3-journal
6163

6264
# Flask stuff:
6365
instance/
@@ -70,16 +72,34 @@ instance/
7072
docs/_build/
7173

7274
# PyBuilder
75+
.pybuilder/
7376
target/
7477

7578
# Jupyter Notebook
7679
.ipynb_checkpoints
7780

81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
7885
# pyenv
79-
.python-version
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
# Pipfile.lock
8096

81-
# celery beat schedule file
97+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
98+
__pypackages__/
99+
100+
# Celery stuff
82101
celerybeat-schedule
102+
celerybeat.pid
83103

84104
# SageMath parsed files
85105
*.sage.py
@@ -105,8 +125,143 @@ venv.bak/
105125

106126
# mypy
107127
.mypy_cache/
128+
.dmypy.json
129+
dmypy.json
130+
131+
# Pyre type checker
132+
.pyre/
133+
134+
# pytype static type analyzer
135+
.pytype/
136+
137+
# Cython debug symbols
138+
cython_debug/
139+
140+
# Logs
141+
logs
142+
*.log
143+
npm-debug.log*
144+
yarn-debug.log*
145+
yarn-error.log*
146+
lerna-debug.log*
147+
148+
# Diagnostic reports (https://nodejs.org/api/report.html)
149+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
150+
151+
# Runtime data
152+
pids
153+
*.pid
154+
*.seed
155+
*.pid.lock
156+
157+
# Directory for instrumented libs generated by jscoverage/JSCover
158+
lib-cov
159+
160+
# Coverage directory used by tools like istanbul
161+
coverage
162+
*.lcov
163+
164+
# nyc test coverage
165+
.nyc_output
166+
167+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
168+
.grunt
169+
170+
# Bower dependency directory (https://bower.io/)
171+
bower_components
172+
173+
# node-waf configuration
174+
.lock-wscript
175+
176+
# Compiled binary addons (https://nodejs.org/api/addons.html)
177+
build/Release
178+
179+
# Dependency directories
180+
node_modules/
181+
jspm_packages/
182+
183+
# Snowpack dependency directory (https://snowpack.dev/)
184+
web_modules/
185+
186+
# TypeScript cache
187+
*.tsbuildinfo
188+
189+
# Optional npm cache directory
190+
.npm
191+
192+
# Optional eslint cache
193+
.eslintcache
194+
195+
# Microbundle cache
196+
.rpt2_cache/
197+
.rts2_cache_cjs/
198+
.rts2_cache_es/
199+
.rts2_cache_umd/
200+
201+
# Optional REPL history
202+
.node_repl_history
203+
204+
# Output of 'npm pack'
205+
*.tgz
206+
207+
# Yarn Integrity file
208+
.yarn-integrity
209+
210+
# dotenv environment variables file
211+
.env
212+
.env.test
213+
214+
# parcel-bundler cache (https://parceljs.org/)
215+
.cache
216+
.parcel-cache
217+
218+
# Next.js build output
219+
.next
220+
out
221+
222+
# Nuxt.js build / generate output
223+
.nuxt
224+
dist
225+
226+
# Gatsby files
227+
.cache/
228+
# Comment in the public line in if your project uses Gatsby and not Next.js
229+
# https://nextjs.org/blog/next-9-1#public-directory-support
230+
# public
231+
232+
# vuepress build output
233+
.vuepress/dist
234+
235+
# Serverless directories
236+
.serverless/
237+
238+
# FuseBox cache
239+
.fusebox/
240+
241+
# DynamoDB Local files
242+
.dynamodb/
243+
244+
# TernJS port file
245+
.tern-port
246+
247+
# Stores VSCode versions used for testing VSCode extensions
248+
.vscode-test
249+
250+
# yarn v2
251+
.yarn/cache
252+
.yarn/unplugged
253+
.yarn/build-state.yml
254+
.yarn/install-state.gz
255+
.pnp.*
256+
257+
# Generated by Cargo
258+
# will have compiled files and executables
259+
debug/
260+
target/
261+
262+
# These are backup files generated by rustfmt
263+
**/*.rs.bk
108264

109265
# Custom
110-
.DS_Store
111-
config.py
112266
targets.json
267+
!web/pages/*

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Congratulations! You have set up everything, and you can finally have the bot up
7373
start twilight-dispatch first, then use the following command to start the bot.
7474

7575
```sh
76-
python3 launcher.py
76+
python3 main.py
7777
```
7878

7979
## License

0 commit comments

Comments
 (0)