How to use sender method in wpt

Best JavaScript code snippet using wpt

shop.js

Source:shop.js Github

copy

Full Screen

1const potion = 200002const Spotion = 100 3const Bdiamond = 1000004const Sdiamond = 10005const Bcommon = 1000006const Scommon = 10007const Suncommon = 1008const Buncommon = 1000009const Bmythic = 10000010const Smythic = 100011const Blegendary = 20000012const Slegendary = 500013const Bsampah = 12014const Ssampah = 515const Bkayu = 100016const Skayu = 40017const Bbotol = 30018const Sbotol = 5019const Bkaleng = 40020const Skaleng = 10021const Bkardus = 40022const Skardus = 5023const Bpisang = 550024const Spisang = 10025const Bmangga = 460026const Smangga = 15027const Bjeruk = 600028const Sjeruk = 30029const Banggur = 550030const Sanggur = 15031const Bapel = 550032const Sapel = 40033const Bbibitpisang = 55034const Sbibitpisang = 5035const Bbibitmangga = 55036const Sbibitmangga = 5037const Bbibitjeruk = 55038const Sbibitjeruk = 5039const Bbibitanggur = 55040const Sbibitanggur = 5041const Bbibitapel = 55042const Sbibitapel = 5043const Bgardenboxs = 6500044const Sgardenboc = 35000045const Bberlian = 15000046const Sberlian = 1000047const Bemasbatang = 25000048const Semasbatang = 1000049const Bemasbiasa = 15000050const Semasbiasa = 1500051const Bphonix = 100000000052const Sphonix = 100000053const Bgriffin = 10000000054const Sgriffin = 10000055const Bkyubi = 10000000056const Skyubi = 10000057const Bnaga = 10000000058const Snaga = 10000059const Bcentaur = 10000000060const Scentaur = 10000061const Bkuda = 5000000062const Skuda = 10000063const Brubah = 10000000064const Srubah = 10000065const Bkucing = 500000066const Skucing = 5000067const Bserigala = 5000000068const Sserigala = 50000069const Bmakananpet = 5000070const Smakananpet = 50071const Bmakananphonix = 8000072const Smakananphonix = 500073const Bmakanangriffin = 8000074const Smakanangriffin = 500075const Bmakanannaga = 15000076const Smakanannaga = 1000077const Bmakanankyubi = 15000078const Smakanankyubi = 1000079const Bmakanancentaur = 15000080const Smakanancentaur = 1000081const Bhealtmonster = 2000082const Bpet = 15000083const Spet = 100084const Blimit = 2500085const Slimit = 2000086const Bexp = 55087const Baqua = 500088const Saqua = 100089const Biron = 2000090const Siron = 500091const Bstring = 5000092const Sstring = 500093const Bsword = 15000094const Ssword = 1500095const Bumpan = 150096const Sumpan = 10097const Bpancingan = 500000098const Spancingan = 50000099const Bbatu = 500100const Sbatu = 100101const Bketake = 15102const Btiketcoin = 500103const Bkoinexpg = 500000104const Beleksirb = 500105let handler = async (m, { conn, command, args, usedPrefix, owner }) => {106 const _armor = global.db.data.users[m.sender].armor107 const armor = (_armor == 0 ? 20000 : '' || _armor == 1 ? 49999 : '' || _armor == 2 ? 99999 : '' || _armor == 3 ? 149999 : '' || _armor == 4 ? 299999 : '')108 let type = (args[0] || '').toLowerCase()109 let _type = (args[1] || '').toLowerCase()110 let jualbeli = (args[0] || '').toLowerCase()111 let nomors = m.sender112 const Kchat = `113Penggunaan ${usedPrefix}shop <Buy|sell> <item> <jumlah>114Contoh penggunaan: *${usedPrefix}shop buy potion 1*115============================116*Kebutuhan | Harga Beli*117Limit: ${Blimit}118TiketM: ${Bhealtmonster}119Cupon: ${Btiketcoin}120KoinExpg: ${Bkoinexpg}121*Kebutuhan | Harga Jual*122Limit: ${Slimit}123============================124*Bibit Buah | Harga Beli*125BibitPisang: ${Bbibitpisang}126BibitAnggur: ${Bbibitanggur}127BibitMangga: ${Bbibitmangga}128BibitJeruk: ${Bbibitjeruk}129BibitApel: ${Bbibitapel}130Gardenboxs: ${Bgardenboxs}131============================132*Barang | Harga Beli*133Potion: ${potion}134Diamond: ${Bdiamond}135Common: ${Bcommon}136Uncommon: ${Buncommon}137Mythic: ${Bmythic}138Legendary: ${Blegendary}139Sampah: ${Bsampah}140Armor: ${armor}141String: ${Bstring}142Iron: ${Biron}143Sword: ${Bsword}144Batu: ${Bbatu}145Botol: ${Bbotol}146Kaleng: ${Bkaleng}147Kardus: ${Bkardus}148Kayu: ${Bkayu}149Berlian: ${Bberlian}150Emas: ${Bemasbiasa}151*Barang | Harga Jual*152Potion: ${Spotion}153Diamond: ${Sdiamond}154Common: ${Scommon}155Uncommon: ${Suncommon}156Mythic: ${Smythic}157Legendary: ${Slegendary}158Sampah: ${Ssampah}159String: ${Sstring}160Iron: ${Siron}161Sword: ${Ssword}162Batu: ${Sbatu}163Botol: ${Sbotol}164Kaleng: ${Skaleng}165Kardus: ${Skardus}166Kayu: ${Skayu}167Berlian: ${Sberlian}168Emas: ${Semasbiasa}169============================170*List Makanan:*171*Makanan | Harga Beli*172Pisang: ${Bpisang}173Anggur: ${Banggur}174Mangga: ${Bmangga}175Jeruk: ${Bjeruk}176Apel: ${Bapel}177MakananPet: ${Bmakananpet}178MakananNaga: ${Bmakanannaga}179MakananKyubi: ${Bmakanankyubi}180MakananGriffin: ${Bmakanangriffin}181MakananPhonix: ${Bmakananphonix}182MakananCentaur: ${Bmakanancentaur}183*Makanan | Harga Jual*184Pisang: ${Spisang}185Anggur: ${Sanggur}186Mangga: ${Smangga}187Jeruk: ${Sjeruk}188Apel: ${Sapel}189MakananPet: ${Smakananpet}190MakananNaga ${Smakanannaga}191MakananKyubi: ${Smakanankyubi}192MakananGriffin: ${Smakanangriffin}193MakananPhonix: ${Smakananphonix}194MakananCentaur: ${Smakanancentaur}195============================196*Minuman | Harga Beli*197Aqua: ${Baqua}198*Minuman | Harga Jual*199Aqua: ${Saqua}200============================201*Fishing | Harga Beli*202Pancingan: ${Bpancingan}203Umpan: ${Bumpan}204`.trim()205 try {206 if (/shop|toko/i.test(command)) {207 const count = args[2] && args[2].length > 0 ? Math.min(999999999999999, Math.max(parseInt(args[2]), 1)) : !args[2] || args.length < 4 ? 1 :Math.min(1, count)208 const sampah = global.db.data.users[m.sender].sampah209 switch (jualbeli) {210 case 'buy':211 switch (_type) {212 case 'potion':213 if (global.db.data.users[m.sender].money >= potion * count) {214 global.db.data.users[m.sender].money -= potion * count215 global.db.data.users[m.sender].potion += count * 1216 conn.reply(m.chat, `Succes membeli ${count} Potion dengan harga ${potion * count} money\n\nGunakan potion dengan ketik: *${usedPrefix}use potion <jumlah>*`, m)217 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Potion dengan harga ${potion * count} money`,)218 break219 case 'diamond':220 if (global.db.data.users[m.sender].money >= Bdiamond * count) {221 global.db.data.users[m.sender].diamond += count * 1222 global.db.data.users[m.sender].money -= Bdiamond * count223 conn.reply(m.chat, `Succes membeli ${count} Diamond dengan harga ${Bdiamond * count} money`, m)224 } else conn.reply(m.chat, `Money anda tidak cukup`, m)225 226 break227 case 'common':228 if (global.db.data.users[m.sender].money >= Bcommon * count) {229 global.db.data.users[m.sender].common += count * 1230 global.db.data.users[m.sender].money -= Bcommon * count231 conn.reply(m.chat, `Succes membeli ${count} Common crate dengan harga ${Bcommon * count} money`, m)232 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Common crate dengan harga ${Bcommon * count} money\n\nBuka crate dengan ketik: *${usedPrefix}open common*`, m)233 234 break235 case 'uncommon':236 if (global.db.data.users[m.sender].money >= Buncommon * count) {237 global.db.data.users[m.sender].uncommon += count * 1238 global.db.data.users[m.sender].money -= Buncommon * count239 conn.reply(m.chat, `Succes membeli ${count} Uncommon crate dengan harga ${Buncommon * count} money`, m)240 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Uncommon crate dengan harga ${Buncommon * count} money\n\nBuka crate dengan ketik: *${usedPrefix}open uncommon*`, m)241 242 break243 case 'mythic':244 if (global.db.data.users[m.sender].money >= Bmythic * count) {245 global.db.data.users[m.sender].mythic += count * 1246 global.db.data.users[m.sender].money -= Bmythic * count247 conn.reply(m.chat, `Succes membeli ${count} Mythic crate dengan harga ${Bmythic * count} money`, m)248 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Mythic crate dengan harga ${Bmythic* count} money\n\nBuka crate dengan ketik: *${usedPrefix}open mythic*`, m)249 250 break251 case 'legendary':252 if (global.db.data.users[m.sender].money >= Blegendary * count) {253 global.db.data.users[m.sender].legendary += count * 1254 global.db.data.users[m.sender].money -= Blegendary * count255 conn.reply(m.chat, `Succes membeli ${count} Legendary crate dengan harga ${Blegendary * count} money`, m)256 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Legendary crate dengan harga ${Blegendary * count} money\n\nBuka crate dengan ketik: *${usedPrefix}open legendary*`, m)257 258 break259 case 'sampah':260 if (global.db.data.users[m.sender].money >= Bsampah * count) {261 global.db.data.users[m.sender].sampah += count * 1262 global.db.data.users[m.sender].money -= Bsampah * count263 conn.reply(m.chat, `Succes membeli ${count} Sampah dengan harga ${Bsampah * count} money`, m)264 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Sampah dengan harga ${Bsampah * count} money`.trim(), m)265 266 break267 case 'kaleng':268 if (global.db.data.users[m.sender].money >= Bkaleng * count) {269 global.db.data.users[m.sender].kaleng += count * 1270 global.db.data.users[m.sender].money -= Bkaleng * count271 conn.reply(m.chat, `Succes membeli ${count} Kaleng dengan harga ${Bkaleng * count} money`, m)272 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Kaleng dengan harga ${Bkaleng * count} money`.trim(), m)273 274 break275 case 'kardus':276 if (global.db.data.users[m.sender].money >= Bkardus * count) {277 global.db.data.users[m.sender].kardus += count * 1278 global.db.data.users[m.sender].money -= Bkardus * count279 conn.reply(m.chat, `Succes membeli ${count} Kardus dengan harga ${Bkardus * count} money`, m)280 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Kardus dengan harga ${Bkardus * count} money`.trim(), m)281 282 break283 case 'botol':284 if (global.db.data.users[m.sender].money >= Bbotol * count) {285 global.db.data.users[m.sender].botol += count * 1286 global.db.data.users[m.sender].money -= Bbotol * count287 conn.reply(m.chat, `Succes membeli ${count} Botol dengan harga ${Bbotol * count} money`, m)288 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} botol dengan harga ${Bbotol * count} money`.trim(), m)289 290 break291 case 'kayu':292 if (global.db.data.users[m.sender].money >= Bkayu * count) {293 global.db.data.users[m.sender].kayu += count * 1294 global.db.data.users[m.sender].money -= Bkayu * count295 conn.reply(m.chat, `Succes membeli ${count} Kayu dengan harga ${Bkayu * count} money`, m)296 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} kayu dengan harga ${Bkayu * count} money`.trim(), m)297 298 break299 case 'pisang':300 if (global.db.data.users[m.sender].money >= Bpisang * count) {301 global.db.data.users[m.sender].pisang += count * 1302 global.db.data.users[m.sender].money -= Bpisang * count303 conn.reply(m.chat, `Succes membeli ${count} Pisang dengan harga ${Bpisang * count} money`, m)304 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} pisang dengan harga ${Bpisang * count} money`.trim(), m)305 306 break307 case 'anggur':308 if (global.db.data.users[m.sender].money >= Banggur * count) {309 global.db.data.users[m.sender].anggur += count * 1310 global.db.data.users[m.sender].money -= Banggur * count311 conn.reply(m.chat, `Succes membeli ${count} Anggur dengan harga ${Banggur * count} money`, m)312 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} anggur dengan harga ${Banggur * count} money`.trim(), m)313 314 break315 case 'mangga':316 if (global.db.data.users[m.sender].money >= Bmangga * count) {317 global.db.data.users[m.sender].mangga += count * 1318 global.db.data.users[m.sender].money -= Bmangga * count319 conn.reply(m.chat, `Succes membeli ${count} Mangga dengan harga ${Bmangga * count} money`, m)320 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} mangga dengan harga ${Bmangga * count} money`.trim(), m)321 322 break323 case 'jeruk':324 if (global.db.data.users[m.sender].money >= Bjeruk * count) {325 global.db.data.users[m.sender].jeruk += count * 1326 global.db.data.users[m.sender].money -= Bjeruk * count327 conn.reply(m.chat, `Succes membeli ${count} Jeruk dengan harga ${Bjeruk * count} money`, m)328 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} jeruk dengan harga ${Bjeruk * count} money`.trim(), m)329 330 break331 case 'apel':332 if (global.db.data.users[m.sender].money >= Bapel * count) {333 global.db.data.users[m.sender].apel += count * 1334 global.db.data.users[m.sender].money -= Bapel * count335 conn.reply(m.chat, `Succes membeli ${count} Apel dengan harga ${Bapel * count} money`, m)336 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} apel dengan harga ${Bapel * count} money`.trim(), m)337 338 break339 case 'bibitpisang':340 if (global.db.data.users[m.sender].money >= Bbibitpisang * count) {341 global.db.data.users[m.sender].bibitpisang += count * 1342 global.db.data.users[m.sender].money -= Bbibitpisang * count343 conn.reply(m.chat, `Succes membeli ${count} Bibit Pisang dengan harga ${Bbibitpisang * count} money`, m)344 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} bibit pisang dengan harga ${Bbibitpisang * count} money`.trim(), m)345 346 break347 case 'bibitanggur':348 if (global.db.data.users[m.sender].money >= Bbibitanggur * count) {349 global.db.data.users[m.sender].bibitanggur += count * 1350 global.db.data.users[m.sender].money -= Bbibitanggur * count351 conn.reply(m.chat, `Succes membeli ${count} Bibit Anggur dengan harga ${Bbibitanggur * count} money`, m)352 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} bibit anggur dengan harga ${Bbibitanggur * count} money`.trim(), m)353 354 break355 case 'bibitmangga':356 if (global.db.data.users[m.sender].money >= Bbibitmangga * count) {357 global.db.data.users[m.sender].bibitmangga += count * 1358 global.db.data.users[m.sender].money -= Bbibitmangga * count359 conn.reply(m.chat, `Succes membeli ${count} Bibit Mangga dengan harga ${Bbibitmangga * count} money`, m)360 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} bibit mangga dengan harga ${Bbibitmangga * count} money`.trim(), m)361 362 break363 case 'bibitjeruk':364 if (global.db.data.users[m.sender].money >= Bbibitjeruk * count) {365 global.db.data.users[m.sender].bibitjeruk += count * 1366 global.db.data.users[m.sender].money -= Bbibitjeruk * count367 conn.reply(m.chat, `Succes membeli ${count} Bibit Jeruk dengan harga ${Bbibitjeruk * count} money`, m)368 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} bibit jeruk dengan harga ${Bbibitjeruk * count} money`.trim(), m)369 370 break371 case 'bibitapel':372 if (global.db.data.users[m.sender].money >= Bbibitapel * count) {373 global.db.data.users[m.sender].bibitapel += count * 1374 global.db.data.users[m.sender].money -= Bbibitapel * count375 conn.reply(m.chat, `Succes membeli ${count} Bibit Apel dengan harga ${Bbibitapel * count} money`, m)376 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} bibit apel dengan harga ${Bbibitapel * count} money`.trim(), m)377 378 break 379 case 'gardenboxs':380 if (global.db.data.users[m.sender].money >= Bgardenboxs * count) {381 global.db.data.users[m.sender].gardenboxs += count * 1382 global.db.data.users[m.sender].money -= Bgardenboxs * count383 conn.reply(m.chat, `Succes membeli ${count} Gardenboxs dengan harga ${Bgardenboxs * count} money`, m)384 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} gardenboxs dengan harga ${Bgardenboxs * count} money`.trim(), m)385 386 break387 case 'berlian':388 if (global.db.data.users[m.sender].money >= Bberlian * count) {389 global.db.data.users[m.sender].berlian += count * 1390 global.db.data.users[m.sender].money -= Bberlian * count391 conn.reply(m.chat, `Succes membeli ${count} Berlian dengan harga ${Bberlian * count} money`, m)392 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} berlian dengan harga ${Bberlian * count} money`.trim(), m)393 394 break395 case 'emas':396 if (global.db.data.users[m.sender].money >= Bemasbiasa * count) {397 global.db.data.users[m.sender].emas += count * 1398 global.db.data.users[m.sender].money -= Bemasbiasa * count399 conn.reply(m.chat, `Succes membeli ${count} Emas dengan harga ${Bemasbiasa * count} money`, m)400 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} emas dengan harga ${Bemasbiasa * count} money`.trim(), m)401 402 break 403 case 'pet':404 if (global.db.data.users[m.sender].money >= Bpet * count) {405 global.db.data.users[m.sender].pet += count * 1406 global.db.data.users[m.sender].money -= Bpet * count407 conn.reply(m.chat, `Succes membeli ${count} Pet Random dengan harga ${Bpet * count} money`, m)408 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} pet random dengan harga ${Bpet * count} money`.trim(), m)409 410 break411 case 'limit':412 if (global.db.data.users[m.sender].money >= Blimit * count) {413 global.db.data.users[m.sender].limit += count * 1414 global.db.data.users[m.sender].money -= Blimit * count415 conn.reply(m.chat, `Succes membeli ${count} Limit dengan harga ${Blimit * count} money`, m)416 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} limit dengan harga ${Blimit * count} money`.trim(), m)417 418 break 419 /*case 'exp':420 if (global.db.data.users[m.sender].money >= Bexp * count) {421 global.db.data.users[m.sender].exp += count * 1422 global.db.data.users[m.sender].money -= Bexp * count423 conn.reply(m.chat, `Succes membeli ${count} Exp dengan harga ${Bexp * count} money`, m)424 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} exp dengan harga ${Bexp * count} money`.trim(), m)425 426 break427 case 'eleksirb':428 if (global.db.data.users[m.sender].money >= Beleksirb * count) {429 global.db.data.users[m.sender].eleksirb += count * 1430 global.db.data.users[m.sender].money -= Beleksirb * count431 conn.reply(m.chat, `Succes membeli ${count} Eleksir Biru dengan harga ${Beleksirb * count} money`, m)432 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Eleksir Biru dengan harga ${Beleksirb * count} money`.trim(), m)433 434 break435 case 'koinexpg':436 if (global.db.data.users[m.sender].money >= Bkoinexpg * count) {437 global.db.data.users[m.sender].koinexpg += count * 1438 global.db.data.users[m.sender].money -= Bkoinexpg * count439 conn.reply(m.chat, `Succes membeli ${count} Koinexpg dengan harga ${Bkoinexpg * count} money`, m)440 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} koinexpg dengan harga ${Bkoinexpg * count} money`.trim(), m)441 442 break*/443 case 'cupon':444 if (global.db.data.users[m.sender].tiketcoin >= Btiketcoin * count) {445 global.db.data.users[m.sender].cupon += count * 1446 global.db.data.users[m.sender].tiketcoin -= Btiketcoin * count447 conn.reply(m.chat, `Succes membeli ${count} cupon dengan harga ${Btiketcoin * count} Tiketcoin`, m)448 } else conn.reply(m.chat, `Tiketcoin anda tidak cukup untuk membeli ${count} cupon dengan harga ${Btiketcoin * count} Tiketcoin\n\nCara mendapatkan tiketcoin, anda harus memainkan semua fitur game..`.trim(), m)449 450 break 451 case 'makananpet':452 if (global.db.data.users[m.sender].money >= Bmakananpet * count) {453 global.db.data.users[m.sender].makananpet += count * 1454 global.db.data.users[m.sender].money -= Bmakananpet * count455 conn.reply(m.chat, `Succes membeli ${count} Makanan Pet dengan harga ${Bmakananpet * count} money`, m)456 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} makanan pet dengan harga ${Bmakananpet * count} money`.trim(), m)457 458 break 459 case 'makanannaga':460 if (global.db.data.users[m.sender].money >= Bmakanannaga * count) {461 global.db.data.users[m.sender].makanannaga += count * 1462 global.db.data.users[m.sender].money -= Bmakanannaga * count463 conn.reply(m.chat, `Succes membeli ${count} Makanan Naga dengan harga ${Bmakanannaga * count} money`, m)464 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} makanan naga dengan harga ${Bmakanannaga * count} money`.trim(), m)465 466 break 467 case 'makananphonix':468 if (global.db.data.users[m.sender].money >= Bmakananphonix * count) {469 global.db.data.users[m.sender].makananphonix += count * 1470 global.db.data.users[m.sender].money -= Bmakananphonix * count471 conn.reply(m.chat, `Succes membeli ${count} Makanan Phonix dengan harga ${Bmakananphonix * count} money`, m)472 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} makanan phonix dengan harga ${Bmakananphonix * count} money`.trim(), m)473 474 break 475 case 'makanankyubi':476 if (global.db.data.users[m.sender].money >= Bmakanankyubi * count) {477 global.db.data.users[m.sender].makanankyubi += count * 1478 global.db.data.users[m.sender].money -= Bmakanankyubi* count479 conn.reply(m.chat, `Succes membeli ${count} Makanan Kyubi dengan harga ${Bmakanankyubi * count} money`, m)480 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} makanan kyubi dengan harga ${Bmakanankyubi * count} money`.trim(), m)481 482 break 483 case 'makanangriffin':484 if (global.db.data.users[m.sender].money >= Bmakanangriffin * count) {485 global.db.data.users[m.sender].makanangriffin += count * 1486 global.db.data.users[m.sender].money -= Bmakanangriffin * count487 conn.reply(m.chat, `Succes membeli ${count} Makanan Griffin dengan harga ${Bmakanangriffin * count} money`, m)488 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} makanan griffin dengan harga ${Bmakanangriffin * count} money`.trim(), m)489 490 break 491 case 'makanancentaur':492 if (global.db.data.users[m.sender].money >= Bmakanancentaur * count) {493 global.db.data.users[m.sender].makanancentaur += count * 1494 global.db.data.users[m.sender].money -= Bmakanancentaur * count495 conn.reply(m.chat, `Succes membeli ${count} Makanan Centaur dengan harga ${Bmakanancentaur * count} money`, m)496 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} makanan centaur dengan harga ${Bmakanancentaur * count} money`.trim(), m)497 498 break 499 case 'tiketm':500 if (global.db.data.users[m.sender].money >= Bhealtmonster * count) {501 global.db.data.users[m.sender].healtmonster += count * 1502 global.db.data.users[m.sender].money -= Bhealtmonster * count503 conn.reply(m.chat, `Succes membeli ${count} TiketM dengan harga ${Bhealtmonster * count} money`, m)504 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} tiketm dengan harga ${Bhealtmonster * count} money`.trim(), m)505 506 break507 case 'aqua':508 if (global.db.data.users[m.sender].money >= Baqua * count) {509 global.db.data.users[m.sender].aqua += count * 1510 global.db.data.users[m.sender].money -= Baqua * count511 conn.reply(m.chat, `Succes membeli ${count} Aqua dengan harga ${Baqua * count} money`, m)512 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} aqua dengan harga ${Baqua * count} money`.trim(), m)513 514 break515 case 'iron':516 if (global.db.data.users[m.sender].money >= Biron * count) {517 global.db.data.users[m.sender].iron += count * 1518 global.db.data.users[m.sender].money -= Biron * count519 conn.reply(m.chat, `Succes membeli ${count} Iron dengan harga ${Biron * count} money`, m)520 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} iron dengan harga ${Biron * count} money`.trim(), m)521 522 break523 case 'string':524 if (global.db.data.users[m.sender].money >= Bstring * count) {525 global.db.data.users[m.sender].string += count * 1526 global.db.data.users[m.sender].money -= Bstring * count527 conn.reply(m.chat, `Succes membeli ${count} String dengan harga ${Bstring * count} money`, m)528 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} string dengan harga ${Bstring * count} money`.trim(), m)529 530 break531 case 'sword':532 if (global.db.data.users[m.sender].money >= Bsword * count) {533 global.db.data.users[m.sender].sword += count * 1534 global.db.data.users[m.sender].money -= Bsword * count535 conn.reply(m.chat, `Succes membeli ${count} Sword dengan harga ${Bsword * count} money`, m)536 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} sword dengan harga ${Bsword * count} money`.trim(), m)537 538 break 539 case 'batu':540 if (global.db.data.users[m.sender].money >= Bbatu * count) {541 global.db.data.users[m.sender].batu += count * 1542 global.db.data.users[m.sender].money -= Bbatu * count543 conn.reply(m.chat, `Succes membeli ${count} Batu dengan harga ${Bbatu * count} money`, m)544 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} batu dengan harga ${Bbatu * count} money`.trim(), m)545 546 break 547 case 'umpan':548 if (global.db.data.users[m.sender].money >= Bumpan * count) {549 global.db.data.users[m.sender].umpan += count * 1550 global.db.data.users[m.sender].money -= Bumpan * count551 conn.reply(m.chat, `Succes membeli ${count} Umpan dengan harga ${Bumpan * count} money`, m)552 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} umpan dengan harga ${Bumpan * count} money`.trim(), m)553 554 break 555 case 'pancingan':556 if (global.db.data.users[m.sender].money >= Bpancingan * count) {557 global.db.data.users[m.sender].pancingan += count * 1558 global.db.data.users[m.sender].money -= Bpancingan * count559 conn.reply(m.chat, `Succes membeli ${count} Pancingan dengan harga ${Bpancingan * count} money`, m)560 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} pancingan dengan harga ${Bpancingan * count} money`.trim(), m)561 562 break563 case 'armor':564 if (global.db.data.users[m.sender].armor == 5) return conn.reply(m.chat, 'Armormu sudah *Level Max*', m)565 if (global.db.data.users[m.sender].money > armor) {566 global.db.data.users[m.sender].armor += 1567 global.db.data.users[m.sender].money -= armor * 1568 conn.reply(m.chat, `Succes membeli armor seharga ${armor} money` ,m)569 } else conn.reply(m.chat, `uang mu tidak cukup untuk membeli armor seharga ${armor} money`, m)570 571 break572 default:573 return conn.reply(m.chat, Kchat, m)574 }575 break576 case 'sell': 577 switch (_type) {578 case 'potion':579 if (global.db.data.users[m.sender].potion >= count * 1) {580 global.db.data.users[m.sender].money += Spotion * count581 global.db.data.users[m.sender].potion -= count * 1582 conn.reply(m.chat, `Succes menjual ${count} Potion dengan harga ${Spotion * count} money`.trim(), m)583 } else conn.reply(m.chat, `Potion kamu tidak cukup`.trim(), m)584 break585 case 'common':586 if (global.db.data.users[m.sender].common >= count * 1) {587 global.db.data.users[m.sender].money += Scommon * count588 global.db.data.users[m.sender].common -= count * 1589 conn.reply(m.chat, `Succes menjual ${count} Common Crate dengan harga ${Scommon * count} money`.trim(), m)590 } else conn.reply(m.chat, `Common Crate kamu tidak cukup`.trim(), m)591 break592 case 'uncommon':593 if (global.db.data.users[m.sender].uncommon >= count * 1) {594 global.db.data.users[m.sender].money += Suncommon * count595 global.db.data.users[m.sender].uncommon -= count * 1596 conn.reply(m.chat, `Succes menjual ${count} Uncommon Crate dengan harga ${Suncommon * count} money`.trim(), m)597 } else conn.reply(m.chat, `Uncommon Crate kamu tidak cukup`.trim(), m)598 break599 case 'mythic':600 if (global.db.data.users[m.sender].mythic >= count * 1) {601 global.db.data.users[m.sender].money += Smythic * count602 global.db.data.users[m.sender].mythic -= count * 1603 conn.reply(m.chat, `Succes menjual ${count} Mythic Crate dengan harga ${Smythic * count} money`.trim(), m)604 } else conn.reply(m.chat, `Mythic Crate kamu tidak cukup`.trim(), m)605 break606 case 'legendary':607 if (global.db.data.users[m.sender].legendary >= count * 1) {608 global.db.data.users[m.sender].money += Slegendary * count609 global.db.data.users[m.sender].legendary -= count * 1610 conn.reply(m.chat, `Succes menjual ${count} Legendary Crate dengan harga ${Slegendary * count} money`.trim(), m)611 } else conn.reply(m.chat, `Legendary Crate kamu tidak cukup`.trim(), m)612 break613 case 'sampah':614 if (global.db.data.users[m.sender].sampah >= count * 1) {615 global.db.data.users[m.sender].sampah -= count * 1616 global.db.data.users[m.sender].money += Ssampah * count617 conn.reply(m.chat, `Succes menjual ${count} sampah, dan anda mendapatkan ${Ssampah * count} money`, m)618 } else conn.reply(m.chat, `Sampah anda tidak cukup`, m)619 break620 case 'kaleng':621 if (global.db.data.users[m.sender].kaleng >= count * 1) {622 global.db.data.users[m.sender].kaleng -= count * 1623 global.db.data.users[m.sender].money += Skaleng * count624 conn.reply(m.chat, `Succes menjual ${count} kaleng, dan anda mendapatkan ${Skaleng * count} money`, m)625 } else conn.reply(m.chat, `Kaleng anda tidak cukup`, m)626 break627 case 'kardus':628 if (global.db.data.users[m.sender].kardus >= count * 1) {629 global.db.data.users[m.sender].kardus -= count * 1630 global.db.data.users[m.sender].money += Skardus * count631 conn.reply(m.chat, `Succes menjual ${count} kardus, dan anda mendapatkan ${Skardus * count} money`, m)632 } else conn.reply(m.chat, `Kardus anda tidak cukup`, m)633 break634 case 'botol':635 if (global.db.data.users[m.sender].botol >= count * 1) {636 global.db.data.users[m.sender].botol -= count * 1637 global.db.data.users[m.sender].money += Sbotol * count638 conn.reply(m.chat, `Succes menjual ${count} botol, dan anda mendapatkan ${Sbotol * count} money`, m)639 } else conn.reply(m.chat, `Botol anda tidak cukup`, m)640 break641 case 'kayu':642 if (global.db.data.users[m.sender].kayu >= count * 1) {643 global.db.data.users[m.sender].kayu -= count * 1644 global.db.data.users[m.sender].money += Skayu * count645 conn.reply(m.chat, `Succes menjual ${count} kayu, dan anda mendapatkan ${Skayu * count} money`, m)646 } else conn.reply(m.chat, `Kayu anda tidak cukup`, m)647 break648 case 'pisang':649 if (global.db.data.users[m.sender].pisang >= count * 1) {650 global.db.data.users[m.sender].pisang -= count * 1651 global.db.data.users[m.sender].money += Spisang * count652 conn.reply(m.chat, `Succes menjual ${count} pisang, dan anda mendapatkan ${Spisang * count} money`, m)653 } else conn.reply(m.chat, `Pisang anda tidak cukup`, m)654 break655 case 'anggur':656 if (global.db.data.users[m.sender].anggur >= count * 1) {657 global.db.data.users[m.sender].anggur -= count * 1658 global.db.data.users[m.sender].money += Sanggur * count659 conn.reply(m.chat, `Succes menjual ${count} anggur, dan anda mendapatkan ${Sanggur * count} money`, m)660 } else conn.reply(m.chat, `Anggur anda tidak cukup`, m)661 break662 case 'mangga':663 if (global.db.data.users[m.sender].mangga >= count * 1) {664 global.db.data.users[m.sender].mangga -= count * 1665 global.db.data.users[m.sender].money += Smangga * count666 conn.reply(m.chat, `Succes menjual ${count} mangga, dan anda mendapatkan ${Smangga * count} money`, m)667 } else conn.reply(m.chat, `Mangga anda tidak cukup`, m)668 break669 case 'jeruk':670 if (global.db.data.users[m.sender].jeruk >= count * 1) {671 global.db.data.users[m.sender].jeruk -= count * 1672 global.db.data.users[m.sender].money += Sjeruk * count673 conn.reply(m.chat, `Succes menjual ${count} jeruk, dan anda mendapatkan ${Sjeruk * count} money`, m)674 } else conn.reply(m.chat, `Jeruk anda tidak cukup`, m)675 break676 case 'apel':677 if (global.db.data.users[m.sender].apel >= count * 1) {678 global.db.data.users[m.sender].apel -= count * 1679 global.db.data.users[m.sender].money += Sapel * count680 conn.reply(m.chat, `Succes menjual ${count} apel, dan anda mendapatkan ${Sapel * count} money`, m)681 } else conn.reply(m.chat, `Apel anda tidak cukup`, m)682 break683 case 'berlian':684 if (global.db.data.users[m.sender].berlian >= count * 1) {685 global.db.data.users[m.sender].berlian -= count * 1686 global.db.data.users[m.sender].money += Sberlian * count687 conn.reply(m.chat, `Succes menjual ${count} berlian, dan anda mendapatkan ${Sberlian * count} money`, m)688 } else conn.reply(m.chat, `Berlian anda tidak cukup`, m)689 break690 case 'emas':691 if (global.db.data.users[m.sender].emas >= count * 1) {692 global.db.data.users[m.sender].emas -= count * 1693 global.db.data.users[m.sender].money += Semasbiasa * count694 conn.reply(m.chat, `Succes menjual ${count} emas , dan anda mendapatkan ${Semasbiasa * count} money`, m)695 } else conn.reply(m.chat, `Emas anda tidak cukup`, m)696 break 697 case 'pet':698 if (global.db.data.users[m.sender].pet >= count * 1) {699 global.db.data.users[m.sender].pet -= count * 1700 global.db.data.users[m.sender].money += Spet * count701 conn.reply(m.chat, `Succes menjual ${count} pet random, dan anda mendapatkan ${Spet * count} money`, m)702 } else conn.reply(m.chat, `Pet Random anda tidak cukup`, m)703 break 704 case 'makananpet':705 if (global.db.data.users[m.sender].makananpet >= count * 1) {706 global.db.data.users[m.sender].makananpet -= count * 1707 global.db.data.users[m.sender].money += Smakananpet * count708 conn.reply(m.chat, `Succes menjual ${count} makanan pet, dan anda mendapatkan ${Smakananpet * count} money`, m)709 } else conn.reply(m.chat, `Makanan pet anda tidak cukup`, m)710 break 711 case 'makananphonix':712 if (global.db.data.users[m.sender].makananphonix >= count * 1) {713 global.db.data.users[m.sender].makananphonix -= count * 1714 global.db.data.users[m.sender].money += Smakananphonix * count715 conn.reply(m.chat, `Succes menjual ${count} makanan phonix, dan anda mendapatkan ${Smakananphonix * count} money`, m)716 } else conn.reply(m.chat, `Makanan phonix anda tidak cukup`, m)717 break718 case 'makanannaga':719 if (global.db.data.users[m.sender].makanannaga >= count * 1) {720 global.db.data.users[m.sender].makanannaga -= count * 1721 global.db.data.users[m.sender].money += Smakanannaga * count722 conn.reply(m.chat, `Succes menjual ${count} makanan naga, dan anda mendapatkan ${Smakanannaga * count} money`, m)723 } else conn.reply(m.chat, `Makanan naga anda tidak cukup`, m)724 break725 case 'makanankyubi':726 if (global.db.data.users[m.sender].makanankyuni >= count * 1) {727 global.db.data.users[m.sender].makanankyubi -= count * 1728 global.db.data.users[m.sender].money += Smakanankyubi * count729 conn.reply(m.chat, `Succes menjual ${count} makanan kyubi, dan anda mendapatkan ${Smakanankyubi* count} money`, m)730 } else conn.reply(m.chat, `Makanan kyubi anda tidak cukup`, m)731 break732 case 'makanangriffin':733 if (global.db.data.users[m.sender].makanangriffin >= count * 1) {734 global.db.data.users[m.sender].makanangriffin -= count * 1735 global.db.data.users[m.sender].money += Smakanangriffin * count736 conn.reply(m.chat, `Succes menjual ${count} makanan griffin, dan anda mendapatkan ${Smakanangriffin * count} money`, m)737 } else conn.reply(m.chat, `Makanan griffin anda tidak cukup`, m)738 break 739 case 'makanancentaur':740 if (global.db.data.users[m.sender].makanancentaur >= count * 1) {741 global.db.data.users[m.sender].makanancentaur -= count * 1742 global.db.data.users[m.sender].money += Smakanancentaur * count743 conn.reply(m.chat, `Succes menjual ${count} makanan centaur, dan anda mendapatkan ${Smakanancentaur * count} money`, m)744 } else conn.reply(m.chat, `Makanan centaur anda tidak cukup`, m)745 break746 case 'aqua':747 if (global.db.data.users[m.sender].aqua >= count * 1) {748 global.db.data.users[m.sender].aqua -= count * 1749 global.db.data.users[m.sender].money += Saqua * count750 conn.reply(m.chat, `Succes menjual ${count} aqua, dan anda mendapatkan ${Saqua * count} money`, m)751 } else conn.reply(m.chat, `Aqua anda tidak cukup`, m)752 break753 case 'pancingan':754 if (global.db.data.users[m.sender].pancingan >= count * 1) {755 global.db.data.users[m.sender].pancingan -= count * 1756 global.db.data.users[m.sender].money += Spancingan * count757 conn.reply(m.chat, `Succes menjual ${count} pancingan, dan anda mendapatkan ${Spancingan * count} money`, m)758 } else conn.reply(m.chat, `Pancingan anda tidak cukup`, m)759 break760 case 'iron':761 if (global.db.data.users[m.sender].iron >= count * 1) {762 global.db.data.users[m.sender].iron -= count * 1763 global.db.data.users[m.sender].money += Siron * count764 conn.reply(m.chat, `Succes menjual ${count} pancingan, dan anda mendapatkan ${Siron * count} money`, m)765 } else conn.reply(m.chat, `Iron anda tidak cukup`, m)766 break767 case 'string':768 if (global.db.data.users[m.sender].string >= count * 1) {769 global.db.data.users[m.sender].string -= count * 1770 global.db.data.users[m.sender].money += Sstring * count771 conn.reply(m.chat, `Succes menjual ${count} string, dan anda mendapatkan ${Sstring * count} money`, m)772 } else conn.reply(m.chat, `String anda tidak cukup`, m)773 break774 case 'sword':775 if (global.db.data.users[m.sender].sword >= count * 1) {776 global.db.data.users[m.sender].sword -= count * 1777 global.db.data.users[m.sender].money += Ssword * count778 conn.reply(m.chat, `Succes menjual ${count} sword, dan anda mendapatkan ${Ssword * count} money`, m)779 } else conn.reply(m.chat, `Sword anda tidak cukup`, m)780 break781 case 'batu':782 if (global.db.data.users[m.sender].batu >= count * 1) {783 global.db.data.users[m.sender].batu -= count * 1784 global.db.data.users[m.sender].money += Sbatu * count785 conn.reply(m.chat, `Succes menjual ${count} batu, dan anda mendapatkan ${Sbatu * count} money`, m)786 } else conn.reply(m.chat, `Batu anda tidak cukup`, m)787 break788 case 'limit':789 if (global.db.data.users[m.sender].limit >= count * 1) {790 global.db.data.users[m.sender].limit -= count * 1791 global.db.data.users[m.sender].money += Slimit * count792 conn.reply(m.chat, `Succes menjual ${count} limit, dan anda mendapatkan ${Slimit * count} money`, m)793 } else conn.reply(m.chat, `Limit anda tidak cukup`, m)794 break795 case 'diamond':796 if (global.db.data.users[m.sender].diamond >= count * 1) {797 global.db.data.users[m.sender].diamond -= count * 1798 global.db.data.users[m.sender].money += Sdiamond * count799 conn.reply(m.chat, `Succes menjual ${count} Diamond, dan anda mendapatkan ${Sdiamond * count} money`, m)800 } else conn.reply(m.chat, `Diamond anda tidak cukup`, m)801 break802 default:803 return conn.reply(m.chat, Kchat, m)804 }805 break806 default:807 return conn.reply(m.chat, Kchat, m)808 }809 } else if (/beli|buy/i.test(command)) {810 const count = args[1] && args[1].length > 0 ? Math.min(999999999999999, Math.max(parseInt(args[1]), 1)) : !args[1] || args.length < 3 ? 1 : Math.min(1, count)811 switch (type) {812 case 'potion':813 if (global.db.data.users[m.sender].money >= potion * count) {814 global.db.data.users[m.sender].money -= potion * count815 global.db.data.users[m.sender].potion += count * 1816 conn.reply(m.chat, `Succes membeli ${count} Potion dengan harga ${potion * count} money\n\nGunakan potion dengan ketik: *${usedPrefix}use potion <jumlah>*`, m)817 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Potion dengan harga ${potion * count} money`,m)818 819 break820 case 'diamond':821 if (global.db.data.users[m.sender].money >= Bdiamond * count) {822 global.db.data.users[m.sender].diamond += count * 1823 global.db.data.users[m.sender].money -= Bdiamond * count824 conn.reply(m.chat, `Succes membeli ${count} Diamond dengan harga ${Bdiamond * count} money`, m)825 } else conn.reply(m.chat, `Money anda tidak cukup`, m)826 827 break828 case 'common':829 if (global.db.data.users[m.sender].money >= Bcommon * count) {830 global.db.data.users[m.sender].common += count * 1831 global.db.data.users[m.sender].money -= Bcommon * count832 conn.reply(m.chat, `Succes membeli ${count} Common crate dengan harga ${Bcommon * count} money`, m)833 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Common crate dengan harga ${Bcommon * count} money\n\nBuka crate dengan ketik: *${usedPrefix}open common*`, m)834 835 break836 case 'uncommon':837 if (global.db.data.users[m.sender].money >= Buncommon * count) {838 global.db.data.users[m.sender].uncommon += count * 1839 global.db.data.users[m.sender].money -= Buncommon * count840 conn.reply(m.chat, `Succes membeli ${count} Uncommon crate dengan harga ${Buncommon * count} money`, m)841 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Uncommon crate dengan harga ${Buncommon * count} money\n\nBuka crate dengan ketik: *${usedPrefix}open uncommon*`, m)842 843 break844 case 'mythic':845 if (global.db.data.users[m.sender].money >= Bmythic * count) {846 global.db.data.users[m.sender].mythic += count * 1847 global.db.data.users[m.sender].money -= Bmythic * count848 conn.reply(m.chat, `Succes membeli ${count} Mythic crate dengan harga ${Bmythic * count} money`, m)849 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Mythic crate dengan harga ${Bmythic* count} money\n\nBuka crate dengan ketik: *${usedPrefix}open mythic*`, m)850 851 break852 case 'legendary':853 if (global.db.data.users[m.sender].money >= Blegendary * count) {854 global.db.data.users[m.sender].legendary += count * 1855 global.db.data.users[m.sender].money -= Blegendary * count856 conn.reply(m.chat, `Succes membeli ${count} Legendary crate dengan harga ${Blegendary * count} money`, m)857 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Legendary crate dengan harga ${Blegendary * count} money\n\nBuka crate dengan ketik: *${usedPrefix}open legendary*`, m)858 859 break860 case 'sampah':861 if (global.db.data.users[m.sender].money >= Bsampah * count) {862 global.db.data.users[m.sender].sampah += count * 1863 global.db.data.users[m.sender].money -= Bsampah * count864 conn.reply(m.chat, `Succes membeli ${count} Sampah dengan harga ${Bsampah * count} money`, m)865 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Sampah dengan harga ${Bsampah * count} money`.trim(), m)866 867 break868 case 'kaleng':869 if (global.db.data.users[m.sender].money >= Bkaleng * count) {870 global.db.data.users[m.sender].kaleng += count * 1871 global.db.data.users[m.sender].money -= Bkaleng * count872 conn.reply(m.chat, `Succes membeli ${count} Kaleng dengan harga ${Bkaleng * count} money`, m)873 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Kaleng dengan harga ${Bkaleng * count} money`.trim(), m)874 875 break876 case 'kardus':877 if (global.db.data.users[m.sender].money >= Bkardus * count) {878 global.db.data.users[m.sender].kardus += count * 1879 global.db.data.users[m.sender].money -= Bkardus * count880 conn.reply(m.chat, `Succes membeli ${count} Kardus dengan harga ${Bkardus * count} money`, m)881 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Kardus dengan harga ${Bkardus * count} money`.trim(), m)882 883 break884 case 'botol':885 if (global.db.data.users[m.sender].money >= Bbotol * count) {886 global.db.data.users[m.sender].botol += count * 1887 global.db.data.users[m.sender].money -= Bbotol * count888 conn.reply(m.chat, `Succes membeli ${count} Botol dengan harga ${Bbotol * count} money`, m)889 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} botol dengan harga ${Bbotol * count} money`.trim(), m)890 891 break892 case 'kayu':893 if (global.db.data.users[m.sender].money >= Bkayu * count) {894 global.db.data.users[m.sender].kayu += count * 1895 global.db.data.users[m.sender].money -= Bkayu * count896 conn.reply(m.chat, `Succes membeli ${count} Kayu dengan harga ${Bkayu * count} money`, m)897 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} kayu dengan harga ${Bkayu * count} money`.trim(), m)898 899 break900 case 'pisang':901 if (global.db.data.users[m.sender].money >= Bpisang * count) {902 global.db.data.users[m.sender].pisang += count * 1903 global.db.data.users[m.sender].money -= Bpisang * count904 conn.reply(m.chat, `Succes membeli ${count} Pisang dengan harga ${Bpisang * count} money`, m)905 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} pisang dengan harga ${Bpisang * count} money`.trim(), m)906 907 break908 case 'anggur':909 if (global.db.data.users[m.sender].money >= Banggur * count) {910 global.db.data.users[m.sender].anggur += count * 1911 global.db.data.users[m.sender].money -= Banggur * count912 conn.reply(m.chat, `Succes membeli ${count} Anggur dengan harga ${Banggur * count} money`, m)913 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} anggur dengan harga ${Banggur * count} money`.trim(), m)914 915 break916 case 'mangga':917 if (global.db.data.users[m.sender].money >= Bmangga * count) {918 global.db.data.users[m.sender].mangga += count * 1919 global.db.data.users[m.sender].money -= Bmangga * count920 conn.reply(m.chat, `Succes membeli ${count} Mangga dengan harga ${Bmangga * count} money`, m)921 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} mangga dengan harga ${Bmangga * count} money`.trim(), m)922 923 break924 case 'jeruk':925 if (global.db.data.users[m.sender].money >= Bjeruk * count) {926 global.db.data.users[m.sender].jeruk += count * 1927 global.db.data.users[m.sender].money -= Bjeruk * count928 conn.reply(m.chat, `Succes membeli ${count} Jeruk dengan harga ${Bjeruk * count} money`, m)929 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} jeruk dengan harga ${Bjeruk * count} money`.trim(), m)930 931 break932 case 'apel':933 if (global.db.data.users[m.sender].money >= Bapel * count) {934 global.db.data.users[m.sender].apel += count * 1935 global.db.data.users[m.sender].money -= Bapel * count936 conn.reply(m.chat, `Succes membeli ${count} Apel dengan harga ${Bapel * count} money`, m)937 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} apel dengan harga ${Bapel * count} money`.trim(), m)938 939 break940 case 'bibitpisang':941 if (global.db.data.users[m.sender].money >= Bbibitpisang * count) {942 global.db.data.users[m.sender].bibitpisang += count * 1943 global.db.data.users[m.sender].money -= Bbibitpisang * count944 conn.reply(m.chat, `Succes membeli ${count} Bibit Pisang dengan harga ${Bbibitpisang * count} money`, m)945 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} bibit pisang dengan harga ${Bbibitpisang * count} money`.trim(), m)946 947 break948 case 'bibitanggur':949 if (global.db.data.users[m.sender].money >= Bbibitanggur * count) {950 global.db.data.users[m.sender].bibitanggur += count * 1951 global.db.data.users[m.sender].money -= Bbibitanggur * count952 conn.reply(m.chat, `Succes membeli ${count} Bibit Anggur dengan harga ${Bbibitanggur * count} money`, m)953 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} bibit anggur dengan harga ${Bbibitanggur * count} money`.trim(), m)954 955 break956 case 'bibitmangga':957 if (global.db.data.users[m.sender].money >= Bbibitmangga * count) {958 global.db.data.users[m.sender].bibitmangga += count * 1959 global.db.data.users[m.sender].money -= Bbibitmangga * count960 conn.reply(m.chat, `Succes membeli ${count} Bibit Mangga dengan harga ${Bbibitmangga * count} money`, m)961 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} bibit mangga dengan harga ${Bbibitmangga * count} money`.trim(), m)962 963 break964 case 'bibitjeruk':965 if (global.db.data.users[m.sender].money >= Bbibitjeruk * count) {966 global.db.data.users[m.sender].bibitjeruk += count * 1967 global.db.data.users[m.sender].money -= Bbibitjeruk * count968 conn.reply(m.chat, `Succes membeli ${count} Bibit Jeruk dengan harga ${Bbibitjeruk * count} money`, m)969 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} bibit jeruk dengan harga ${Bbibitjeruk * count} money`.trim(), m)970 971 break972 case 'bibitapel':973 if (global.db.data.users[m.sender].money >= Bbibitapel * count) {974 global.db.data.users[m.sender].bibitapel += count * 1975 global.db.data.users[m.sender].money -= Bbibitapel * count976 conn.reply(m.chat, `Succes membeli ${count} Bibit Apel dengan harga ${Bbibitapel * count} money`, m)977 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} bibit apel dengan harga ${Bbibitapel * count} money`.trim(), m)978 979 break 980 case 'gardenboxs':981 if (global.db.data.users[m.sender].money >= Bgardenboxs * count) {982 global.db.data.users[m.sender].gardenboxs += count * 1983 global.db.data.users[m.sender].money -= Bgardenboxs * count984 conn.reply(m.chat, `Succes membeli ${count} Gardenboxs dengan harga ${Bgardenboxs * count} money`, m)985 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} gardenboxs dengan harga ${Bgardenboxs * count} money`.trim(), m)986 987 break988 case 'berlian':989 if (global.db.data.users[m.sender].money >= Bberlian * count) {990 global.db.data.users[m.sender].berlian += count * 1991 global.db.data.users[m.sender].money -= Bberlian * count992 conn.reply(m.chat, `Succes membeli ${count} Apel dengan harga ${Bberlian * count} money`, m)993 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} berlian dengan harga ${Bberlian * count} money`.trim(), m)994 995 break996 case 'emas':997 if (global.db.data.users[m.sender].money >= Bemasbiasa * count) {998 global.db.data.users[m.sender].emas += count * 1999 global.db.data.users[m.sender].money -= Bemasbiasa * count1000 conn.reply(m.chat, `Succes membeli ${count} Emas dengan harga ${Bemasbiasa * count} money`, m)1001 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} emas dengan harga ${Bemasbiasa * count} money`.trim(), m)1002 1003 break 1004 case 'pet':1005 if (global.db.data.users[m.sender].money >= Bpet * count) {1006 global.db.data.users[m.sender].pet += count * 11007 global.db.data.users[m.sender].money -= Bpet * count1008 conn.reply(m.chat, `Succes membeli ${count} Pet Random dengan harga ${Bpet * count} money`, m)1009 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} pet random dengan harga ${Bpet * count} money`.trim(), m)1010 1011 break1012 case 'limit':1013 if (global.db.data.users[m.sender].money >= Blimit * count) {1014 global.db.data.users[m.sender].limit += count * 11015 global.db.data.users[m.sender].money -= Blimit * count1016 conn.reply(m.chat, `Succes membeli ${count} Limit dengan harga ${Blimit * count} money`, m)1017 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} limit dengan harga ${Blimit * count} money`.trim(), m)1018 1019 break 1020 /*case 'exp':1021 if (global.db.data.users[m.sender].money >= Bexp * count) {1022 global.db.data.users[m.sender].exp += count * 11023 global.db.data.users[m.sender].money -= Bexp * count1024 conn.reply(m.chat, `Succes membeli ${count} Exp dengan harga ${Bexp * count} money`, m)1025 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} exp dengan harga ${Bexp * count} money`.trim(), m)1026 1027 break1028 case 'eleksirb':1029 if (global.db.data.users[m.sender].money >= Beleksirb * count) {1030 global.db.data.users[m.sender].eleksirb += count * 11031 global.db.data.users[m.sender].money -= Beleksirb * count1032 conn.reply(m.chat, `Succes membeli ${count} Eleksir Biru dengan harga ${Beleksirb * count} money`, m)1033 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} Eleksir Biru dengan harga ${Beleksirb * count} money`.trim(), m)1034 1035 break1036 case 'koinexpg':1037 if (global.db.data.users[m.sender].money >= Bkoinexpg * count) {1038 global.db.data.users[m.sender].koinexpg += count * 11039 global.db.data.users[m.sender].money -= Bkoinexpg * count1040 conn.reply(m.chat, `Succes membeli ${count} Koinexpg dengan harga ${Bkoinexpg * count} money`, m)1041 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} koinexpg dengan harga ${Bkoinexpg * count} money`.trim(), m)1042 1043 break*/1044 case 'cupon':1045 if (global.db.data.users[m.sender].tiketcoin >= Btiketcoin * count) {1046 global.db.data.users[m.sender].cupon += count * 11047 global.db.data.users[m.sender].tiketcoin -= Btiketcoin * count1048 conn.reply(m.chat, `Succes membeli ${count} cupon dengan harga ${Btiketcoin * count} Tiketcoin`, m)1049 } else conn.reply(m.chat, `Tiketcoin anda tidak cukup untuk membeli ${count} cupon dengan harga ${Btiketcoin * count} Tiketcoin\n\nCara mendapatkan tiketcoin, anda harus memainkan semua fitur game..`.trim(), m)1050 1051 break 1052 case 'makananpet':1053 if (global.db.data.users[m.sender].money >= Bmakananpet * count) {1054 global.db.data.users[m.sender].makananpet += count * 11055 global.db.data.users[m.sender].money -= Bmakananpet * count1056 conn.reply(m.chat, `Succes membeli ${count} Makanan Pet dengan harga ${Bmakananpet * count} money`, m)1057 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} makanan pet dengan harga ${Bmakananpet * count} money`.trim(), m)1058 1059 break1060 case 'makanannaga':1061 if (global.db.data.users[m.sender].money >= Bmakanannaga * count) {1062 global.db.data.users[m.sender].makanannaga += count * 11063 global.db.data.users[m.sender].money -= Bmakanannaga * count1064 conn.reply(m.chat, `Succes membeli ${count} Makanan Naga dengan harga ${Bmakanannaga * count} money`, m)1065 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} makanan pet dengan harga ${Bmakanannaga * count} money`.trim(), m)1066 1067 break 1068 case 'makananphonix':1069 if (global.db.data.users[m.sender].money >= Bmakananphonix * count) {1070 global.db.data.users[m.sender].makananphonix += count * 11071 global.db.data.users[m.sender].money -= Bmakananphonix * count1072 conn.reply(m.chat, `Succes membeli ${count} Makanan Phonix dengan harga ${Bmakananphonix * count} money`, m)1073 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} makanan pet dengan harga ${Bmakananphonix * count} money`.trim(), m)1074 1075 break 1076 case 'makanankyubi':1077 if (global.db.data.users[m.sender].money >= Bmakanankyubi * count) {1078 global.db.data.users[m.sender].makanankyubi += count * 11079 global.db.data.users[m.sender].money -= Bmakanankyubi* count1080 conn.reply(m.chat, `Succes membeli ${count} Makanan Kyubi dengan harga ${Bmakanankyubi * count} money`, m)1081 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} makanan kyubi dengan harga ${Bmakanankyubi * count} money`.trim(), m)1082 1083 break 1084 case 'makanangriffin':1085 if (global.db.data.users[m.sender].money >= Bmakanangriffin * count) {1086 global.db.data.users[m.sender].makanangriffin += count * 11087 global.db.data.users[m.sender].money -= Bmakanangriffin * count1088 conn.reply(m.chat, `Succes membeli ${count} Makanan Griffin dengan harga ${Bmakanangriffin * count} money`, m)1089 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} makanan griffin dengan harga ${Bmakanangriffin * count} money`.trim(), m)1090 1091 break 1092 case 'makanancentaur':1093 if (global.db.data.users[m.sender].money >= Bmakanancentaur * count) {1094 global.db.data.users[m.sender].makanancentaur += count * 11095 global.db.data.users[m.sender].money -= Bmakanancentaur * count1096 conn.reply(m.chat, `Succes membeli ${count} Makanan Centaur dengan harga ${Bmakanancentaur * count} money`, m)1097 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} makanan centaur dengan harga ${Bmakanancentaur * count} money`.trim(), m)1098 1099 break 1100 case 'tiketm':1101 if (global.db.data.users[m.sender].money >= Bhealtmonster * count) {1102 global.db.data.users[m.sender].healtmonster += count * 11103 global.db.data.users[m.sender].money -= Bhealtmonster * count1104 conn.reply(m.chat, `Succes membeli ${count} TiketM dengan harga ${Bhealtmonster * count} money`, m)1105 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} tiketm dengan harga ${Bhealtmonster * count} money`.trim(), m)1106 1107 break1108 case 'aqua':1109 if (global.db.data.users[m.sender].money >= Baqua * count) {1110 global.db.data.users[m.sender].aqua += count * 11111 global.db.data.users[m.sender].money -= Baqua * count1112 conn.reply(m.chat, `Succes membeli ${count} Aqua dengan harga ${Baqua * count} money`, m)1113 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} aqua dengan harga ${Baqua * count} money`.trim(), m)1114 1115 break1116 case 'iron':1117 if (global.db.data.users[m.sender].money >= Biron * count) {1118 global.db.data.users[m.sender].iron += count * 11119 global.db.data.users[m.sender].money -= Biron * count1120 conn.reply(m.chat, `Succes membeli ${count} Iron dengan harga ${Biron * count} money`, m)1121 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} iron dengan harga ${Biron * count} money`.trim(), m)1122 1123 break1124 case 'string':1125 if (global.db.data.users[m.sender].money >= Bstring * count) {1126 global.db.data.users[m.sender].string += count * 11127 global.db.data.users[m.sender].money -= Bstring * count1128 conn.reply(m.chat, `Succes membeli ${count} String dengan harga ${Bstring * count} money`, m)1129 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} string dengan harga ${Bstring * count} money`.trim(), m)1130 1131 break1132 case 'sword':1133 if (global.db.data.users[m.sender].money >= Bsword * count) {1134 global.db.data.users[m.sender].sword += count * 11135 global.db.data.users[m.sender].money -= Bsword * count1136 conn.reply(m.chat, `Succes membeli ${count} Sword dengan harga ${Bsword * count} money`, m)1137 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} sword dengan harga ${Bsword * count} money`.trim(), m)1138 1139 break1140 case 'batu':1141 if (global.db.data.users[m.sender].money >= Bbatu * count) {1142 global.db.data.users[m.sender].batu += count * 11143 global.db.data.users[m.sender].money -= Bbatu * count1144 conn.reply(m.chat, `Succes membeli ${count} Batu dengan harga ${Bbatu * count} money`, m)1145 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} batu dengan harga ${Bbatu * count} money`.trim(), m)1146 1147 break 1148 case 'umpan':1149 if (global.db.data.users[m.sender].money >= Bumpan * count) {1150 global.db.data.users[m.sender].umpan += count * 11151 global.db.data.users[m.sender].money -= Bumpan * count1152 conn.reply(m.chat, `Succes membeli ${count} Umpan dengan harga ${Bumpan * count} money`, m)1153 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} umpan dengan harga ${Bumpan * count} money`.trim(), m)1154 1155 break1156 case 'pancingan':1157 if (global.db.data.users[m.sender].money >= Bpancingan * count) {1158 global.db.data.users[m.sender].pancingan += count * 11159 global.db.data.users[m.sender].money -= Bpancingan * count1160 conn.reply(m.chat, `Succes membeli ${count} Pancingan dengan harga ${Bpancingan * count} money`, m)1161 } else conn.reply(m.chat, `Uang anda tidak cukup untuk membeli ${count} pancingan dengan harga ${Bpancingan * count} money`.trim(), m)1162 1163 break1164 case 'armor':1165 if (global.db.data.users[m.sender].armor == 5) return conn.reply(m.chat, 'Armormu sudah *Level Max*', m)1166 if (global.db.data.users[m.sender].money > armor * 1) {1167 global.db.data.users[m.sender].armor += 11168 global.db.data.users[m.sender].money -= armor * 11169 conn.reply(m.chat, `Succes membeli armor seharga ${armor} money` ,m)1170 1171 } else conn.reply(m.chat, `uang mu tidak cukup untuk membeli armor seharga ${armor} money`, m)1172 1173 break1174 default:1175 return conn.reply(m.chat, Kchat, m)1176 }1177 } else if (/sell|jual|/i.test(command)) {1178 const count = args[1] && args[1].length > 0 ? Math.min(999999999999999, Math.max(parseInt(args[1]), 1)) : !args[1] || args.length < 3 ? 1 : Math.min(1, count)1179 switch (type) {1180 case 'potion':1181 if (global.db.data.users[m.sender].potion >= count * 1) {1182 global.db.data.users[m.sender].money += Spotion * count1183 global.db.data.users[m.sender].potion -= count * 11184 conn.reply(m.chat, `Succes menjual ${count} Potion dengan harga ${Spotion * count} money`.trim(), m)1185 } else conn.reply(m.chat, `Potion kamu tidak cukup`.trim(), m)1186 break1187 case 'common':1188 if (global.db.data.users[m.sender].common >= count * 1) {1189 global.db.data.users[m.sender].money += Scommon * count1190 global.db.data.users[m.sender].common -= count * 11191 conn.reply(m.chat, `Succes menjual ${count} Common Crate dengan harga ${Scommon * count} money`.trim(), m)1192 } else conn.reply(m.chat, `Common Crate kamu tidak cukup`.trim(), m)1193 break1194 case 'uncommon':1195 if (global.db.data.users[m.sender].uncommon >= count * 1) {1196 global.db.data.users[m.sender].money += Suncommon * count1197 global.db.data.users[m.sender].uncommon -= count * 11198 conn.reply(m.chat, `Succes menjual ${count} Uncommon Crate dengan harga ${Suncommon * count} money`.trim(), m)1199 } else conn.reply(m.chat, `Uncommon Crate kamu tidak cukup`.trim(), m)1200 break1201 case 'mythic':1202 if (global.db.data.users[m.sender].mythic >= count * 1) {1203 global.db.data.users[m.sender].money += Smythic * count1204 global.db.data.users[m.sender].mythic -= count * 11205 conn.reply(m.chat, `Succes menjual ${count} Mythic Crate dengan harga ${Smythic * count} money`.trim(), m)1206 } else conn.reply(m.chat, `Mythic Crate kamu tidak cukup`.trim(), m)1207 break1208 case 'legendary':1209 if (global.db.data.users[m.sender].legendary >= count * 1) {1210 global.db.data.users[m.sender].money += Slegendary * count1211 global.db.data.users[m.sender].legendary -= count * 11212 conn.reply(m.chat, `Succes menjual ${count} Legendary Crate dengan harga ${Slegendary * count} money`.trim(), m)1213 } else conn.reply(m.chat, `Legendary Crate kamu tidak cukup`.trim(), m)1214 break1215 case 'sampah':1216 if (global.db.data.users[m.sender].sampah >= count * 1) {1217 global.db.data.users[m.sender].sampah -= count * 11218 global.db.data.users[m.sender].money += Ssampah * count1219 conn.reply(m.chat, `Succes menjual ${count} sampah, dan anda mendapatkan ${Ssampah * count} money`.trim(), m)1220 } else conn.reply(m.chat, `Sampah anda tidak cukup`.trim(), m)1221 break1222 case 'kaleng':1223 if (global.db.data.users[m.sender].kaleng >= count * 1) {1224 global.db.data.users[m.sender].kaleng -= count * 11225 global.db.data.users[m.sender].money += Skaleng * count1226 conn.reply(m.chat, `Succes menjual ${count} kaleng, dan anda mendapatkan ${Skaleng * count} money`, m)1227 } else conn.reply(m.chat, `Kaleng anda tidak cukup`, m)1228 break1229 case 'kardus':1230 if (global.db.data.users[m.sender].kardus >= count * 1) {1231 global.db.data.users[m.sender].kardus -= count * 11232 global.db.data.users[m.sender].money += Skardus * count1233 conn.reply(m.chat, `Succes menjual ${count} kardus, dan anda mendapatkan ${Skardus * count} money`, m)1234 } else conn.reply(m.chat, `Kardus anda tidak cukup`, m)1235 break1236 case 'botol':1237 if (global.db.data.users[m.sender].botol >= count * 1) {1238 global.db.data.users[m.sender].botol -= count * 11239 global.db.data.users[m.sender].money += Sbotol * count1240 conn.reply(m.chat, `Succes menjual ${count} botol, dan anda mendapatkan ${Sbotol * count} money`, m)1241 } else conn.reply(m.chat, `Botol anda tidak cukup`, m)1242 break1243 case 'kayu':1244 if (global.db.data.users[m.sender].kayu >= count * 1) {1245 global.db.data.users[m.sender].kayu -= count * 11246 global.db.data.users[m.sender].money += Skayu * count1247 conn.reply(m.chat, `Succes menjual ${count} kayu, dan anda mendapatkan ${Skayu * count} money`, m)1248 } else conn.reply(m.chat, `Kayu anda tidak cukup`, m)1249 break1250 case 'pisang':1251 if (global.db.data.users[m.sender].pisang >= count * 1) {1252 global.db.data.users[m.sender].pisang -= count * 11253 global.db.data.users[m.sender].money += Spisang * count1254 conn.reply(m.chat, `Succes menjual ${count} pisang, dan anda mendapatkan ${Spisang * count} money`, m)1255 } else conn.reply(m.chat, `Pisang anda tidak cukup`, m) 1256 break1257 case 'anggur':1258 if (global.db.data.users[m.sender].anggur >= count * 1) {1259 global.db.data.users[m.sender].anggur -= count * 11260 global.db.data.users[m.sender].money += Sanggur * count1261 conn.reply(m.chat, `Succes menjual ${count} anggur, dan anda mendapatkan ${Sanggur * count} money`, m)1262 } else conn.reply(m.chat, `Anggur anda tidak cukup`, m)1263 break1264 case 'mangga':1265 if (global.db.data.users[m.sender].mangga >= count * 1) {1266 global.db.data.users[m.sender].mangga -= count * 11267 global.db.data.users[m.sender].money += Smangga * count1268 conn.reply(m.chat, `Succes menjual ${count} mangga, dan anda mendapatkan ${Smangga * count} money`, m)1269 } else conn.reply(m.chat, `Mangga anda tidak cukup`, m)1270 break1271 case 'jeruk':1272 if (global.db.data.users[m.sender].jeruk >= count * 1) {1273 global.db.data.users[m.sender].jeruk -= count * 11274 global.db.data.users[m.sender].money += Sjeruk * count1275 conn.reply(m.chat, `Succes menjual ${count} jeruk, dan anda mendapatkan ${Sjeruk * count} money`, m)1276 } else conn.reply(m.chat, `Jeruk anda tidak cukup`, m)1277 break1278 case 'apel':1279 if (global.db.data.users[m.sender].apel >= count * 1) {1280 global.db.data.users[m.sender].apel -= count * 11281 global.db.data.users[m.sender].money += Sapel * count1282 conn.reply(m.chat, `Succes menjual ${count} apel, dan anda mendapatkan ${Sapel * count} money`, m)1283 } else conn.reply(m.chat, `Apel anda tidak cukup`, m)1284 break1285 case 'berlian':1286 if (global.db.data.users[m.sender].berlian >= count * 1) {1287 global.db.data.users[m.sender].berlian -= count * 11288 global.db.data.users[m.sender].money += Sberlian * count1289 conn.reply(m.chat, `Succes menjual ${count} berlian, dan anda mendapatkan ${Sberlian * count} money`, m)1290 } else conn.reply(m.chat, `Berlian anda tidak cukup`, m)1291 break1292 case 'emas':1293 if (global.db.data.users[m.sender].emas >= count * 1) {1294 global.db.data.users[m.sender].emas -= count * 11295 global.db.data.users[m.sender].money += Semasbiasa * count1296 conn.reply(m.chat, `Succes menjual ${count} emas, dan anda mendapatkan ${Semasbiasa * count} money`, m)1297 } else conn.reply(m.chat, `Emas anda tidak cukup`, m)1298 break1299 case 'pet':1300 if (global.db.data.users[m.sender].pet >= count * 1) {1301 global.db.data.users[m.sender].pet -= count * 11302 global.db.data.users[m.sender].money += Spet * count1303 conn.reply(m.chat, `Succes menjual ${count} pet random, dan anda mendapatkan ${Spet * count} money`, m)1304 } else conn.reply(m.chat, `Pet Random anda tidak cukup`, m)1305 break 1306 case 'makananpet':1307 if (global.db.data.users[m.sender].makananpet >= count * 1) {1308 global.db.data.users[m.sender].makananpet -= count * 11309 global.db.data.users[m.sender].money += Smakananpet * count1310 conn.reply(m.chat, `Succes menjual ${count} makanan pet, dan anda mendapatkan ${Smakananpet * count} money`, m)1311 } else conn.reply(m.chat, `Makanan pet anda tidak cukup`, m)1312 break 1313 case 'makanannaga':1314 if (global.db.data.users[m.sender].makanannaga >= count * 1) {1315 global.db.data.users[m.sender].makanannaga -= count * 11316 global.db.data.users[m.sender].money += Smakanannaga * count1317 conn.reply(m.chat, `Succes menjual ${count} makanan naga, dan anda mendapatkan ${Smakanannaga * count} money`, m)1318 } else conn.reply(m.chat, `Makanan naga anda tidak cukup`, m)1319 break1320 case 'makananphonix':1321 if (global.db.data.users[m.sender].makananphonix >= count * 1) {1322 global.db.data.users[m.sender].makananphonix -= count * 11323 global.db.data.users[m.sender].money += Smakananphonix * count1324 conn.reply(m.chat, `Succes menjual ${count} makanan phonix, dan anda mendapatkan ${Smakananphonix * count} money`, m)1325 } else conn.reply(m.chat, `Makanan phonix anda tidak cukup`, m)1326 break1327 case 'makanankyubi':1328 if (global.db.data.users[m.sender].makanankyuni >= count * 1) {1329 global.db.data.users[m.sender].makanankyubi -= count * 11330 global.db.data.users[m.sender].money += Smakanankyubi * count1331 conn.reply(m.chat, `Succes menjual ${count} makanan kyubi, dan anda mendapatkan ${Smakanankyubi* count} money`, m)1332 } else conn.reply(m.chat, `Makanan kyubi anda tidak cukup`, m)1333 break1334 case 'makanangriffin':1335 if (global.db.data.users[m.sender].makanangriffin >= count * 1) {1336 global.db.data.users[m.sender].makanangriffin -= count * 11337 global.db.data.users[m.sender].money += Smakanangriffin * count1338 conn.reply(m.chat, `Succes menjual ${count} makanan griffin, dan anda mendapatkan ${Smakanangriffin * count} money`, m)1339 } else conn.reply(m.chat, `Makanan griffin anda tidak cukup`, m)1340 break1341 case 'makanancentaur':1342 if (global.db.data.users[m.sender].makanancentaur >= count * 1) {1343 global.db.data.users[m.sender].makanancentaur -= count * 11344 global.db.data.users[m.sender].money += Smakanancentaur * count1345 conn.reply(m.chat, `Succes menjual ${count} makanan centaur, dan anda mendapatkan ${Smakanancentaur * count} money`, m)1346 } else conn.reply(m.chat, `Makanan centaur anda tidak cukup`, m)1347 break1348 case 'aqua':1349 if (global.db.data.users[m.sender].aqua >= count * 1) {1350 global.db.data.users[m.sender].aqua -= count * 11351 global.db.data.users[m.sender].money += Saqua * count1352 conn.reply(m.chat, `Succes menjual ${count} aqua, dan anda mendapatkan ${Saqua * count} money`, m)1353 } else conn.reply(m.chat, `Aqua anda tidak cukup`, m)1354 break1355 case 'pancingan':1356 if (global.db.data.users[m.sender].pancingan >= count * 1) {1357 global.db.data.users[m.sender].pancingan -= count * 11358 global.db.data.users[m.sender].money += Spancingan * count1359 conn.reply(m.chat, `Succes menjual ${count} pancingan, dan anda mendapatkan ${Spancingan * count} money`, m)1360 } else conn.reply(m.chat, `Pancingan anda tidak cukup`, m)1361 break1362 case 'iron':1363 if (global.db.data.users[m.sender].iron >= count * 1) {1364 global.db.data.users[m.sender].iron -= count * 11365 global.db.data.users[m.sender].money += Siron * count1366 conn.reply(m.chat, `Succes menjual ${count} pancingan, dan anda mendapatkan ${Siron * count} money`, m)1367 } else conn.reply(m.chat, `Iron anda tidak cukup`, m)1368 break1369 case 'string':1370 if (global.db.data.users[m.sender].string >= count * 1) {1371 global.db.data.users[m.sender].string -= count * 11372 global.db.data.users[m.sender].money += Sstring * count1373 conn.reply(m.chat, `Succes menjual ${count} string, dan anda mendapatkan ${Sstring * count} money`, m)1374 } else conn.reply(m.chat, `String anda tidak cukup`, m)1375 break1376 case 'sword':1377 if (global.db.data.users[m.sender].sword >= count * 1) {1378 global.db.data.users[m.sender].sword -= count * 11379 global.db.data.users[m.sender].money += Ssword * count1380 conn.reply(m.chat, `Succes menjual ${count} sword, dan anda mendapatkan ${Ssword * count} money`, m)1381 } else conn.reply(m.chat, `Sword anda tidak cukup`, m)1382 break1383 case 'batu':1384 if (global.db.data.users[m.sender].batu >= count * 1) {1385 global.db.data.users[m.sender].batu -= count * 11386 global.db.data.users[m.sender].money += Sbatu * count1387 conn.reply(m.chat, `Succes menjual ${count} batu, dan anda mendapatkan ${Sbatu * count} money`, m)1388 } else conn.reply(m.chat, `Batu anda tidak cukup`, m)1389 break1390 case 'limit':1391 if (global.db.data.users[m.sender].limit >= count * 1) {1392 global.db.data.users[m.sender].limit -= count * 11393 global.db.data.users[m.sender].money += Slimit * count1394 conn.reply(m.chat, `Succes menjual ${count} limit, dan anda mendapatkan ${Slimit * count} money`, m)1395 } else conn.reply(m.chat, `Limit anda tidak cukup`, m)1396 break1397 case 'diamond':1398 if (global.db.data.users[m.sender].diamond >= count * 1) {1399 global.db.data.users[m.sender].diamond -= count * 11400 global.db.data.users[m.sender].money += Sdiamond * count1401 conn.reply(m.chat, `Succes menjual ${count} Diamond, dan anda mendapatkan ${Sdiamond * count} money`, m)1402 } else conn.reply(m.chat, `Diamond anda tidak cukup`, m)1403 break1404 default:1405 return conn.reply(m.chat, Kchat, m)1406 }1407 }1408 } catch (e) {1409 conn.reply(m.chat, Kchat, m)1410 console.log(e)1411 }1412}1413handler.help = ['shop <sell|buy> <args>']1414handler.tags = ['rpg']1415 1416handler.command = /^(shop|toko|buy|beli|sell|jual)$/i1417handler.limit = true1418handler.group = true...

Full Screen

Full Screen

TextForEvent.js

Source:TextForEvent.js Github

copy

Full Screen

1/*2Copyright 2015, 2016 OpenMarket Ltd3Licensed under the Apache License, Version 2.0 (the "License");4you may not use this file except in compliance with the License.5You may obtain a copy of the License at6 http://www.apache.org/licenses/LICENSE-2.07Unless required by applicable law or agreed to in writing, software8distributed under the License is distributed on an "AS IS" BASIS,9WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.10See the License for the specific language governing permissions and11limitations under the License.12*/13import {MatrixClientPeg} from './MatrixClientPeg';14import CallHandler from './CallHandler';15import { _t } from './languageHandler';16import * as Roles from './Roles';17import {isValid3pidInvite} from "./RoomInvite";18import SettingsStore from "./settings/SettingsStore";19import {ALL_RULE_TYPES, ROOM_RULE_TYPES, SERVER_RULE_TYPES, USER_RULE_TYPES} from "./mjolnir/BanList";20import Tchap from "./tchap/Tchap";21function textForMemberEvent(ev) {22 // XXX: SYJS-16 "sender is sometimes null for join messages"23 const senderName = ev.sender ? ev.sender.name : ev.getSender();24 let targetName = ev.target ? ev.target.name : ev.getStateKey();25 const prevContent = ev.getPrevContent();26 const content = ev.getContent();27 if (Tchap.looksLikeMxId(targetName)) {28 targetName = Tchap.computeDisplayNameFromUserId(targetName);29 }30 const ConferenceHandler = CallHandler.getConferenceHandler();31 const reason = content.reason ? (_t('Reason') + ': ' + content.reason) : '';32 switch (content.membership) {33 case 'invite': {34 const threePidContent = content.third_party_invite;35 if (threePidContent) {36 if (threePidContent.display_name) {37 return _t('%(targetName)s accepted the invitation for %(displayName)s.', {38 targetName,39 displayName: threePidContent.display_name,40 });41 } else {42 return _t('%(targetName)s accepted an invitation.', {targetName});43 }44 } else {45 if (ConferenceHandler && ConferenceHandler.isConferenceUser(ev.getStateKey())) {46 return _t('%(senderName)s requested a VoIP conference.', {senderName});47 } else {48 return _t('%(senderName)s invited %(targetName)s.', {senderName, targetName});49 }50 }51 }52 case 'ban':53 return _t('%(senderName)s banned %(targetName)s.', {senderName, targetName}) + ' ' + reason;54 case 'join':55 if (prevContent && prevContent.membership === 'join') {56 if (prevContent.displayname && content.displayname && prevContent.displayname !== content.displayname) {57 return _t('%(oldDisplayName)s changed their display name to %(displayName)s.', {58 oldDisplayName: prevContent.displayname,59 displayName: content.displayname,60 });61 } else if (!prevContent.displayname && content.displayname) {62 return _t('%(senderName)s set their display name to %(displayName)s.', {63 senderName: ev.getSender(),64 displayName: content.displayname,65 });66 } else if (prevContent.displayname && !content.displayname) {67 return _t('%(senderName)s removed their display name (%(oldDisplayName)s).', {68 senderName,69 oldDisplayName: prevContent.displayname,70 });71 } else if (prevContent.avatar_url && !content.avatar_url) {72 return _t('%(senderName)s removed their profile picture.', {senderName});73 } else if (prevContent.avatar_url && content.avatar_url &&74 prevContent.avatar_url !== content.avatar_url) {75 return _t('%(senderName)s changed their profile picture.', {senderName});76 } else if (!prevContent.avatar_url && content.avatar_url) {77 return _t('%(senderName)s set a profile picture.', {senderName});78 } else if (SettingsStore.getValue("showHiddenEventsInTimeline")) {79 // This is a null rejoin, it will only be visible if the Labs option is enabled80 return _t("%(senderName)s made no change.", {senderName});81 } else {82 return "";83 }84 } else {85 if (!ev.target) console.warn("Join message has no target! -- " + ev.getContent().state_key);86 if (ConferenceHandler && ConferenceHandler.isConferenceUser(ev.getStateKey())) {87 return _t('VoIP conference started.');88 } else {89 return _t('%(targetName)s joined the room.', {targetName});90 }91 }92 case 'leave':93 if (ev.getSender() === ev.getStateKey()) {94 if (ConferenceHandler && ConferenceHandler.isConferenceUser(ev.getStateKey())) {95 return _t('VoIP conference finished.');96 } else if (prevContent.membership === "invite") {97 return _t('%(targetName)s rejected the invitation.', {targetName});98 } else {99 return _t('%(targetName)s left the room.', {targetName});100 }101 } else if (prevContent.membership === "ban") {102 return _t('%(senderName)s unbanned %(targetName)s.', {senderName, targetName});103 } else if (prevContent.membership === "invite") {104 return _t('%(senderName)s withdrew %(targetName)s\'s invitation.', {105 senderName,106 targetName,107 }) + ' ' + reason;108 } else {109 // sender is not target and made the target leave, if not from invite/ban then this is a kick110 return _t('%(senderName)s kicked %(targetName)s.', {senderName, targetName}) + ' ' + reason;111 }112 }113}114function textForTopicEvent(ev) {115 const senderDisplayName = ev.sender && ev.sender.name ? ev.sender.name : ev.getSender();116 return _t('%(senderDisplayName)s changed the topic to "%(topic)s".', {117 senderDisplayName,118 topic: ev.getContent().topic,119 });120}121function textForRoomNameEvent(ev) {122 const senderDisplayName = ev.sender && ev.sender.name ? ev.sender.name : ev.getSender();123 if (!ev.getContent().name || ev.getContent().name.trim().length === 0) {124 return _t('%(senderDisplayName)s removed the room name.', {senderDisplayName});125 }126 if (ev.getPrevContent().name) {127 return _t('%(senderDisplayName)s changed the room name from %(oldRoomName)s to %(newRoomName)s.', {128 senderDisplayName,129 oldRoomName: ev.getPrevContent().name,130 newRoomName: ev.getContent().name,131 });132 }133 return _t('%(senderDisplayName)s changed the room name to %(roomName)s.', {134 senderDisplayName,135 roomName: ev.getContent().name,136 });137}138function textForTombstoneEvent(ev) {139 const senderDisplayName = ev.sender && ev.sender.name ? ev.sender.name : ev.getSender();140 return _t('%(senderDisplayName)s upgraded this room.', {senderDisplayName});141}142function textForJoinRulesEvent(ev) {143 const senderDisplayName = ev.sender && ev.sender.name ? ev.sender.name : ev.getSender();144 switch (ev.getContent().join_rule) {145 case "public":146 return _t('%(senderDisplayName)s made the room public to whoever knows the link.', {senderDisplayName});147 case "invite":148 return _t('%(senderDisplayName)s made the room invite only.', {senderDisplayName});149 default:150 // The spec supports "knock" and "private", however nothing implements these.151 return _t('%(senderDisplayName)s changed the join rule to %(rule)s', {152 senderDisplayName,153 rule: ev.getContent().join_rule,154 });155 }156}157function textForGuestAccessEvent(ev) {158 const senderDisplayName = ev.sender && ev.sender.name ? ev.sender.name : ev.getSender();159 switch (ev.getContent().guest_access) {160 case "can_join":161 return _t('%(senderDisplayName)s has allowed guests to join the room.', {senderDisplayName});162 case "forbidden":163 return _t('%(senderDisplayName)s has prevented guests from joining the room.', {senderDisplayName});164 default:165 // There's no other options we can expect, however just for safety's sake we'll do this.166 return _t('%(senderDisplayName)s changed guest access to %(rule)s', {167 senderDisplayName,168 rule: ev.getContent().guest_access,169 });170 }171}172function textForRelatedGroupsEvent(ev) {173 const senderDisplayName = ev.sender && ev.sender.name ? ev.sender.name : ev.getSender();174 const groups = ev.getContent().groups || [];175 const prevGroups = ev.getPrevContent().groups || [];176 const added = groups.filter((g) => !prevGroups.includes(g));177 const removed = prevGroups.filter((g) => !groups.includes(g));178 if (added.length && !removed.length) {179 return _t('%(senderDisplayName)s enabled flair for %(groups)s in this room.', {180 senderDisplayName,181 groups: added.join(', '),182 });183 } else if (!added.length && removed.length) {184 return _t('%(senderDisplayName)s disabled flair for %(groups)s in this room.', {185 senderDisplayName,186 groups: removed.join(', '),187 });188 } else if (added.length && removed.length) {189 return _t('%(senderDisplayName)s enabled flair for %(newGroups)s and disabled flair for ' +190 '%(oldGroups)s in this room.', {191 senderDisplayName,192 newGroups: added.join(', '),193 oldGroups: removed.join(', '),194 });195 } else {196 // Don't bother rendering this change (because there were no changes)197 return '';198 }199}200function textForServerACLEvent(ev) {201 const senderDisplayName = ev.sender && ev.sender.name ? ev.sender.name : ev.getSender();202 const prevContent = ev.getPrevContent();203 const changes = [];204 const current = ev.getContent();205 const prev = {206 deny: Array.isArray(prevContent.deny) ? prevContent.deny : [],207 allow: Array.isArray(prevContent.allow) ? prevContent.allow : [],208 allow_ip_literals: !(prevContent.allow_ip_literals === false),209 };210 let text = "";211 if (prev.deny.length === 0 && prev.allow.length === 0) {212 text = `${senderDisplayName} set server ACLs for this room: `;213 } else {214 text = `${senderDisplayName} changed the server ACLs for this room: `;215 }216 if (!Array.isArray(current.allow)) {217 current.allow = [];218 }219 /* If we know for sure everyone is banned, don't bother showing the diff view */220 if (current.allow.length === 0) {221 return text + "🎉 All servers are banned from participating! This room can no longer be used.";222 }223 if (!Array.isArray(current.deny)) {224 current.deny = [];225 }226 const bannedServers = current.deny.filter((srv) => typeof(srv) === 'string' && !prev.deny.includes(srv));227 const unbannedServers = prev.deny.filter((srv) => typeof(srv) === 'string' && !current.deny.includes(srv));228 const allowedServers = current.allow.filter((srv) => typeof(srv) === 'string' && !prev.allow.includes(srv));229 const unallowedServers = prev.allow.filter((srv) => typeof(srv) === 'string' && !current.allow.includes(srv));230 if (bannedServers.length > 0) {231 changes.push(`Servers matching ${bannedServers.join(", ")} are now banned.`);232 }233 if (unbannedServers.length > 0) {234 changes.push(`Servers matching ${unbannedServers.join(", ")} were removed from the ban list.`);235 }236 if (allowedServers.length > 0) {237 changes.push(`Servers matching ${allowedServers.join(", ")} are now allowed.`);238 }239 if (unallowedServers.length > 0) {240 changes.push(`Servers matching ${unallowedServers.join(", ")} were removed from the allowed list.`);241 }242 if (prev.allow_ip_literals !== current.allow_ip_literals) {243 const allowban = current.allow_ip_literals ? "allowed" : "banned";244 changes.push(`Participating from a server using an IP literal hostname is now ${allowban}.`);245 }246 return text + changes.join(" ");247}248function textForMessageEvent(ev, skipUserPrefix) {249 const senderDisplayName = ev.sender && ev.sender.name ? ev.sender.name : ev.getSender();250 let message = senderDisplayName + ': ' + ev.getContent().body;251 if (skipUserPrefix) {252 message = ev.getContent().body;253 if (ev.getContent().msgtype === "m.emote") {254 message = senderDisplayName + " " + message;255 } else if (ev.getContent().msgtype === "m.image") {256 message = _t('sent an image.');257 }258 } else {259 if (ev.getContent().msgtype === "m.emote") {260 message = "* " + senderDisplayName + " " + message;261 } else if (ev.getContent().msgtype === "m.image") {262 message = _t('%(senderDisplayName)s sent an image.', {senderDisplayName});263 }264 }265 return message;266}267function textForCanonicalAliasEvent(ev) {268 const senderName = ev.sender && ev.sender.name ? ev.sender.name : ev.getSender();269 const oldAlias = ev.getPrevContent().alias;270 const oldAltAliases = ev.getPrevContent().alt_aliases || [];271 const newAlias = ev.getContent().alias;272 const newAltAliases = ev.getContent().alt_aliases || [];273 const removedAltAliases = oldAltAliases.filter(alias => !newAltAliases.includes(alias));274 const addedAltAliases = newAltAliases.filter(alias => !oldAltAliases.includes(alias));275 if (!removedAltAliases.length && !addedAltAliases.length) {276 if (newAlias) {277 return _t('%(senderName)s set the main address for this room to %(address)s.', {278 senderName: senderName,279 address: ev.getContent().alias,280 });281 } else if (oldAlias) {282 return _t('%(senderName)s removed the main address for this room.', {283 senderName: senderName,284 });285 }286 } else if (newAlias === oldAlias) {287 if (addedAltAliases.length && !removedAltAliases.length) {288 return _t('%(senderName)s added the alternative addresses %(addresses)s for this room.', {289 senderName: senderName,290 addresses: addedAltAliases.join(", "),291 count: addedAltAliases.length,292 });293 } if (removedAltAliases.length && !addedAltAliases.length) {294 return _t('%(senderName)s removed the alternative addresses %(addresses)s for this room.', {295 senderName: senderName,296 addresses: removedAltAliases.join(", "),297 count: removedAltAliases.length,298 });299 } if (removedAltAliases.length && addedAltAliases.length) {300 return _t('%(senderName)s changed the alternative addresses for this room.', {301 senderName: senderName,302 });303 }304 } else {305 // both alias and alt_aliases where modified306 return _t('%(senderName)s changed the main and alternative addresses for this room.', {307 senderName: senderName,308 });309 }310 // in case there is no difference between the two events,311 // say something as we can't simply hide the tile from here312 return _t('%(senderName)s changed the addresses for this room.', {313 senderName: senderName,314 });315}316function textForCallAnswerEvent(event) {317 const senderName = event.sender ? event.sender.name : _t('Someone');318 const supported = MatrixClientPeg.get().supportsVoip() ? '' : _t('(not supported by this browser)');319 return _t('%(senderName)s answered the call.', {senderName}) + ' ' + supported;320}321function textForCallHangupEvent(event) {322 const senderName = event.sender ? event.sender.name : _t('Someone');323 const eventContent = event.getContent();324 let reason = "";325 if (!MatrixClientPeg.get().supportsVoip()) {326 reason = _t('(not supported by this browser)');327 } else if (eventContent.reason) {328 if (eventContent.reason === "ice_failed") {329 reason = _t('(could not connect media)');330 } else if (eventContent.reason === "invite_timeout") {331 reason = _t('(no answer)');332 } else if (eventContent.reason === "user hangup") {333 // workaround for https://github.com/vector-im/riot-web/issues/5178334 // it seems Android randomly sets a reason of "user hangup" which is335 // interpreted as an error code :(336 // https://github.com/vector-im/riot-android/issues/2623337 reason = '';338 } else {339 reason = _t('(unknown failure: %(reason)s)', {reason: eventContent.reason});340 }341 }342 return _t('%(senderName)s ended the call.', {senderName}) + ' ' + reason;343}344function textForCallInviteEvent(event) {345 const senderName = event.sender ? event.sender.name : _t('Someone');346 // FIXME: Find a better way to determine this from the event?347 let isVoice = true;348 if (event.getContent().offer && event.getContent().offer.sdp &&349 event.getContent().offer.sdp.indexOf('m=video') !== -1) {350 isVoice = false;351 }352 const isSupported = MatrixClientPeg.get().supportsVoip();353 // This ladder could be reduced down to a couple string variables, however other languages354 // can have a hard time translating those strings. In an effort to make translations easier355 // and more accurate, we break out the string-based variables to a couple booleans.356 if (isVoice && isSupported) {357 return _t("%(senderName)s placed a voice call.", {senderName});358 } else if (isVoice && !isSupported) {359 return _t("%(senderName)s placed a voice call. (not supported by this browser)", {senderName});360 } else if (!isVoice && isSupported) {361 return _t("%(senderName)s placed a video call.", {senderName});362 } else if (!isVoice && !isSupported) {363 return _t("%(senderName)s placed a video call. (not supported by this browser)", {senderName});364 }365}366function textForThreePidInviteEvent(event) {367 const senderName = event.sender ? event.sender.name : event.getSender();368 if (!isValid3pidInvite(event)) {369 const targetDisplayName = event.getPrevContent().display_name || _t("Someone");370 return _t('%(senderName)s revoked the invitation for %(targetDisplayName)s to join the room.', {371 senderName,372 targetDisplayName,373 });374 }375 return _t('%(senderName)s sent an invitation to %(targetDisplayName)s to join the room.', {376 senderName,377 targetDisplayName: event.getContent().display_name,378 });379}380function textForHistoryVisibilityEvent(event) {381 const senderName = event.sender ? event.sender.name : event.getSender();382 switch (event.getContent().history_visibility) {383 case 'invited':384 return _t('%(senderName)s made future room history visible to all room members, '385 + 'from the point they are invited.', {senderName});386 case 'joined':387 return _t('%(senderName)s made future room history visible to all room members, '388 + 'from the point they joined.', {senderName});389 case 'shared':390 return _t('%(senderName)s made future room history visible to all room members.', {senderName});391 case 'world_readable':392 return _t('%(senderName)s made future room history visible to anyone.', {senderName});393 default:394 return _t('%(senderName)s made future room history visible to unknown (%(visibility)s).', {395 senderName,396 visibility: event.getContent().history_visibility,397 });398 }399}400// Currently will only display a change if a user's power level is changed401function textForPowerEvent(event) {402 const senderName = event.sender ? event.sender.name : event.getSender();403 if (!event.getPrevContent() || !event.getPrevContent().users ||404 !event.getContent() || !event.getContent().users) {405 return '';406 }407 const userDefault = event.getContent().users_default || 0;408 // Construct set of userIds409 const users = [];410 Object.keys(event.getContent().users).forEach(411 (userId) => {412 if (users.indexOf(userId) === -1) users.push(userId);413 },414 );415 Object.keys(event.getPrevContent().users).forEach(416 (userId) => {417 if (users.indexOf(userId) === -1) users.push(userId);418 },419 );420 const diff = [];421 // XXX: This is also surely broken for i18n422 users.forEach((userId) => {423 const displayName = MatrixClientPeg.get().getUser(userId).rawDisplayName;424 // Previous power level425 const from = event.getPrevContent().users[userId];426 // Current power level427 const to = event.getContent().users[userId];428 if (to !== from) {429 diff.push(430 _t('%(userId)s from %(fromPowerLevel)s to %(toPowerLevel)s', {431 userId: displayName,432 fromPowerLevel: Roles.textualPowerLevel(from, userDefault),433 toPowerLevel: Roles.textualPowerLevel(to, userDefault),434 }),435 );436 }437 });438 if (!diff.length) {439 return '';440 }441 return _t('%(senderName)s changed the power level of %(powerLevelDiffText)s.', {442 senderName,443 powerLevelDiffText: diff.join(", "),444 });445}446function textForPinnedEvent(event) {447 const senderName = event.sender ? event.sender.name : event.getSender();448 return _t("%(senderName)s changed the pinned messages for the room.", {senderName});449}450function textForWidgetEvent(event) {451 const senderName = event.getSender();452 const {name: prevName, type: prevType, url: prevUrl} = event.getPrevContent();453 const {name, type, url} = event.getContent() || {};454 let widgetName = name || prevName || type || prevType || '';455 // Apply sentence case to widget name456 if (widgetName && widgetName.length > 0) {457 widgetName = widgetName[0].toUpperCase() + widgetName.slice(1) + ' ';458 }459 // If the widget was removed, its content should be {}, but this is sufficiently460 // equivalent to that condition.461 if (url) {462 if (prevUrl) {463 return _t('%(widgetName)s widget modified by %(senderName)s', {464 widgetName, senderName,465 });466 } else {467 return _t('%(widgetName)s widget added by %(senderName)s', {468 widgetName, senderName,469 });470 }471 } else {472 return _t('%(widgetName)s widget removed by %(senderName)s', {473 widgetName, senderName,474 });475 }476}477function textForMjolnirEvent(event) {478 const senderName = event.getSender();479 const {entity: prevEntity} = event.getPrevContent();480 const {entity, recommendation, reason} = event.getContent();481 // Rule removed482 if (!entity) {483 if (USER_RULE_TYPES.includes(event.getType())) {484 return _t("%(senderName)s removed the rule banning users matching %(glob)s",485 {senderName, glob: prevEntity});486 } else if (ROOM_RULE_TYPES.includes(event.getType())) {487 return _t("%(senderName)s removed the rule banning rooms matching %(glob)s",488 {senderName, glob: prevEntity});489 } else if (SERVER_RULE_TYPES.includes(event.getType())) {490 return _t("%(senderName)s removed the rule banning servers matching %(glob)s",491 {senderName, glob: prevEntity});492 }493 // Unknown type. We'll say something, but we shouldn't end up here.494 return _t("%(senderName)s removed a ban rule matching %(glob)s", {senderName, glob: prevEntity});495 }496 // Invalid rule497 if (!recommendation || !reason) return _t(`%(senderName)s updated an invalid ban rule`, {senderName});498 // Rule updated499 if (entity === prevEntity) {500 if (USER_RULE_TYPES.includes(event.getType())) {501 return _t("%(senderName)s updated the rule banning users matching %(glob)s for %(reason)s",502 {senderName, glob: entity, reason});503 } else if (ROOM_RULE_TYPES.includes(event.getType())) {504 return _t("%(senderName)s updated the rule banning rooms matching %(glob)s for %(reason)s",505 {senderName, glob: entity, reason});506 } else if (SERVER_RULE_TYPES.includes(event.getType())) {507 return _t("%(senderName)s updated the rule banning servers matching %(glob)s for %(reason)s",508 {senderName, glob: entity, reason});509 }510 // Unknown type. We'll say something but we shouldn't end up here.511 return _t("%(senderName)s updated a ban rule matching %(glob)s for %(reason)s",512 {senderName, glob: entity, reason});513 }514 // New rule515 if (!prevEntity) {516 if (USER_RULE_TYPES.includes(event.getType())) {517 return _t("%(senderName)s created a rule banning users matching %(glob)s for %(reason)s",518 {senderName, glob: entity, reason});519 } else if (ROOM_RULE_TYPES.includes(event.getType())) {520 return _t("%(senderName)s created a rule banning rooms matching %(glob)s for %(reason)s",521 {senderName, glob: entity, reason});522 } else if (SERVER_RULE_TYPES.includes(event.getType())) {523 return _t("%(senderName)s created a rule banning servers matching %(glob)s for %(reason)s",524 {senderName, glob: entity, reason});525 }526 // Unknown type. We'll say something but we shouldn't end up here.527 return _t("%(senderName)s created a ban rule matching %(glob)s for %(reason)s",528 {senderName, glob: entity, reason});529 }530 // else the entity !== prevEntity - count as a removal & add531 if (USER_RULE_TYPES.includes(event.getType())) {532 return _t("%(senderName)s changed a rule that was banning users matching %(oldGlob)s to matching " +533 "%(newGlob)s for %(reason)s",534 {senderName, oldGlob: prevEntity, newGlob: entity, reason});535 } else if (ROOM_RULE_TYPES.includes(event.getType())) {536 return _t("%(senderName)s changed a rule that was banning rooms matching %(oldGlob)s to matching " +537 "%(newGlob)s for %(reason)s",538 {senderName, oldGlob: prevEntity, newGlob: entity, reason});539 } else if (SERVER_RULE_TYPES.includes(event.getType())) {540 return _t("%(senderName)s changed a rule that was banning servers matching %(oldGlob)s to matching " +541 "%(newGlob)s for %(reason)s",542 {senderName, oldGlob: prevEntity, newGlob: entity, reason});543 }544 // Unknown type. We'll say something but we shouldn't end up here.545 return _t("%(senderName)s updated a ban rule that was matching %(oldGlob)s to matching %(newGlob)s " +546 "for %(reason)s", {senderName, oldGlob: prevEntity, newGlob: entity, reason});547}548const handlers = {549 'm.room.message': textForMessageEvent,550 'm.call.invite': textForCallInviteEvent,551 'm.call.answer': textForCallAnswerEvent,552 'm.call.hangup': textForCallHangupEvent,553};554const stateHandlers = {555 'm.room.canonical_alias': textForCanonicalAliasEvent,556 'm.room.name': textForRoomNameEvent,557 'm.room.topic': textForTopicEvent,558 'm.room.member': textForMemberEvent,559 'm.room.third_party_invite': textForThreePidInviteEvent,560 'm.room.history_visibility': textForHistoryVisibilityEvent,561 'm.room.power_levels': textForPowerEvent,562 'm.room.pinned_events': textForPinnedEvent,563 'm.room.server_acl': textForServerACLEvent,564 'm.room.tombstone': textForTombstoneEvent,565 'm.room.join_rules': textForJoinRulesEvent,566 'm.room.guest_access': textForGuestAccessEvent,567 'm.room.related_groups': textForRelatedGroupsEvent,568 // TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111)569 'im.vector.modular.widgets': textForWidgetEvent,570};571// Add all the Mjolnir stuff to the renderer572for (const evType of ALL_RULE_TYPES) {573 stateHandlers[evType] = textForMjolnirEvent;574}575export function textForEvent(ev, skipUserPrefix) {576 const handler = (ev.isState() ? stateHandlers : handlers)[ev.getType()];577 if (handler) return handler(ev, skipUserPrefix);578 return '';...

Full Screen

Full Screen

rpg-cooldown.js

Source:rpg-cooldown.js Github

copy

Full Screen

1let levelling = require('../lib/levelling')2let fetch = require('node-fetch')3let handler = async (m, { conn, usedPrefix }) => {4 5 let { lasthourly, lastberburu, lastbansos, lastadventure, lastfishing, lastwar, lastduel, lastmining, lastdungeon, lastclaim, lastweekly, lastmonthly } = global.db.data.users[m.sender]6 7 let healt = global.db.data.users[m.sender].healt8 let stamina = global.db.data.users[m.sender].stamina9 let armor = global.db.data.users[m.sender].armor 10 let sword = global.db.data.users[m.sender].sword11 let sdurability = global.db.data.users[m.sender].sworddurability12 let warn = global.db.data.users[m.sender].warn13 let tprem = global.db.data.users[m.sender].tprem14 let pancing = global.db.data.users[m.sender].pancing15 let fdurability = global.db.data.users[m.sender].fishingroddurability16 let role = global.db.data.users[m.sender].role17 let pickaxe = global.db.data.users[m.sender].pickaxe18 let pdurability = global.db.data.users[m.sender].pickaxedurability1920 let psepick = global.db.data.users[m.sender].psepick21 let psenjata = global.db.data.users[m.sender].psenjata2223 let ikan= global.db.data.users[m.sender].ikan24 let nila= global.db.data.users[m.sender].nila25 let bawal= global.db.data.users[m.sender].bawal26 let lele= global.db.data.users[m.sender].lele27 let udangb= global.db.data.users[m.sender].udang2829 let apel = global.db.data.users[m.sender].apel30 let ayamg = global.db.data.users[m.sender].ayamg31 let ayamb = global.db.data.users[m.sender].ayamb32 let sapir = global.db.data.users[m.sender].sapir33 let ssapi = global.db.data.users[m.sender].ssapi34 let kayu = global.db.data.users[m.sender].kayu35 let string = global.db.data.users[m.sender].string36 let emas = global.db.data.users[m.sender].emas37 let besi = global.db.data.users[m.sender].iron38 let batu = global.db.data.users[m.sender].batu39 let sapi = global.db.data.users[m.sender].sapi40 let ayam = global.db.data.users[m.sender].ayam41 let babi = global.db.data.users[m.sender].babi42 let banteng = global.db.data.users[m.sender].banteng43 let pet = global.db.data.users[m.sender].pet44 let kucing = global.db.data.users[m.sender].kucing45 let _kucing = global.db.data.users[m.sender].anakkucing46 let rubah = global.db.data.users[m.sender].rubah47 let _rubah = global.db.data.users[m.sender].anakrubah48 let kuda = global.db.data.users[m.sender].kuda49 let _kuda = global.db.data.users[m.sender].anakkuda50 let diamond = global.db.data.users[m.sender].diamond51 let potion = global.db.data.users[m.sender].potion52 let common = global.db.data.users[m.sender].common53 let makananpet = global.db.data.users[m.sender].makananpet54 let uncommon = global.db.data.users[m.sender].uncommon55 let mythic = global.db.data.users[m.sender].mythic56 let legendary = global.db.data.users[m.sender].legendary57 let level = global.db.data.users[m.sender].level58 let money = global.db.data.users[m.sender].money59 let exp = global.db.data.users[m.sender].exp60 let atm = global.db.data.users[m.sender].atm61 let arlok = global.db.data.users[m.sender].arlok62 let limit = global.db.data.users[m.sender].limit63 let glimit = global.db.data.users[m.sender].glimit64 let sampah = global.db.data.users[m.sender].sampah65 let { max } = levelling.xpRange(level, exp, global.multiplier)66 let name = m.fromMe ? conn.user : conn.contacts[m.sender]67 let sortedmoney = Object.entries(global.db.data.users).sort((a, b) => b[1].money - a[1].money)68 let sortedgold = Object.entries(global.db.data.users).sort((a, b) => b[1].gold - a[1].gold)69 let sortedarlok = Object.entries(global.db.data.users).sort((a, b) => b[1].arlok - a[1].arlok)70 let sortedlevel = Object.entries(global.db.data.users).sort((a, b) => b[1].level - a[1].level)71 let sorteddiamond = Object.entries(global.db.data.users).sort((a, b) => b[1].diamond - a[1].diamond)72 let sortedpotion = Object.entries(global.db.data.users).sort((a, b) => b[1].potion - a[1].potion)73 let sortedsampah = Object.entries(global.db.data.users).sort((a, b) => b[1].sampah - a[1].sampah)74 let sortedcommon = Object.entries(global.db.data.users).sort((a, b) => b[1].common - a[1].common)75 let sorteduncommon = Object.entries(global.db.data.users).sort((a, b) => b[1].uncommon - a[1].uncommon)76 let sortedmythic = Object.entries(global.db.data.users).sort((a, b) => b[1].mythic - a[1].mythic)77 let sortedlegendary = Object.entries(global.db.data.users).sort((a, b) => b[1].legendary - a[1].legendary)78 let usersmoney = sortedmoney.map(v => v[0])79 let usersgold = sortedgold.map(v => v[0])80 let usersarlok = sortedarlok.map(v => v[0])81 let usersdiamond = sorteddiamond.map(v => v[0])82 let userspotion = sortedpotion.map(v => v[0])83 let userssampah = sortedsampah.map(v => v[0])84 let userslevel = sortedlevel.map(v => v[0])85 let userscommon = sortedcommon.map(v => v[0])86 let usersuncommon = sorteduncommon.map(v => v[0])87 let usersmythic = sortedmythic.map(v => v[0])88 let userslegendary = sortedlegendary.map(v => v[0])89 let pp = 'https://www6.flamingtext.com/net-fu/proxy_form.cgi?&imageoutput=true&script=sketch-name&doScale=true&scaleWidth=800&scaleHeight=500&fontsize=100&fillTextType=1&fillTextPattern=Warning!&text=Inventory'90 let str = `91*—「 🕖 Cooldown 」—*92*Last Berburu :* ${lastberburu > 0 ? '❌' : '✅'}93*Last Memancing :* ${lastfishing > 0 ? '❌' : '✅'}94*Last Adventure :* ${lastadventure > 0 ? '❌' : '✅'}95*Last Duel :* ${lastduel > 0 ? '❌' : '✅'}96*Last War :* ${lastwar > 0 ? '❌' : '✅'}97*Last Dungeon :* ${lastdungeon > 0 ? '❌' : '✅'}98*Last Mining :* ${lastmining > 0 ? '❌' : '✅'}99*Last Bansos :* ${lastbansos > 0 ? '❌' : '✅'}100*Last Hourly :* ${lasthourly > 0 ? '❌' : '✅'}101*Last Claim :* ${lastclaim > 0 ? '❌' : '✅'}102*Last Weekly :* ${lastweekly > 0 ? '❌' : '✅'}103*Last Monthly :* ${lastmonthly > 0 ? '❌' : '✅'}104\n${readMore}105⚠️ *Warn:* ${warn}106⛔ *Banned:* No107`.trim()108 conn.send2But(m.chat, str, wm2, `Inventory`, `.inv`, `Profile`, `.profile`, m)109 conn.reply(str)110}111handler.help = ['cd','cooldown']112handler.tags = ['rpg']113handler.command = /^(cd|cooldown)$/i114handler.register = false115module.exports = handler116117const more = String.fromCharCode(8206)118const readMore = more.repeat(4201) ...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2wptools.page('Albert Einstein')3 .then(function(page) {4 return page.get();5 })6 .then(function(page) {7 console.log(page);8 })9 .catch(function(err) {10 console.error(err);11 });12var wptools = require('wptools');13wptools.page('Albert Einstein')14 .then(function(page) {15 return page.get();16 })17 .then(function(page) {18 console.log(page);19 })20 .catch(function(err) {21 console.error(err);22 });23var wptools = require('wptools');24wptools.page('Albert Einstein')25 .then(function(page) {26 return page.get();27 })28 .then(function(page) {29 console.log(page);30 })31 .catch(function(err) {32 console.error(err);33 });34var wptools = require('wptools');35wptools.page('Albert Einstein')36 .then(function(page) {37 return page.get();38 })39 .then(function(page) {40 console.log(page);41 })42 .catch(function(err) {43 console.error(err);44 });45var wptools = require('wptools');46wptools.page('Albert Einstein')47 .then(function(page) {48 return page.get();49 })50 .then(function(page) {51 console.log(page);52 })53 .catch(function(err) {54 console.error(err);55 });56var wptools = require('wptools');57wptools.page('Albert Einstein')58 .then(function(page) {59 return page.get();60 })61 .then(function(page) {62 console.log(page);63 })64 .catch(function(err) {65 console.error(err);66 });67var wptools = require('wptools');68wptools.page('Albert Einstein')69 .then(function(page) {

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var page = wptools('Albert Einstein');3page.get(function(err, info) {4 if (err) {5 console.log(err);6 } else {7 console.log(info);8 }9});10### wptools(<title>, <options>)

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var title = 'Albert Einstein';3var page = wptools.page(title);4page.get(function(err, info) {5 if (err) {6 console.log(err);7 } else {8 console.log(info);9 }10});11## wptools.page(title, options)12## Page.get(callback)13## Page.getHtml(callback)14## Page.getImages(callback)

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2wptools.sender('en', 'Albert Einstein');3var wptools = require('wptools');4wptools.sender('en', 'Albert Einstein');5var wptools = require('wptools');6wptools.sender('en', 'Albert Einstein');7var wptools = require('wptools');8wptools.sender('en', 'Albert Einstein');9var wptools = require('wptools');10wptools.sender('en', 'Albert Einstein');11var wptools = require('wptools');12wptools.sender('en', 'Albert Einstein');13var wptools = require('wptools');14wptools.sender('en', 'Albert Einstein');15var wptools = require('wptools');16wptools.sender('en', 'Albert Einstein');

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var sender = wptools.sender;3sender(url, 'text', function(err, data) {4 if (err) {5 console.log(err);6 } else {7 console.log(data);8 }9});

Full Screen

Using AI Code Generation

copy

Full Screen

1const wptools = require("wptools");2const sender = wptools.sender;3 if (error) {4 console.log(error);5 } else {6 console.log(response);7 }8});9This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

Full Screen

Using AI Code Generation

copy

Full Screen

1const wptools = require('wptools');2wptools.page('Albert Einstein').get().then((page) => {3 console.log(page.data.imageinfo[0].url);4});5### wptools.page(title, options)6### page.get()7wptools.page('Albert Einstein').get().then((page) => {8 console.log(page.data.imageinfo[0].url);9});10### page.getSections()11wptools.page('Albert Einstein').getSections().then((sections) => {12 console.log(sections[0].title);13});14### page.getImages()15wptools.page('Albert Einstein').getImages().then((images) => {16 console.log(images[0].url);17});18### page.getReferences()19wptools.page('Albert Einstein').getReferences().then((references) => {20 console.log(references[0].text);21});22### page.getCategories()

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var sender = wptools.sender;3var query = wptools.query;4sender('en', 'United States', function(err, res) {5 if (err) {6 console.log(err);7 }8 else {9 console.log(res);10 }11});12query('en', 'United States', function(err, res) {13 if (err) {14 console.log(err);15 }16 else {17 console.log(res);18 }19});20[MIT](LICENSE)

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful