(presumably) add role awarding for @apex & @genshin
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
const { Message } = require("discord.js");
|
const { Message } = require('discord.js');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'admin',
|
name: 'admin',
|
||||||
@@ -6,18 +6,29 @@ module.exports = {
|
|||||||
args: false,
|
args: false,
|
||||||
guildOnly: true,
|
guildOnly: true,
|
||||||
execute(msg, args, Discord, config, client) {
|
execute(msg, args, Discord, config, client) {
|
||||||
if(msg.member.roles.cache.find(role => role.name == 'moderacja')){
|
if (msg.member.roles.cache.find((role) => role.name == 'moderacja')) {
|
||||||
msg.delete();
|
msg.delete();
|
||||||
switch (args[0]) {
|
switch (args[0]) {
|
||||||
case 'witaj': {
|
case 'witaj': {
|
||||||
const witajEmbed = new Discord.MessageEmbed()
|
const witajEmbed = new Discord.MessageEmbed()
|
||||||
.setTitle('Witajcie w Gractwie!')
|
.setTitle('Witajcie w Gractwie!')
|
||||||
.setDescription('Jesteśmy grupą ludzi, których kręcą gry. Proste, nie?\nSerwer ten miał wcześniej tematykę Team Fortressową.')
|
.setDescription(
|
||||||
|
'Jesteśmy grupą ludzi, których kręcą gry. Proste, nie?\nSerwer ten miał wcześniej tematykę Team Fortressową.'
|
||||||
|
)
|
||||||
.setColor(config.embedColor)
|
.setColor(config.embedColor)
|
||||||
.addField('Zasady','Zasady serwera są spisane na kanale `#regulamin`. Pamiętajcie, by tam zajrzeć.')
|
.addField(
|
||||||
|
'Zasady',
|
||||||
|
'Zasady serwera są spisane na kanale `#regulamin`. Pamiętajcie, by tam zajrzeć.'
|
||||||
|
)
|
||||||
.addField('Gractwo WWW', '`gractwo.pl`')
|
.addField('Gractwo WWW', '`gractwo.pl`')
|
||||||
.addField('Gractwo DISCORD','`gractwo.pl/discord` lub `gractwo.pl/dc` lub `discord.gg/NBXq95C`')
|
.addField(
|
||||||
.addField('Gractwo FACEBOOK','`gractwo.pl/facebook` lub `gractwo.pl/fb` lub `facebook.com/groups/gractwo`')
|
'Gractwo DISCORD',
|
||||||
|
'`gractwo.pl/discord` lub `gractwo.pl/dc` lub `discord.gg/NBXq95C`'
|
||||||
|
)
|
||||||
|
.addField(
|
||||||
|
'Gractwo FACEBOOK',
|
||||||
|
'`gractwo.pl/facebook` lub `gractwo.pl/fb` lub `facebook.com/groups/gractwo`'
|
||||||
|
)
|
||||||
.attachFiles('./gractwo.png')
|
.attachFiles('./gractwo.png')
|
||||||
.setFooter('#witaj', 'attachment://gractwo.png')
|
.setFooter('#witaj', 'attachment://gractwo.png')
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
@@ -27,7 +38,9 @@ module.exports = {
|
|||||||
case 'rolki': {
|
case 'rolki': {
|
||||||
const rolkiEmbed = new Discord.MessageEmbed()
|
const rolkiEmbed = new Discord.MessageEmbed()
|
||||||
.setTitle('Nadawanie Ról')
|
.setTitle('Nadawanie Ról')
|
||||||
.setDescription('#rolki jest kanałem do przyznawania sobie ról.\nDostępne role: `tf2`, `liga`, `csgo`, `minecraft`, `rainbow-six`.\n\nRole te służą do pingowania na poszczególnych kanałach, by zebrać ludzi chętnych do gry bądź zainteresowanych pewnym wydarzeniem.\n\nBy przydzielić sobie rolę, po prostu wpisz ją na czacie! Jest on czyszczony zaraz po. Aby pozbyć się roli, wystarczy wpisać jej nazwę jeszcze raz.')
|
.setDescription(
|
||||||
|
'#rolki jest kanałem do przyznawania sobie ról.\nDostępne role: `tf2`, `liga`, `csgo`, `minecraft`, `rainbow-six`, `apex`, `genshin`.\n\nRole te służą do pingowania na poszczególnych kanałach, by zebrać ludzi chętnych do gry bądź zainteresowanych pewnym wydarzeniem.\n\nBy przydzielić sobie rolę, po prostu wpisz ją na czacie! Jest on czyszczony zaraz po. Aby pozbyć się roli, wystarczy wpisać jej nazwę jeszcze raz.'
|
||||||
|
)
|
||||||
.setColor(config.embedColor)
|
.setColor(config.embedColor)
|
||||||
.attachFiles('./gractwo.png')
|
.attachFiles('./gractwo.png')
|
||||||
.setFooter('#rolki', 'attachment://gractwo.png')
|
.setFooter('#rolki', 'attachment://gractwo.png')
|
||||||
@@ -38,11 +51,22 @@ module.exports = {
|
|||||||
case 'botannouncement': {
|
case 'botannouncement': {
|
||||||
const botAnnouncementEmbed = new Discord.MessageEmbed()
|
const botAnnouncementEmbed = new Discord.MessageEmbed()
|
||||||
.setTitle('Hej,')
|
.setTitle('Hej,')
|
||||||
.setDescription('W ciągu ostatnich trzech dni zostałem stworzony ja - bot Gractwa.')
|
.setDescription(
|
||||||
|
'W ciągu ostatnich trzech dni zostałem stworzony ja - bot Gractwa.'
|
||||||
|
)
|
||||||
.setColor(config.embedColor)
|
.setColor(config.embedColor)
|
||||||
.addField('Moja funkcja','Zastąpiłem wiadomości na kanałach `#witaj` i `#regulamin`, serwisuję również `#rolki`.')
|
.addField(
|
||||||
.addField('Zmiany',`Wraz z moim przybyciem zostało uproszczone nasze logo, w regulaminie czekają na Was dwie nowe zasady (niezbyt restrykcyjne ;3), forma serwera została uproszczona.`)
|
'Moja funkcja',
|
||||||
.addField('Rolki? Co?', `Rolki To!\n\nMogą one być wykorzystywane do zbierania osób do grania/rozmów. Było to coś o co poproszono naszą administrację już dawno temu. Dziś jest to już dla Was dostępne!`)
|
'Zastąpiłem wiadomości na kanałach `#witaj` i `#regulamin`, serwisuję również `#rolki`.'
|
||||||
|
)
|
||||||
|
.addField(
|
||||||
|
'Zmiany',
|
||||||
|
`Wraz z moim przybyciem zostało uproszczone nasze logo, w regulaminie czekają na Was dwie nowe zasady (niezbyt restrykcyjne ;3), forma serwera została uproszczona.`
|
||||||
|
)
|
||||||
|
.addField(
|
||||||
|
'Rolki? Co?',
|
||||||
|
`Rolki To!\n\nMogą one być wykorzystywane do zbierania osób do grania/rozmów. Było to coś o co poproszono naszą administrację już dawno temu. Dziś jest to już dla Was dostępne!`
|
||||||
|
)
|
||||||
.attachFiles('./gractwo.png')
|
.attachFiles('./gractwo.png')
|
||||||
.setFooter(`by j4mesen`, 'attachment://gractwo.png')
|
.setFooter(`by j4mesen`, 'attachment://gractwo.png')
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
|
|||||||
58
index.js
58
index.js
@@ -1,40 +1,42 @@
|
|||||||
require("dotenv").config();
|
require('dotenv').config();
|
||||||
const Discord = require("discord.js");
|
const Discord = require('discord.js');
|
||||||
const config = require("./config.json");
|
const config = require('./config.json');
|
||||||
const fs = require("fs");
|
const fs = require('fs');
|
||||||
|
|
||||||
const client = new Discord.Client();
|
const client = new Discord.Client();
|
||||||
client.commands = new Discord.Collection();
|
client.commands = new Discord.Collection();
|
||||||
|
|
||||||
const commandFiles = fs
|
const commandFiles = fs
|
||||||
.readdirSync("./commands")
|
.readdirSync('./commands')
|
||||||
.filter((file) => file.endsWith(".js"));
|
.filter((file) => file.endsWith('.js'));
|
||||||
|
|
||||||
for (const file of commandFiles) {
|
for (const file of commandFiles) {
|
||||||
const command = require(`./commands/${file}`);
|
const command = require(`./commands/${file}`);
|
||||||
client.commands.set(command.name, command);
|
client.commands.set(command.name, command);
|
||||||
}
|
}
|
||||||
|
|
||||||
client.once("ready", () => {
|
client.once('ready', () => {
|
||||||
console.log(
|
console.log(
|
||||||
"-------------------------------------\nTHE BOT IS READY TO GO.\n-------------------------------------"
|
'-------------------------------------\nTHE BOT IS READY TO GO.\n-------------------------------------'
|
||||||
);
|
);
|
||||||
client.user.setActivity(".ping", { type: "LISTENING" });
|
client.user.setActivity('.ping', { type: 'LISTENING' });
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on("message", (message) => {
|
client.on('message', (message) => {
|
||||||
/* OMITTING THE COMMAND HANDLER TO CATCH ANY AND ALL MESSAGES IN THE '#rolki' CHANNEL
|
/* OMITTING THE COMMAND HANDLER TO CATCH ANY AND ALL MESSAGES IN THE '#rolki' CHANNEL
|
||||||
MAKING 'tf2' A VIABLE COMMAND WITHOUT A PREFIX */
|
MAKING 'tf2' A VIABLE COMMAND WITHOUT A PREFIX */
|
||||||
|
|
||||||
if (message.channel.name == "rolki") {
|
if (message.channel.name == 'rolki') {
|
||||||
if (message.author.bot) return;
|
if (message.author.bot) return;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
message.content == "tf2" ||
|
message.content == 'tf2' ||
|
||||||
message.content == "liga" ||
|
message.content == 'liga' ||
|
||||||
message.content == "csgo" ||
|
message.content == 'csgo' ||
|
||||||
message.content == "minecraft" ||
|
message.content == 'minecraft' ||
|
||||||
message.content == "rainbow-six"
|
message.content == 'rainbow-six' ||
|
||||||
|
message.content == 'apex' ||
|
||||||
|
message.content == 'genshin'
|
||||||
) {
|
) {
|
||||||
const role = message.member.guild.roles.cache.find(
|
const role = message.member.guild.roles.cache.find(
|
||||||
(role) => role.name == message.content
|
(role) => role.name == message.content
|
||||||
@@ -52,8 +54,8 @@ client.on("message", (message) => {
|
|||||||
`Odebrano Ci rangę ${message.content}, ${message.author.username}.`
|
`Odebrano Ci rangę ${message.content}, ${message.author.username}.`
|
||||||
)
|
)
|
||||||
.setColor(config.embedColor)
|
.setColor(config.embedColor)
|
||||||
.attachFiles("./gractwo.png")
|
.attachFiles('./gractwo.png')
|
||||||
.setFooter("#rolki", "attachment://gractwo.png")
|
.setFooter('#rolki', 'attachment://gractwo.png')
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
message.channel
|
message.channel
|
||||||
.send(removeRolesEmbed)
|
.send(removeRolesEmbed)
|
||||||
@@ -70,8 +72,8 @@ client.on("message", (message) => {
|
|||||||
`Przyznano Ci rangę ${message.content}, ${message.author.username}.`
|
`Przyznano Ci rangę ${message.content}, ${message.author.username}.`
|
||||||
)
|
)
|
||||||
.setColor(config.embedColor)
|
.setColor(config.embedColor)
|
||||||
.attachFiles("./gractwo.png")
|
.attachFiles('./gractwo.png')
|
||||||
.setFooter("#rolki", "attachment://gractwo.png")
|
.setFooter('#rolki', 'attachment://gractwo.png')
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
message.channel
|
message.channel
|
||||||
.send(addRolesEmbed)
|
.send(addRolesEmbed)
|
||||||
@@ -80,7 +82,7 @@ client.on("message", (message) => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (
|
if (
|
||||||
!message.member.roles.cache.find((role) => role.name == "Moderatorzy")
|
!message.member.roles.cache.find((role) => role.name == 'Moderatorzy')
|
||||||
) {
|
) {
|
||||||
console.log(
|
console.log(
|
||||||
`${message.author.username} spammed the rolki channel with a bad message`
|
`${message.author.username} spammed the rolki channel with a bad message`
|
||||||
@@ -89,8 +91,8 @@ client.on("message", (message) => {
|
|||||||
const rolkiWrongMessageEmbed = new Discord.MessageEmbed()
|
const rolkiWrongMessageEmbed = new Discord.MessageEmbed()
|
||||||
.setTitle(`To nie jest kanał na pisanie, ${message.author.username}`)
|
.setTitle(`To nie jest kanał na pisanie, ${message.author.username}`)
|
||||||
.setColor(config.embedColorFail)
|
.setColor(config.embedColorFail)
|
||||||
.attachFiles("./gractwo.png")
|
.attachFiles('./gractwo.png')
|
||||||
.setFooter("#rolki", "attachment://gractwo.png")
|
.setFooter('#rolki', 'attachment://gractwo.png')
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
message.channel
|
message.channel
|
||||||
.send(rolkiWrongMessageEmbed)
|
.send(rolkiWrongMessageEmbed)
|
||||||
@@ -101,10 +103,10 @@ client.on("message", (message) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message.content.toLowerCase() === "!rank")
|
if (message.content.toLowerCase() === '!rank')
|
||||||
message.channel.send({
|
message.channel.send({
|
||||||
files: [
|
files: [
|
||||||
"https://cdn.discordapp.com/attachments/281070649374670849/871103257580281876/tenor.gif",
|
'https://cdn.discordapp.com/attachments/281070649374670849/871103257580281876/tenor.gif',
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -118,7 +120,7 @@ client.on("message", (message) => {
|
|||||||
if (!client.commands.has(commandName)) return;
|
if (!client.commands.has(commandName)) return;
|
||||||
const command = client.commands.get(commandName);
|
const command = client.commands.get(commandName);
|
||||||
|
|
||||||
if (command.guildOnly && message.channel.type === "dm") {
|
if (command.guildOnly && message.channel.type === 'dm') {
|
||||||
return message.reply("I can't execute that command inside DMs!");
|
return message.reply("I can't execute that command inside DMs!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,14 +134,14 @@ client.on("message", (message) => {
|
|||||||
command.execute(message, args, Discord, config, client);
|
command.execute(message, args, Discord, config, client);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
message.reply("there was an error trying to execute that command.");
|
message.reply('there was an error trying to execute that command.');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
client.login(process.env.BOT_TOKEN).then(() => getStatus());
|
client.login(process.env.BOT_TOKEN).then(() => getStatus());
|
||||||
|
|
||||||
// Funne API hehehehe
|
// Funne API hehehehe
|
||||||
const http = require("http");
|
const http = require('http');
|
||||||
const port = process.env.PORT || 3000;
|
const port = process.env.PORT || 3000;
|
||||||
|
|
||||||
let status;
|
let status;
|
||||||
|
|||||||
Reference in New Issue
Block a user