Browse Source

fix tz in container

master
david 2 years ago
parent
commit
f86ea3a7b2
  1. 3
      Dockerfile
  2. 13
      index.js
  3. 1
      swarm/docker-compose.blenderbot.yml

3
Dockerfile

@ -1,5 +1,6 @@
FROM node:17.3-alpine3.12
WORKDIR /app
COPY index.js package* ./
RUN npm install
RUN apk add --no-cache tzdata; \
npm install
CMD ["node", "index.js"]

13
index.js

@ -214,9 +214,20 @@ bot.on('message', (event) => {
}`
);
if (msg === '!gmbcount')
if (msg.indexOf('!gmbcount') === 0)
event.reply(`${user.userNick} has sent ${user.gmbCount} gmbs today`);
if (msg.indexOf('!resetgmbs') === 0) {
userList = userList.map((user) =>
user.gmbCount > 0 ? { ...user, gmbCount: 0 } : user
);
event.reply('gmbs have been reset');
}
if (msg.indexOf('!cmds') === 0) {
event.reply('!alert, !gmbcount, !msgcount, !resetgmbs');
}
// msgs that only care about matching exactly the string
if (msg === 'gmb') {

1
swarm/docker-compose.blenderbot.yml

@ -14,6 +14,7 @@ services:
CHANNEL: ${CHANNEL? Variable not set}
BAE: ${BAE? Variable not set}
NOTICE_MSG: ${NOTICE_MSG? Variable not set}
TZ: ${TZ? Variable not set}
deploy:
restart_policy:
condition: on-failure

Loading…
Cancel
Save