· 5 years ago · Mar 24, 2020, 02:44 AM
1const { BDjavascript } = require('bd.js')
2const script = new BDjavascript.API({
3 token: "",
4 prefix: ["omega", "!!", "??"],
5 accurateParsing: true
6})
7//ou have to put
8script.MessageEvent()
9
10script.Command({
11 name: "say",
12 code: "$message"
13})
14
15script.Command({
16 name: "userinfo",
17 code: `$title[info of $username] $color[83649] $description[
18 User: $username
19Id: $authorID
20Highest role: <@&$highestRole>
21Nickname: $nickname
22Roles: $userRoles
23]`
24}) //leave it with ``
25
26script.Command({
27 name: "collect",
28 code: "Say gay! $awaitMessage[$channelID;$authorID;gay;So well you are $random[0;100]% gay;10s;you didn't reply...]"
29})
30script.Command({
31 name: "members",
32 code:" $title[Member Count?] $color[ff12] $footer[wow, that's a lot of members!] $description[This server has $membersCount]"
33
34})
35script.Command({
36 name: "setmyassholeonfire",
37 code: "oof $setStatus[$message;listening]"
38})
39
40try {
41script.Command({
42 alwaysTrigger: true,
43 name: "not needed tby",
44 code: "$onlyIf[$getUserVar[exp]>$getUserVar[exp2];] $setUserVar[level;$sum[$getUserVar[level];1]] <@$authorID> you leveled up! You are now level $sum[$getUserVar[level];1] $setUserVar[exp2;$sum[$getUserVar[exp2];5]] $setUserVar[exp;0]"
45})
46} catch(e) {}
47
48//rank
49script.Command({
50 name: "rank",
51 code: "$title[$username level] $color[756bff] $description[You are level $getUserVar[level] with $round[$getUserVar[exp];0] experience!\nYou need $getUserVar[exp2] exp to level up.]"
52})
53
54
55script.Command({
56 alwaysTrigger: false,
57 name: "not needed tby",
58 code: "$deletecommand $username Please do not post codes here! $onlyIfMessageIncludes[1;2;3;4;5;6;7;8;9;0;]"
59})
60 //variables
61let Variables = BDjavascript.Variables({
62 exp: 0,
63 level: 1,
64 money: 0,
65 exp2: 5
66})
67//music
68script.Command({
69 name: "join",
70 code: "$joinVoice[$voiceID] $title[JOIN] $color[058aff] $description[I successfully joined the voice chat!]"
71})
72 script.Command({
73 name: "leave",
74 code: "$leaveVoice[$voiceID] $title[Leaving VC] $color[05ffff] $description[BYEEEEE] $footer[requested by $username]"
75})
76script.Command({
77 name: "queue",
78 code: "$title[Server queue] $color[0362fc] $description[$queue]"
79})
80script.Command({
81 name: "play",
82 code: "$playSong[$message] Now Playing! $joinVoice[$voiceID]"
83})
84
85process.on("warning", () => {})
86script.Command({
87 name: "ping",
88 code: "$pingms round trip"
89})
90
91//status
92script.Statuses({
931: { status: "with EGG.", mode: "PLAYING" },
942: { status: "LEWZ", mode: "WATCHING" }
95}, { time: 12000 })
96//help commands
97script.Command({
98 alwaysTrigger: true,
99 name: "not needed tby",
100 code: "$title[LINKS] $color[0c8526] $description[1. https://omegaboot.com/#/\n 2.http://kahoot.vautch.com/\n3. http://quizizz.omegaboot.com/\n4. https://v3.omegaboot.com/] $onlyIfMessageIncludes[link;]"
101})
102script.Command({
103 alwaysTrigger: true,
104 name: "not needed tby",
105 code: "$title[NETWORK ERROR] $color[0c8526] $description[Quick fixes:\n 1. Try a vpn\n 2. Try a incognito tab in google chrome\n 3. Clear your cache (ctrl+f5/clear cache for pc)\n 4. try another site (say links in chat).] $onlyIfMessageIncludes[network;error;]"
106})
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123// server.js
124// where your node app starts
125
126// init project
127const express = require("express");
128const bodyParser = require("body-parser");
129const app = express();
130const fs = require("fs");
131app.use(bodyParser.urlencoded({ extended: true }));
132app.use(bodyParser.json());
133
134// we've started you off with Express,
135// but feel free to use whatever libs or frameworks you'd like through `package.json`.
136
137// http://expressjs.com/en/starter/static-files.html
138app.use(express.static("public"));
139
140// init sqlite db
141const dbFile = "./.data/sqlite.db";
142const exists = fs.existsSync(dbFile);
143const sqlite3 = require("sqlite3").verbose();
144const db = new sqlite3.Database(dbFile);
145
146// if ./.data/sqlite.db does not exist, create it, otherwise print records to console
147db.serialize(() => {
148 if (!exists) {
149 db.run(
150 "CREATE TABLE Dreams (id INTEGER PRIMARY KEY AUTOINCREMENT, dream TEXT)"
151 );
152 console.log("New table Dreams created!");
153
154 // insert default dreams
155 db.serialize(() => {
156 db.run(
157 'INSERT INTO Dreams (dream) VALUES ("Find and count some sheep"), ("Climb a really tall mountain"), ("Wash the dishes")'
158 );
159 });
160 } else {
161 console.log('Database "Dreams" ready to go!');
162 db.each("SELECT * from Dreams", (err, row) => {
163 if (row) {
164 console.log(`record: ${row.dream}`);
165 }
166 });
167 }
168});
169
170// http://expressjs.com/en/starter/basic-routing.html
171app.get("/", (request, response) => {
172 response.sendFile(`${__dirname}/views/index.html`);
173});
174
175// endpoint to get all the dreams in the database
176app.get("/getDreams", (request, response) => {
177 db.all("SELECT * from Dreams", (err, rows) => {
178 response.send(JSON.stringify(rows));
179 });
180});
181
182// endpoint to add a dream to the database
183app.post("/addDream", (request, response) => {
184 console.log(`add to dreams ${request.body.dream}`);
185
186 // DISALLOW_WRITE is an ENV variable that gets reset for new projects
187 // so they can write to the database
188 if (!process.env.DISALLOW_WRITE) {
189 const cleansedDream = cleanseString(request.body.dream);
190 db.run(`INSERT INTO Dreams (dream) VALUES (?)`, cleansedDream, error => {
191 if (error) {
192 response.send({ message: "error!" });
193 } else {
194 response.send({ message: "success" });
195 }
196 });
197 }
198});
199
200// endpoint to clear dreams from the database
201app.get("/clearDreams", (request, response) => {
202 // DISALLOW_WRITE is an ENV variable that gets reset for new projects so you can write to the database
203 if (!process.env.DISALLOW_WRITE) {
204 db.each(
205 "SELECT * from Dreams",
206 (err, row) => {
207 console.log("row", row);
208 db.run(`DELETE FROM Dreams WHERE ID=?`, row.id, error => {
209 if (row) {
210 console.log(`deleted row ${row.id}`);
211 }
212 });
213 },
214 err => {
215 if (err) {
216 response.send({ message: "error!" });
217 } else {
218 response.send({ message: "success" });
219 }
220 }
221 );
222 }
223});
224
225// helper function that prevents html/css/script malice
226const cleanseString = function(string) {
227 return string.replace(/</g, "<").replace(/>/g, ">");
228};
229
230// listen for requests :)
231var listener = app.listen(process.env.PORT, () => {
232 console.log(`Your app is listening on port ${listener.address().port}`);
233})