Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10823b416c | ||
|
|
4490920ac6 | ||
|
|
e0b8ad4a32 | ||
|
|
e11063832b | ||
|
|
d598fdd753 | ||
|
|
157b93239a | ||
|
|
3d7058dccd | ||
|
|
1ec654d1ea | ||
|
|
8ce2d4269d | ||
|
|
49e8aa7869 | ||
|
|
0827f55d43 | ||
|
|
ba6ff8c342 | ||
|
|
c0b7dc2737 |
No files matched your search
@@ -0,0 +1,32 @@
|
|||||||
|
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
||||||
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
||||||
|
|
||||||
|
name: Node.js CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [10.x, 12.x, 14.x, 15.x]
|
||||||
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm install discord.js --save
|
||||||
|
- run: npm install js-yaml
|
||||||
|
- run: npm run build --if-present
|
||||||
|
- run: node index.js
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
// SupportBot, Created by Emerald Services
|
||||||
|
// Blacklist Command
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
const { execute } = require("./help");
|
||||||
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name: supportbot.BlacklistUser,
|
||||||
|
description: supportbot.BlacklistDesc,
|
||||||
|
|
||||||
|
execute(message, args) {
|
||||||
|
if (supportbot.DeleteMessages == "true") message.delete();
|
||||||
|
|
||||||
|
let SupportStaff = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Admin);
|
||||||
|
|
||||||
|
console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `${message.author.tag} has executed ${supportbot.Prefix}${supportbot.BlacklistUser}!`);
|
||||||
|
|
||||||
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${SupportStaff.name}\``)
|
||||||
|
.setColor(supportbot.WarningColour)
|
||||||
|
|
||||||
|
if (!message.member.roles.cache.has(SupportStaff.id)) {
|
||||||
|
return message.channel.send({ embed: NoPerms });
|
||||||
|
}
|
||||||
|
|
||||||
|
let locateChannel = message.guild.channels.cache.find(ModLogChannel => ModLogChannel.name === supportbot.ModLogChannel);
|
||||||
|
|
||||||
|
const user = message.mentions.members.first() || message.guild.members.cache.get(args[0]);
|
||||||
|
|
||||||
|
const errornochannel = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Invalid Channel")
|
||||||
|
.setDescription(`${supportbot.InvalidChannel}\n\nChannel Required: \`${supportbot.ModLogChannel}\``)
|
||||||
|
.setColor(supportbot.ErrorColour);
|
||||||
|
|
||||||
|
if(!locateChannel) return message.channel.send({ embed: errornochannel });
|
||||||
|
|
||||||
|
const embed1 = new Discord.MessageEmbed()
|
||||||
|
.setDescription("> :x: Please mention or write an ID\n\n`Try Again!`")
|
||||||
|
.setColor(supportbot.ErrorColour)
|
||||||
|
|
||||||
|
if (!args[0]) return message.channel.send({
|
||||||
|
embed: embed1
|
||||||
|
});
|
||||||
|
|
||||||
|
const embed2 = new Discord.MessageEmbed()
|
||||||
|
.setDescription("> :detective: **Hmm!** Can\'t seem tp find this user.\n\n`Are they in the server?`")
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
|
||||||
|
if (!user) return message.channel.send({
|
||||||
|
embed: embed2
|
||||||
|
});
|
||||||
|
|
||||||
|
let role = message.guild.roles.cache.find(role => role.name === supportbot.TicketBlackListRole) || message.guild.roles.cache.find(role => role.id === supportbot.TicketBlackListRole)
|
||||||
|
|
||||||
|
const embed3 = new Discord.MessageEmbed()
|
||||||
|
.setDescription("> :detective: **Hmm!** Can\'t seem to find the blacklist role.\n\n`Did you created it?")
|
||||||
|
.setColor(supportbot.ErrorColour)
|
||||||
|
|
||||||
|
|
||||||
|
if (!role) return message.channel.send({
|
||||||
|
embed: embed3
|
||||||
|
});
|
||||||
|
|
||||||
|
const embed4 = new Discord.MessageEmbed()
|
||||||
|
.setDescription(`${user} is already blacklisted`)
|
||||||
|
.setColor(supportbot.ErrorColour)
|
||||||
|
|
||||||
|
if(user.roles.cache.find(role => role.name === supportbot.TicketBlackListRole) || reactionUser.roles.cache.find(role => role.id === supportbot.TicketBlackListRole)) {
|
||||||
|
return message.channel.send({
|
||||||
|
embed: embed4
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
user.roles.add(role);
|
||||||
|
|
||||||
|
const embed5 = new Discord.MessageEmbed()
|
||||||
|
.setDescription(`Blacklisted ${user} successfully from creating a ticket`)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
|
||||||
|
message.channel.send({
|
||||||
|
embed: embed5
|
||||||
|
});
|
||||||
|
|
||||||
|
const logEmbed = new Discord.MessageEmbed()
|
||||||
|
.setTitle(supportbot.BlacklistTitle)
|
||||||
|
.setThumbnail(supportbot.ModThumbnail)
|
||||||
|
.addField('Banned User:', user)
|
||||||
|
.addField('Staff Member', message.author)
|
||||||
|
.setFooter(supportbot.EmbedFooter)
|
||||||
|
.setColor(supportbot.BlacklistColour)
|
||||||
|
.setTimestamp()
|
||||||
|
|
||||||
|
locateChannel.send({ embed: logEmbed });
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
@@ -35,6 +35,7 @@ module.exports = {
|
|||||||
staffCommands += `**${supportbot.Prefix}${supportbot.AnnounceCommand}** ${supportbot.AnnounceDesc} \`Admin Only\`\n`
|
staffCommands += `**${supportbot.Prefix}${supportbot.AnnounceCommand}** ${supportbot.AnnounceDesc} \`Admin Only\`\n`
|
||||||
staffCommands += `**${supportbot.Prefix}${supportbot.BanUser}** ${supportbot.BanDesc} \`Admin Only\` \n`
|
staffCommands += `**${supportbot.Prefix}${supportbot.BanUser}** ${supportbot.BanDesc} \`Admin Only\` \n`
|
||||||
staffCommands += `**${supportbot.Prefix}${supportbot.KickUser}** ${supportbot.KickDesc} \`Admin Only\` \n`
|
staffCommands += `**${supportbot.Prefix}${supportbot.KickUser}** ${supportbot.KickDesc} \`Admin Only\` \n`
|
||||||
|
staffCommands += `**${supportbot.Prefix}${supportbot.BlacklistUser}** ${supportbot.BlacklistDesc} \`Admin Only\` \n`
|
||||||
|
|
||||||
const HelpEmbed1 = new Discord.MessageEmbed()
|
const HelpEmbed1 = new Discord.MessageEmbed()
|
||||||
.setTitle(supportbot.Bot_Name)
|
.setTitle(supportbot.Bot_Name)
|
||||||
|
|||||||
@@ -21,6 +21,15 @@ module.exports = {
|
|||||||
if (!message.channel.name === supportbot.ReactionChannel) {
|
if (!message.channel.name === supportbot.ReactionChannel) {
|
||||||
if (supportbot.DeleteMessages == "true") message.delete();
|
if (supportbot.DeleteMessages == "true") message.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let reactionUser = message.guild.members.cache.get(message.author.id)
|
||||||
|
|
||||||
|
if (reactionUser.roles.cache.find(role => role.name === supportbot.TicketBlackListRole) || reactionUser.roles.cache.find(role => role.id === supportbot.TicketBlackListRole)) {
|
||||||
|
return message.channel.send(`<@${message.author.id}> ${supportbot.TicketBlackListMessage}`).then(msg => {
|
||||||
|
msg.delete({timeout: 3500})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `${message.author.tag} has executed ${supportbot.Prefix}${supportbot.NewTicket}!`);
|
console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `${message.author.tag} has executed ${supportbot.Prefix}${supportbot.NewTicket}!`);
|
||||||
|
|
||||||
|
|||||||
@@ -22,9 +22,10 @@ module.exports = async (bot, member) => {
|
|||||||
member.roles.add(role).catch(console.error);
|
member.roles.add(role).catch(console.error);
|
||||||
|
|
||||||
if (supportbot.SystemMessage_Type === "embed") {
|
if (supportbot.SystemMessage_Type === "embed") {
|
||||||
|
|
||||||
const GuildAddMember = new Discord.MessageEmbed()
|
const GuildAddMember = new Discord.MessageEmbed()
|
||||||
.setTitle(supportbot.Welcome_Title)
|
.setTitle(supportbot.Welcome_Title)
|
||||||
.setDescription(supportbot.WelcomeMessage.replace(/%member%/g, member.user.id).replace(/%guildname%/g, member.guild.name))
|
.setDescription(supportbot.WelcomeMessage.replace(/%member%/g, `<@!${member.user.id}>`).replace(/%guildname%/g, member.guild.name))
|
||||||
.setColor(supportbot.EmbedColour)
|
.setColor(supportbot.EmbedColour)
|
||||||
|
|
||||||
if (supportbot.SystemMessage_Icon === "BOT") {
|
if (supportbot.SystemMessage_Icon === "BOT") {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
// /_______ /____/| __/| __/ \____/|__| |__| |______ /\____/|__|
|
// /_______ /____/| __/| __/ \____/|__| |__| |______ /\____/|__|
|
||||||
// \/ |__| |__| \/
|
// \/ |__| |__| \/
|
||||||
//
|
//
|
||||||
// SupportBot version 6.1
|
// SupportBot version 6.4
|
||||||
// Created by Emerald Services
|
// Created by Emerald Services
|
||||||
// Installed with MIT License
|
// Installed with MIT License
|
||||||
//
|
//
|
||||||
@@ -89,4 +89,4 @@ fs.readdir("./addons/", (err, files) => {
|
|||||||
console.info(`\u001b[37m`, "-----------------------------------------------------------------------------");
|
console.info(`\u001b[37m`, "-----------------------------------------------------------------------------");
|
||||||
});
|
});
|
||||||
|
|
||||||
bot.login(supportbot.Token);
|
bot.login(supportbot.Token);
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "supportbot",
|
"name": "supportbot",
|
||||||
"version": "6.1",
|
"version": "6.4",
|
||||||
"description": "SupportBot | #1 Self-Hosted Ticket Bot",
|
"description": "SupportBot | #1 Self-Hosted Ticket Bot",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
# /_______ /____/| __/| __/ \____/|__| |__| |______ /\____/|__|
|
# /_______ /____/| __/| __/ \____/|__| |__| |______ /\____/|__|
|
||||||
# \/ |__| |__| \/
|
# \/ |__| |__| \/
|
||||||
#
|
#
|
||||||
# SupportBot version 6.1
|
# SupportBot version 6.4
|
||||||
# Created by Emerald Services
|
# Created by Emerald Services
|
||||||
# Installed with MIT License
|
# Installed with MIT License
|
||||||
#
|
#
|
||||||
@@ -44,6 +44,7 @@ LockdownRole: "@everyone"
|
|||||||
|
|
||||||
Staff: "Staff"
|
Staff: "Staff"
|
||||||
Admin: "Administration"
|
Admin: "Administration"
|
||||||
|
TicketBlackListRole: "Blacklisted"
|
||||||
|
|
||||||
# Ticket Configuration
|
# Ticket Configuration
|
||||||
|
|
||||||
@@ -78,6 +79,7 @@ TicketMessage: "Hello <@%ticketauthor%>, Thank you for creating a support ticket
|
|||||||
NoTicketSubject: "No Reason Provided!"
|
NoTicketSubject: "No Reason Provided!"
|
||||||
TicketCreatedAlert: ":ticket: Your support ticket has been created: <#%ticketid%>"
|
TicketCreatedAlert: ":ticket: Your support ticket has been created: <#%ticketid%>"
|
||||||
TranscriptTitle: "Ticket Transcript"
|
TranscriptTitle: "Ticket Transcript"
|
||||||
|
TicketBlackListMessage: "You are not allowed to open a ticket"
|
||||||
|
|
||||||
AddedUser: "👍 <@%user%> has been added to this ticket"
|
AddedUser: "👍 <@%user%> has been added to this ticket"
|
||||||
RemovedUser: "👍 <@%user%> has been removed from this ticket"
|
RemovedUser: "👍 <@%user%> has been removed from this ticket"
|
||||||
@@ -171,6 +173,9 @@ PruneLogTitle: "Bulk Delete"
|
|||||||
PruneThumbnail: "https://i.imgur.com/OAgW2vR.png"
|
PruneThumbnail: "https://i.imgur.com/OAgW2vR.png"
|
||||||
PruneColour: "#1BA30C"
|
PruneColour: "#1BA30C"
|
||||||
|
|
||||||
|
BlacklistTitle: "Blacklisted User"
|
||||||
|
BlacklistColour: "#000000"
|
||||||
|
|
||||||
|
|
||||||
# General Command Configuration
|
# General Command Configuration
|
||||||
|
|
||||||
@@ -197,6 +202,7 @@ PurgeMessage: "purge"
|
|||||||
AnnounceCommand: "announce"
|
AnnounceCommand: "announce"
|
||||||
BanUser: "ban"
|
BanUser: "ban"
|
||||||
KickUser: "kick"
|
KickUser: "kick"
|
||||||
|
BlacklistUser: "blacklist"
|
||||||
|
|
||||||
# Commmand Descriptions
|
# Commmand Descriptions
|
||||||
|
|
||||||
@@ -213,6 +219,7 @@ BotSayDesc: "Say something with the bot"
|
|||||||
BanDesc: "Ban a member from this server."
|
BanDesc: "Ban a member from this server."
|
||||||
KickDesc: "Kick a member from this server."
|
KickDesc: "Kick a member from this server."
|
||||||
PurgeDesc: "Purge messages from the chat."
|
PurgeDesc: "Purge messages from the chat."
|
||||||
|
BlacklistDesc: "Decline a member to open a ticket"
|
||||||
|
|
||||||
# Error / Warining Messages
|
# Error / Warining Messages
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user