You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 22, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+39-4Lines changed: 39 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
## Features
8
8
- Easy and fast to use.
9
9
- Short code.
10
-
-Currently has more than 40+ Functions ready to use and Still will continue to add more functions!
10
+
-In this version has more than 55+ Functions ready to use and Still will continue to add more functions!
11
11
12
12
## Instalation
13
13
@@ -26,24 +26,59 @@ npm i github:JastinXyz/whatscode.js
26
26
```js
27
27
const { Client } =require("whatscode.js");
28
28
29
-
// all Client options in docs!
29
+
// all Client options in the docs!
30
30
constbot=newClient({
31
31
name:"Your bot name",
32
32
prefix:"Your bot prefix",
33
33
});
34
34
35
-
// required callback
35
+
// required callback (all callbacks available in the docs)
36
36
bot.onConnectionUpdate(); // connection update
37
37
bot.onCredsUpdate(); // credentials update
38
38
bot.onMessage(); // message update
39
39
40
-
// ping command
40
+
//example ping command
41
41
bot.command({
42
42
name:"ping",
43
43
code:`🏓 | $ping ms`
44
44
});
45
45
```
46
46
47
+
## Callbacks
48
+
[Callbacks](https://whatscode.jstnlt.my.id/references/callbacks) can be used to run events, sort of logging and the like. There are several callbacks that are needed when creating a bot with **whatscode.js**. But there are still some other callbacks that you can use. You can find it in the [Docs](https://whatscode.jstnlt.my.id)!
49
+
50
+
```js
51
+
// here are examples of callbacks for user join and user leave.
52
+
// it can be used like Welcomer or Goodbye.
53
+
54
+
// callback
55
+
bot.onUserJoin()
56
+
bot.onUserLeave()
57
+
58
+
// code breakdown is in the docs...
59
+
// This command will run when someone joins the group
60
+
bot.userJoinCommand({
61
+
groupJid:'123@g.us',
62
+
code:`hello {user}, welcome to {group}`
63
+
})
64
+
65
+
// This will run when a user leaves the group.
66
+
bot.userLeaveCommand({
67
+
groupJid:'123@g.us',
68
+
code:`goodbye {user} from {group}`
69
+
})
70
+
```
71
+
72
+
## Variables
73
+
[Variables](https://whatscode.jstnlt.my.id/references/guides/variables) can be used to store data, you can also use this for like system economics, leveling and others.
0 commit comments