Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ TEST_WA_GROUP3_ID=XXXXXXXXXXXX-1595541082@g.us
TEST_BUFFER_DELAY1=1000
TEST_BUFFER_DELAY2=1000

MONGO_INITDB_ROOT_USERNAME: user
MONGO_INITDB_ROOT_PASSWORD: superscret
MONGO_INITDB_DB_ADDRES: mongo:27017
DB_NAME: EVerdade
MONGO_INITDB_ROOT_USERNAM=user
MONGO_INITDB_ROOT_PASSWORD=superscret
MONGO_INITDB_DB_ADDRES=mongo:27017
DB_NAME=EVerdade

ME_CONFIG_MONGODB_ADMINUSERNAME: user
ME_CONFIG_MONGODB_ADMINPASSWORD: superscret
ME_CONFIG_BASICAUTH_USERNAME: user
ME_CONFIG_BASICAUTH_PASSWORD: superscretsecret
ME_CONFIG_MONGODB_ADMINUSERNAME=user
ME_CONFIG_MONGODB_ADMINPASSWORD=superscret
ME_CONFIG_BASICAUTH_USERNAME=user
ME_CONFIG_BASICAUTH_PASSWORD=superscretsecret
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
dockerfile: Dockerfile
restart: always
env_file:
- .docker.env
- .env
volumes:
- /usr/share/nginx/html/media/:/usr/src/app/Media
- /usr/share/nginx/html/msgs/:/usr/src/app/Received_msgs
Expand All @@ -22,7 +22,7 @@ services:
env_file:
- .env
volumes:
- /root/bot-e-everdade/data/:/data/db
- /root/bot-e-verdade/data/:/data/db


mongo-express:
Expand Down
3 changes: 2 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// import { create, Whatsapp } from '@open-wa/wa-automate';
require('dotenv').config()
const path = require('path')
require('dotenv').config({path: path.join(__dirname, "../.env")})
require('./helpers/general')
const wa = require('@open-wa/wa-automate');
// var CronJob = require('cron').CronJob;
Expand Down
5 changes: 2 additions & 3 deletions src/controllers/gcProcessing.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,9 @@ exports.getMediaInfo = async (md5, mimetype, dirpath = './Media') =>{
}
else{
logger.error(`Could not extrat text and tags from "${md5}.${mime.extension(mimetype)}"`)
return [null, null];
// return ['No text extracted: format not supported', {name:'unsuported_format', salience: 10, tagType:'OTHER'}];
return ['No text extracted: format not supported', {name:'unsuported_format', salience: 10, tagType:'OTHER'}];
}

logger.info(`Text and tags extracted from "${md5}.${mime.extension(mimetype)}"`)
return [text, tags];
}
}
9 changes: 5 additions & 4 deletions src/controllers/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ exports.matchMessages = async(messageDocs, createIfNull) => {

exports.processCommands = async(message,client) => {
if (message.mimetype) return;
if (!message.content.includes('#')){
await sendersController.notifyOnlyForwarded(message.sender.id, client);
return;
}
let command = message.content.match(/#{0,1}\w+/)[0].toLowerCase()

if (msgsTexts.commands.UNSUBSCRIBE_CMD.includes(command)){
Expand Down Expand Up @@ -364,8 +368,5 @@ exports.processCommands = async(message,client) => {
const devController = require('./development');
devController.saveDb()
}
else{
await sendersController.notifyOnlyForwarded(message.sender.id, client);
}

}
}
2 changes: 1 addition & 1 deletion src/helpers/general.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exports.__version__ = '0.3.0';
exports.__version__ = '0.3.1';

String.prototype.format = function() {
let a = this;
Expand Down