Wallu - Developer API
Wallubot provides an easy-to-use API for developers to integrate Wallu into other platforms and projects.
Creating an Addon
- Go to the addons page and create a new API key
- Use the API key in your addon to send messages to Wallu
- The API is designed to be simple and easy to use
- Easy to add Wallu to any other platform and will work just like the Discord bot
Documentation
Example Usage
Node.js
const axios = require('axios')
// or import axios from 'axios'
const API_URL = 'https://api.wallubot.com/v1'
async function showExample() {
const response = await axios.post(`${API_URL}/on-message`, {
addon: {
name: 'my-addon',
version: '0.1.0',
},
channel: {
// You can generate one, for example, using the current group chat name/ID or generate a random one. The bot may use this to keep track of previous messages.
id: '123456789',
// For example, in the Wallu Telegram addon this is the group chat name
name: 'Addon Channel #1'
},
user: {
// Some kind of identifier for this user. The bot may use this to keep track of previous messages.
id: '123456789',
// The username of the user (the bot may use this to personalize the response)
username: 'John Doe',
// Whether the user is a staff member. You can also just leave this false. (This mainly just affects some settings like the "avoid answering staff members unless mentioned")
is_staff_member: false,
},
message: {
// ID of the message, or just generate a random ID for this.
id: '123456789',
// If true, the bot is forced to answer, otherwise it may not answer.
is_bot_mentioned: true,
// The message content
content: 'how do I reset my password??'
},
configuration: {
// The emoji type to use. If set to 'none', the bot will not use any emojis.
emoji_type: 'unicode',
// Whether to include the sources links in the response.
include_sources: false,
}
}, {
headers: {
// You would use your own key here (or from env var)
// It's recommended to use a different key for each addon
// Find your API key here: https://panel.wallubot.com/addons
"X-API-Key": process.env.WALLU_API_KEY,
}
})
console.log(response.data)
// {
// response: {
// message: 'Click "forgot my password" on the login page. For more information, you can visit the following link: <https://example.com>.'
// }
// }
}
showExample().then(() => console.log("DONE!"))
Example Projects
- wallu-telegram - Enables Wallu to answer questions on Telegram group chats (just like on Discord).
- wallu-spigot - Enables Wallu to answer questions on a Minecraft server.