AkitaTS - Imagine easy bots
Fast, easy and string based with BDFD syntax
// import { AkitaClient } from "akita.ts";
var { AkitaClient } = require("akita.ts")
var client = new AkitaClient({
intents: [1, 2, 512, 32768] /* example discord intents */
}, "BOT_PREFIX")
client.onMessageCreate()
client.addCommand({
names: ["test"],
type: "MESSAGE",
code: `
$setContent[Hi $author[username]!]
$send[no]
`
})
client.login("YOUR_BOT_TOKEN")
support server
documentation
Custom Functions
// import { FunctionBuilder } from "akita.ts";
client.interpreter.addFunction({
data: new FunctionBuilder()
.setName('THE FUNCTION NAME WITHOUT $') // "myFunc"
.setValue('description', 'THE FUNCTION DESCRIPTION') // "makes something"
.setValue('use', 'AN EXAMPLE OF USE') // "$myFunc[arg1;arg2;...rest]"
.setValue('returns', 'TYPE'), // "String"
code: async function (/* this: That */) => {
// This will allow the inside of $myFunc to be executed!
// await this.resolveFields()
// This execute an especific field of $myFunc
// await this.resolveFields(index, end?)
return this.makeReturn(/* result value here */)
}
});