Skip to content
Permalink
df5288289f
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
18 lines (15 sloc) 624 Bytes
function sendMsg(name, transcription, metadata = '') {
if (name.length < 1 || transcription.length < 1)
return;
const config = require('./config.json');
const { client, pubnub } = require("./index");
//const logChannel = client.channels.cache.get(config.logChannelID);
const newMsg = `${name}|${new Date().toLocaleDateString()}|${new Date().toLocaleTimeString()}|${transcription}|${metadata}`;
pubnub.publish({
message: newMsg,
channel: 'main'
});
// Send the message to the log channel on the server
//logChannel.send(newMsg);
}
exports.sendMsg = sendMsg;