Gathering detailed insights and metrics for cura-app.js
Gathering detailed insights and metrics for cura-app.js
Gathering detailed insights and metrics for cura-app.js
Gathering detailed insights and metrics for cura-app.js
npm install cura-app.js
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
The official api wrapper for cura-app.tk
Before logging in do client.socketUrl = "wss://example.com"
In the case of use with the official cura-app.tk this is not required!
This is required to login to the client
1let Cura = require("cura-app.js"); 2let client = new Cura(); 3 4client.login("xb:------------");
This is used for the internal command handler, easy for beginners.
1 client.command({ //!ping returns Pong! 2 name: "ping", 3 message: "Pong!" 4}) 5 6client.command({ 7 name: "echo", 8 run: (message, args) => { //Run functions using run you can get message object and args 9 message.startTyping(); //Start typing 10 message.reply(args.join(" ")); //Reply with all arguments 11 } 12})
Send a message to a channel
1client.send("Hello there", "e8ef0db5-bdf6-4624-b22b-7b85928bfcec", "fee5fceb-f7fd-42bf-96e8-dc8daefa6fa2")
Start typing.
1 client.typeStart("e8ef0db5-bdf6-4624-b22b-7b85928bfcec", "fee5fceb-f7fd-42bf-96e8-dc8daefa6fa2");
Start typing.
1 client.typeStop("e8ef0db5-bdf6-4624-b22b-7b85928bfcec", "fee5fceb-f7fd-42bf-96e8-dc8daefa6fa2");
When the bot is ready and connected to ws.
client.on("ready", (raw)=>{})
(returns raw data)
When you recieve a message in a guild
client.on("message", (MessageObject)=>{})
(returns MessageObject)
When someone starts typing
client.on("typingStart", (data)=>{data.username})
(returns username)
Do note that you will have to handle if no typing event for 5 seconds stop typing, this event also gets sent every keystroke
When someone stops typing
client.on("typingStop", (data)=>{data.username})
(returns username)
{
id: 'messageId',
guild: boolean,
guildObject: guildObject,
channel: channelObject,
author: userObject,
content: 'messageContent',
str: null,
html: 'messageHtml',
member: userObject,
bot: boolean,
startTyping: MessageObject.stopTyping(),
stopTyping: MessageObject.startTyping(),
reply: MessageObject.reply(content)
}
{
id: 'guildId',
name: 'guildName'
}
{
id: 'userId',
username: 'userName',
badges: { mod: boolean, bot: { is: boolean, verified: boolean } },
bot: boolean
}
{
name: 'channelName',
id: 'channelId'
}
A variable with all dm's/guilds
[GuildID, GuildID]
The client's token
xb:-------
URL of socket to connect to
wss://cura-app.tk
Prefix for internal command handler
!
Is the client ready
boolean
1let Cura = require("cura-app.js"); 2let client = new Cura(); 3 4client.on("ready", (data) => { 5 console.log("Your bot is now online!"); 6}) 7 8client.command({ 9 name: "echo", 10 run: (message, args) => { 11 message.startTyping(); 12 message.reply(args.join(" ")); 13 } 14}) 15 16client.login(``);
No vulnerabilities found.
No security vulnerabilities found.