1.0.1 • Published 2 years ago
felix.js v1.0.1
Felix is a npm package which was made for developers who want a simple, yet unique Node.js Discord API library to use.
Installing command
npm i felix.js
Getting started
You are gonna need to have Node.js. I have not tested alot of versions, but version 12 or newer is recommended.
Here is a "ping pong" message command example to get you started. (Slash commands will be added soon.)
const Felix = require('felix.js')
const client = new Felix.Client()
client.whenReady = function(){
console.log('Ready!')
}
client.whenMessage = function(message) {
if (message.content == "ping") {
message.reply('Pong!')
}
}
client.connect("TOKEN_HERE_^v^")
Threads & Text-in-Voice
Threads and Text-in-Voice are naturally supported, as both have the MESSAGE_CREATE
event. For making threads, you can use message.channel.createThread(name, options)
to make a thread NOT attached to a message. Making a thread that's attached to a message is coming soon.
Creating threads example
message.channel.createThread('thread-name', {
'type': string [thread type],
// ^^ type of thread
'auto_archive_duration?': number,
// ^^ When the thread will auto expire
})
Events
More "events" are coming soon, but for v0.1.0, the current ones are:
whenReady
whenMessage
More documentation is coming soon!
(v1.0.1 brings the message.guild
property.)