Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const tokens = require('../tokens.json');
- const Discord = require("discord.js");
- const sql = require(`sqlite`);
- const client = new Discord.Client();
- sql.open(`pubg.sqlite`)
- exports.run = async (client, msg, params) => {
- return new Promise(async(resolve, reject) => {
- let open = `yes`;
- let rows = await sql.all(`SELECT DISTINCT * FROM matchmaking WHERE open = "yes" AND guildID = "${msg.guild.id}" LIMIT 10`);
- const embed = new Discord.MessageEmbed()
- .setTitle(`Users Currently Matchmaking!`)
- .setDescription(`A list of Users who are currently matchmaking and the Paramaters they are searching for!`)
- .setThumbnail(msg.guild.iconURL)
- .setColor(0x00AE86)
- .setTimestamp()
- .setFooter(`${tokens.name} | `, "https://i.imgur.com/kin1Qv2.jpg")
- let matchmaking = require(`./join.js`);
- matchmaking[msg.guild.id].users.forEach((userID, i) => { embed.addField(`${i+1} **${users.userName}** Searching In **${users.region}**`, `Looking for a **${users.mode}** in **${users.perspective}** Mode!`)});
- msg.channel.send(
- embed,
- '',
- { disableEveryone: true }
- ).catch((error) => {client.channels.get(tokens.logID).send(error); console.log(error)});
- });
- };
- exports.conf = {
- enabled: true,
- guildOnly: false,
- aliases: ['']
- };
- exports.help = {
- name: 'queue',
- description: 'queue',
- usage: 'queue'
- };
- // The other file... cut down the uneccesary parts
- const tokens = require('../tokens.json');
- const Discord = require("discord.js");
- const client = new Discord.Client();
- exports.run = async (client, msg, params) => {
- return new Promise((resolve, reject) => {
- matchmaking = {};
- if(!matchmaking.hasOwnProperty(msg.guild.id)) {
- matchmaking[msg.guild.id] = {};
- matchmaking[msg.guild.id].searching = false;
- matchmaking[msg.guild.id].users = [];
- }
- matchmaking[msg.guild.id].users.push({userID: msg.author.id, userName: msg.author.username, perspective: perspective, mode: mode, region: region});
- module.exports = matchmaking[msg.guild.id];
- const embed = new Discord.MessageEmbed()
- .setThumbnail(msg.guild.iconURL)
- .setColor(0x00AE86)
- .addField(`**Matchmaking Started**`, `Searching for ${perspective} ${mode} in ${region}`)
- .setTimestamp()
- .setFooter(`${tokens.name} |`, "https://i.imgur.com/kin1Qv2.jpg")
- msg.channel.send(
- embed,
- '',
- { disableEveryone: true }
- ).catch((error) => {client.channels.get(tokens.logID).send(error); console.log(error)});
- console.log(matchmaking[msg.guild.id].users);
- });
- };
- exports.conf = {
- enabled: true,
- guildOnly: false,
- aliases: ['']
- };
- exports.help = {
- name: 'join',
- description: '',
- usage: 'join'
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement