(Made with ❤️ by Yummy#0001 on Kaiheila)
Join the KaiheilaJS support by click right there.
- ☑ IntelliSens
- ☑ Built-in functions
- ☑ User
- ☑ Guild
- ☑ Member
- ☑ Message
- ☑ Reaction
- ☑ Channel
- ☑ Role
- ☑ Asset
- ☑ Client options
- ☑ skipClientTriggers
- ☑ packetCompression
- ☑ Upgrade to new Kaiheila API
- ☐ Voice channels
const Kaiheila = require('kaiheilajs'),
{ token, prefix } = require('./config.example.json'),
client = new Kaiheila.Client(token)
client.once('ready', function (sessionId) {
console.log(`Client is connected ! Session ID : ${sessionId}`)
})
client.on('message', async function (message) {
const args = message.content.split(/ +/),
command = args.shift().toLowerCase()
if (command === `${prefix}help`) {
const commands = [
{ name: `${prefix}help`, value: 'shows commands list.' },
{
name: `${prefix}ping`,
value: "get a 'Pong !' from the bot.",
},
],
card = new Kaiheila.Card()
.addHeader('Help :')
.addDivider()
.setColor('#e5a7b6')
.addRowFields(commands, true)
.setAuthor(message.extra.author.username, {
src: message.extra.author.avatar,
size: 'sm',
side: 'left',
circle: true,
})
await client.managers.message.create(message.target_id, card)
}
})
client.login()