botpot
v0.1.0
Published
Bot Toolkit for Slack and Discord Bots
Downloads
5
Readme
botpot
Use botpot in your nodejs app to create and host Discord and Slack bots
Installation
Run npm install botpot
Usage
Currently botpot accepts only postgresql connections.
Get the router and use it app.use('/slack', botpot.getRouter());
Set the database connection botpot.setConn(process.env.DATABASE_URL);
Set your Discord Token botpot.setDiscordToken(process.env.DISCORD_TOKEN);
Create SlackRoutes const general = botpot.createSlackRoute('action-endpoint', 'animGif-endpoint');
Set the SlackBot Token general.setToken(process.env.SLACK_TOKEN);
Create your BotEventsgeneral.createBotEvent({
triggerString: 'Hello There',
responseString: 'General Kenobi',
reaction: undefined,
gifResponse: 'https://lh3.googleusercontent.com/-xv1hKxae6hE/WJvjnHjKuEI/AAAAAAAABvE/kZTbR_iH9iEewYpFeWfd2UpeEGB6tS-RACJoC/w500-h150/general.gif',
followUp: 'Your Move',
isFollowUp: false,
});
general.createBotEvent({
triggerString: 'Your Move',
responseString: 'You Fool! I have been trained in your jedi arts by Count Dooku.',
reaction: 'rage',
gifResponse: undefined,
followUp: undefined,
isFollowUp: true,
});
Credits
Credit and a big thanks to FrankMazarella