Permalink
Cannot retrieve contributors at this time
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?
DCC-Server/sendMsg.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
18 lines (15 sloc)
624 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |