botkit: Duplicate message when using replyPublic.
I’ve been using botkit for a while now but only in the replyPrivate method, i’m in the process of adding in another Slash Command to the bot where the response is public but i’m running into an issue where the message is duplicated: the original message and then the response.
Is there a way to prevent the user input from showing up in Slack when using replyPublic like replyPrivate does?
Here’s what i’m working with:
controller.on('slash_command', function (slashCommand, message) {
switch (message.command) {
case '/links':
if (message.token !== process.env.SLACK_TOKEN) return;
var incomingLink = message.text,
outgoingLink = incomingLink.replace(/\s/g, '%20');
slashCommand.replyPublic(message, outgoingLink);
break;
default:
slashCommand.replyPrivate(message, "I'm afraid I don't know how to " + message.command + " yet.");
}
});
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 21
@robbawebba i have. This is what i’m currently running:
The message still sends but i get the timeout error on the first message. and every message i send re-appears in the input box as if it hasn’t sent.