Compare commits

..

9 Commits

Author SHA1 Message Date
330848ceeb Merge pull request 'master' (#8) from master into dev
Reviewed-on: #8
2025-09-12 20:42:51 +03:00
8cdf0cbd8d Update .deploy/deploy-prod.yaml
All checks were successful
Deploy Dev / Build (pull_request) Successful in 1m20s
Deploy Dev / Push (pull_request) Successful in 22s
Deploy Dev / Deploy dev (pull_request) Successful in 29s
2025-09-12 20:42:31 +03:00
6a1f2d3d09 Update .deploy/deploy-dev.yaml 2025-09-12 20:42:09 +03:00
3fa0b815f3 Merge pull request 'fix' (#7) from master into dev
Reviewed-on: #7
2025-07-08 01:07:33 +03:00
Egor Matveev
6509e58b6e fix
All checks were successful
Deploy Dev / Build (pull_request) Successful in 6s
Deploy Dev / Push (pull_request) Successful in 12s
Deploy Dev / Deploy dev (pull_request) Successful in 19s
2025-07-08 02:05:25 +04:00
40287c4e14 Merge pull request 'fix' (#6) from master into dev
Reviewed-on: #6
2025-07-08 00:30:36 +03:00
Egor Matveev
28df4aef54 fix
All checks were successful
Deploy Dev / Build (pull_request) Successful in 7s
Deploy Dev / Push (pull_request) Successful in 13s
Deploy Dev / Deploy dev (pull_request) Successful in 18s
2025-07-08 01:30:10 +04:00
c996bb837a Merge pull request 'fix' (#5) from master into dev
Reviewed-on: #5
2025-07-08 00:28:42 +03:00
Egor Matveev
c15e950e02 fix
All checks were successful
Deploy Dev / Build (pull_request) Successful in 6s
Deploy Dev / Push (pull_request) Successful in 13s
Deploy Dev / Deploy dev (pull_request) Successful in 20s
2025-07-08 01:25:34 +04:00
4 changed files with 11 additions and 6 deletions

View File

@@ -21,7 +21,7 @@ services:
networks: networks:
- b-jokes-net - b-jokes-net
environment: environment:
MONGO_HOST: "mongo.develop.sprinthub.ru" MONGO_HOST: "mongo.dev.chocomarsh.com"
MONGO_PASSWORD: $MONGO_PASSWORD_DEV MONGO_PASSWORD: $MONGO_PASSWORD_DEV
command: api command: api
deploy: deploy:
@@ -35,7 +35,7 @@ services:
poll: poll:
image: mathwave/sprint-repo:b-jokes image: mathwave/sprint-repo:b-jokes
environment: environment:
MONGO_HOST: "mongo.develop.sprinthub.ru" MONGO_HOST: "mongo.dev.chocomarsh.com"
MONGO_PASSWORD: $MONGO_PASSWORD_DEV MONGO_PASSWORD: $MONGO_PASSWORD_DEV
command: poll command: poll
deploy: deploy:
@@ -49,8 +49,9 @@ services:
bot: bot:
image: mathwave/sprint-repo:b-jokes image: mathwave/sprint-repo:b-jokes
environment: environment:
MONGO_HOST: "mongo.develop.sprinthub.ru" MONGO_HOST: "mongo.dev.chocomarsh.com"
MONGO_PASSWORD: $MONGO_PASSWORD_DEV MONGO_PASSWORD: $MONGO_PASSWORD_DEV
STAGE: "development"
command: bot command: bot
networks: networks:
- configurator - configurator

View File

@@ -21,7 +21,7 @@ services:
networks: networks:
- b-jokes-net - b-jokes-net
environment: environment:
MONGO_HOST: "mongo.sprinthub.ru" MONGO_HOST: "mongo.chocomarsh.com"
MONGO_PASSWORD: $MONGO_PASSWORD_PROD MONGO_PASSWORD: $MONGO_PASSWORD_PROD
DEBUG: "false" DEBUG: "false"
command: api command: api
@@ -36,7 +36,7 @@ services:
poll: poll:
image: mathwave/sprint-repo:b-jokes image: mathwave/sprint-repo:b-jokes
environment: environment:
MONGO_HOST: "mongo.sprinthub.ru" MONGO_HOST: "mongo.chocomarsh.com"
MONGO_PASSWORD: $MONGO_PASSWORD_PROD MONGO_PASSWORD: $MONGO_PASSWORD_PROD
DEBUG: "false" DEBUG: "false"
command: poll command: poll
@@ -51,8 +51,9 @@ services:
bot: bot:
image: mathwave/sprint-repo:b-jokes image: mathwave/sprint-repo:b-jokes
environment: environment:
MONGO_HOST: "mongo.sprinthub.ru" MONGO_HOST: "mongo.chocomarsh.com"
MONGO_PASSWORD: $MONGO_PASSWORD_PROD MONGO_PASSWORD: $MONGO_PASSWORD_PROD
STAGE: "production"
command: bot command: bot
networks: networks:
- configurator - configurator

View File

@@ -12,5 +12,7 @@ if arg == "poll":
jokes.poll_jokes() jokes.poll_jokes()
elif arg == "api": elif arg == "api":
main.run() main.run()
elif arg == "bot":
main.bot()
else: else:
raise NotImplementedError("No arg specified!") raise NotImplementedError("No arg specified!")

View File

@@ -55,6 +55,7 @@ def bot():
text = payload.get('text') text = payload.get('text')
if not text: if not text:
return return
text = text.lower()
for word in configurator.get_config('words'): for word in configurator.get_config('words'):
if word in text: if word in text:
mes = 'Держи шутку!\n' + get_random() mes = 'Держи шутку!\n' + get_random()