Skip to content

Instantly share code, notes, and snippets.

@phaticusthiccy
Created March 14, 2021 19:32
Show Gist options
  • Save phaticusthiccy/4974efdf751c57101021ab1137bdb394 to your computer and use it in GitHub Desktop.
Save phaticusthiccy/4974efdf751c57101021ab1137bdb394 to your computer and use it in GitHub Desktop.
/* Codded by @phaticusthiccy
Telegram: t.me/phaticusthiccy
Instagram: www.instagram.com/kyrie.baran
*/
const Asena = require('../events');
const {MessageType} = require('@adiwajshing/baileys');
const con = require('../config');
// Descriptions
const TRZAR = "Rastgele zar atar."
const ENZAR = "Roll dice randomly."
const HIZAR = "पासा के यादृच्छिक रोल"
// Sentences
const TRSEN = "🍀 ```Zar Atılıyor!``` 🎲"
const ENSEN = "🍀 ```Rolling Dice!``` 🎲"
const HISEN = "🍀 ```पासा फेंको!``` 🎲"
// Results
const TRSON = "```Zar Atıldı:``` "
const ENSON = "```Dice Rolled:``` "
const HISON = "```पासा लुढ़का:``` "
// Plugin Start
if (con.LANG === 'TR' || 'az') {
if (con.WORKTYPE === 'private') {
Asena.addCommand({pattern: 'roll', fromMe: true, desc: TRZAR}, (async (message, match) => {
await message.client.sendMessage(message.jid, TRSEN, MessageType.text);
await new Promise(r => setTimeout(r, 4000));
// Numbers
var r_text = new Array ();
r_text[0] = "🎲 *1* 🎲";
r_text[1] = "🎲 *2* 🎲";
r_text[2] = "🎲 *3* 🎲";
r_text[3] = "🎲 *4* 🎲";
r_text[4] = "🎲 *5* 🎲";
r_text[5] = "🎲 *6* 🎲";
var i = Math.floor(6*Math.random())
await message.client.sendMessage(message.jid, TRSON + `${r_text[i]}`, MessageType.text);
}));
}
else if (con.WORKTYPE === 'public') {
Asena.addCommand({pattern: 'roll', fromMe: false, desc: TRZAR}, (async (message, match) => {
await message.client.sendMessage(message.jid, TRSEN, MessageType.text);
await new Promise(r => setTimeout(r, 4000));
// Numbers
var r_text = new Array ();
r_text[0] = "🎲 *1* 🎲";
r_text[1] = "🎲 *2* 🎲";
r_text[2] = "🎲 *3* 🎲";
r_text[3] = "🎲 *4* 🎲";
r_text[4] = "🎲 *5* 🎲";
r_text[5] = "🎲 *6* 🎲";
var i = Math.floor(6*Math.random())
await message.client.sendMessage(message.jid, TRSON + `${r_text[i]}`, MessageType.text);
}));
}
}
else if (con.LANG === 'HI') {
if (con.WORKTYPE === 'private') {
Asena.addCommand({pattern: 'roll', fromMe: true, desc: HIZAR}, (async (message, match) => {
await message.client.sendMessage(message.jid, HISEN, MessageType.text);
await new Promise(r => setTimeout(r, 4000));
// Numbers
var r_text = new Array ();
r_text[0] = "🎲 *1* 🎲";
r_text[1] = "🎲 *2* 🎲";
r_text[2] = "🎲 *3* 🎲";
r_text[3] = "🎲 *4* 🎲";
r_text[4] = "🎲 *5* 🎲";
r_text[5] = "🎲 *6* 🎲";
var i = Math.floor(6*Math.random())
await message.client.sendMessage(message.jid, HISON + `${r_text[i]}`, MessageType.text);
}));
}
else if (con.WORKTYPE === 'public') {
Asena.addCommand({pattern: 'roll', fromMe: false, desc: HIZAR}, (async (message, match) => {
await message.client.sendMessage(message.jid, HISEN, MessageType.text);
await new Promise(r => setTimeout(r, 4000));
// Numbers
var r_text = new Array ();
r_text[0] = "🎲 *1* 🎲";
r_text[1] = "🎲 *2* 🎲";
r_text[2] = "🎲 *3* 🎲";
r_text[3] = "🎲 *4* 🎲";
r_text[4] = "🎲 *5* 🎲";
r_text[5] = "🎲 *6* 🎲";
var i = Math.floor(6*Math.random())
await message.client.sendMessage(message.jid, HISON + `${r_text[i]}`, MessageType.text);
}));
}
}
else {
if (con.WORKTYPE === 'private') {
Asena.addCommand({pattern: 'roll', fromMe: true, desc: ENZAR}, (async (message, match) => {
await message.client.sendMessage(message.jid, ENSEN, MessageType.text);
await new Promise(r => setTimeout(r, 4000));
// Numbers
var r_text = new Array ();
r_text[0] = "🎲 *1* 🎲";
r_text[1] = "🎲 *2* 🎲";
r_text[2] = "🎲 *3* 🎲";
r_text[3] = "🎲 *4* 🎲";
r_text[4] = "🎲 *5* 🎲";
r_text[5] = "🎲 *6* 🎲";
var i = Math.floor(6*Math.random())
await message.client.sendMessage(message.jid, ENSON + `${r_text[i]}`, MessageType.text);
}));
}
else if (con.WORKTYPE === 'public') {
Asena.addCommand({pattern: 'roll', fromMe: false, desc: ENZAR}, (async (message, match) => {
await message.client.sendMessage(message.jid, ENSEN, MessageType.text);
await new Promise(r => setTimeout(r, 4000));
// Numbers
var r_text = new Array ();
r_text[0] = "🎲 *1* 🎲";
r_text[1] = "🎲 *2* 🎲";
r_text[2] = "🎲 *3* 🎲";
r_text[3] = "🎲 *4* 🎲";
r_text[4] = "🎲 *5* 🎲";
r_text[5] = "🎲 *6* 🎲";
var i = Math.floor(6*Math.random())
await message.client.sendMessage(message.jid, ENSON + `${r_text[i]}`, MessageType.text);
}));
}
}
@Asifsifu
Copy link

#@![images - 2021-03-11T134546 696](https://user-images.githubusercontent.com/80660673/111099024-a5d29100-856a-11eb-8f1e-8343e18195e3.jpeg)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment