Commit 2bb814a4 authored by Neoony's avatar Neoony
Browse files

-Rename role to Come-Play -Come Play notification will now ping Come-Play role instead of @here

parent d4518c6f
......@@ -49,7 +49,7 @@ let messageQuickPlay = '```No data yet. Try again in < 10 seconds```';
// Test Discord ID: 535187069459234831
// Official Empires Discord ID: 227846801653366784
const DiscordChannelID = '227846801653366784';
const RoleName = 'Come-Play notifier';
const RoleName = 'Come-Play';
const ComePlayChannelName = 'come-play';
const empireschatChannelName = 'empireschat';
......@@ -800,7 +800,7 @@ function RefreshSQL() {
}
function ComePlayNotifier() {
// Mention @here at certain player number at lobby
// Mention @Come-Play at certain player number at lobby
// Timer for mention from file
const path = 'CPNotifCounter.txt';
......@@ -835,6 +835,7 @@ function ComePlayNotifier() {
if (cpplayersinlobby >= 4 && CPNotifCounter <= 0) {
const serverx = client.guilds.cache.get(DiscordChannelID);
const channelx = client.guilds.cache.get(DiscordChannelID).channels.cache.find(channel => channel.name === ComePlayChannelName);
const rolex = client.guilds.cache.get(DiscordChannelID).roles.cache.find(role => role.name === RoleName);
// const rolexz = client.guilds.cache.get(DiscordChannelID).roles.cache.find(role => role.name === 'Status');
// console.log('Rolex: ', rolex);
// const permissions = client.guilds.cache.get(DiscordChannelID).me.permissionsIn(channelx);
......@@ -848,9 +849,9 @@ function ComePlayNotifier() {
console.log(DateAndTime + ': ' + 'Both permissions OK');
// server.member(userx).roles.add(rolex).catch(console.error);
// message.channel.send('You have been added to come-play channel\n' + 'Link to the channel: https://discordapp.com/channels/' + DiscordChannelID + '/' + channelx.id);
// add @here
channelx.send('@here```Game is starting in Lobby, come play!```' + messageComePlayNotifLobby).catch(console.error);
console.log(DateAndTime + ': ' + '@hereGame is starting in Lobby, come play!\n' + messageComePlayNotifLobby);
// add @Come-Play
channelx.send('<@&' + rolex + '>```Game is starting in Lobby, come play!```' + messageComePlayNotifLobby).catch(console.error);
console.log(DateAndTime + ': ' + '<@&' + rolex + '>Game is starting in Lobby, come play!\n' + messageComePlayNotifLobby);
fs.unlink(path, (err) => {
if (err) {
......@@ -910,6 +911,7 @@ function ComePlayNotifier() {
if (cpplayersoutoflobby >= 12 && CPNotifCounter <= 0) {
const serverx = client.guilds.cache.get(DiscordChannelID);
const channelx = client.guilds.cache.get(DiscordChannelID).channels.cache.find(channel => channel.name === ComePlayChannelName);
const rolex = client.guilds.cache.get(DiscordChannelID).roles.cache.find(role => role.name === RoleName);
// const rolexz = client.guilds.cache.get(DiscordChannelID).roles.cache.find(role => role.name === 'Status');
// console.log('Rolex: ', rolex);
// const permissions = client.guilds.cache.get(DiscordChannelID).me.permissionsIn(channelx);
......@@ -923,9 +925,9 @@ function ComePlayNotifier() {
console.log(DateAndTime + ': ' + 'Both permissions OK');
// server.member(userx).roles.add(rolex).catch(console.error);
// message.channel.send('You have been added to come-play channel\n' + 'Link to the channel: https://discordapp.com/channels/' + DiscordChannelID + '/' + channelx.id);
// add @here
channelx.send('@here**```Game is happening, come play!```**' + messageComePlayNotifServers + QuickPlayLink).catch(console.error);
console.log(DateAndTime + ': ' + '@hereGame is happening, come play!' + messageComePlayNotifServers + QuickPlayLink);
// add @Come-Play
channelx.send('<@&' + rolex + '>**```Game is happening, come play!```**' + messageComePlayNotifServers + QuickPlayLink).catch(console.error);
console.log(DateAndTime + ': ' + '<@&' + rolex + '>Game is happening, come play!' + messageComePlayNotifServers + QuickPlayLink);
fs.unlink(path, (err) => {
if (err) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment