So im trying to make command which uses express post to get live statues and when status is something it should send message and mention the member who used the command and tell the status, but in example if two member used it same time it mentions two times the last member who used the command. So how can i make it to mention both members?
if(command === "test") {
var user = message.author.username;
twilio.calls.create({
url: `${config.ngrok}/call`,
to: number,
from: from,
statusCallback: `${config.ngrok}/status`,
statusCallbackMethod: 'POST',
statusCallbackEvent: ['initiated', 'ringing', 'answered', 'completed'],
})
app.post('/status', (req, res) => {
var status = req.body.CallStatus;
message.channel.send(`Status: ${status}, ${user}`)
})
}
I've made a few assumptions because you haven't shared any code but something along these lines should work:
client.on('messageCreate', message => {
if (message.content != '.test') { return }
message.channel.send('Mention ' + message.author.username)
})