Skip to content

Instantly share code, notes, and snippets.

@phaticusthiccy
Created March 14, 2021 22:38
Show Gist options
  • Save phaticusthiccy/23e6c2cc12db52fd54ccc397b1bd4227 to your computer and use it in GitHub Desktop.
Save phaticusthiccy/23e6c2cc12db52fd54ccc397b1bd4227 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') {
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);
}));
}
}
@flash007k
Copy link

How to use this one?

@joewilliams007
Copy link

How to use this one?

.roll

@nilantha180
Copy link

@ #Skip to content
phaticusthiccy/Dice Game V3-2.js
Created 4 months ago β€’ Report abuse
Code
Revisions 1
Stars 3
Forks 2
Dice Game V3-2.js
/* 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') {

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);

    }));
}

}
@flash007k flash007k commented on 27 Mar
How to use this one?

@joewilliams007 joewilliams007 commented on 4 May
How to use this one?

.roll

Leave a comment
Β© 2021 GitHub, Inc.
Terms
Privacy
Security
Status
Docs
Contact GitHub
Pricing
API
Training
Blog
About

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