Compare commits

...
3 Commits
Author SHA1 Message Date
ItzEmerald ddc8bcab9b Pre-2 2021-08-05 13:40:19 +01:00
ItzEmerald 35dacfd48a Merge branch 'master' of https://github.com/1tzemerald/SupportBot 2021-08-05 13:39:48 +01:00
ItzEmerald 611cef34ab 7.1-Pre-2 2021-08-05 13:39:44 +01:00
8 changed files with 107 additions and 9 deletions

No files matched your search

Executable → Regular
+1 -1
View File
@@ -48,4 +48,4 @@ module.exports = {
}
};
};
+2 -1
View File
@@ -33,12 +33,13 @@ module.exports = {
staffCommands += `**${supportbot.Prefix}${supportbot.RemoveUser} <user#0000>** ${supportbot.RemoveUserDesc}\n`
staffCommands += `**${supportbot.Prefix}${supportbot.BotSay}** ${supportbot.BotSayDesc}\n`
staffCommands += `**${supportbot.Prefix}${supportbot.PurgeMessage}** ${supportbot.PurgeDesc}\n`
staffCommands += `**${supportbot.Prefix}${supportbot.ChatLog}** ${supportbot.ChatLogDesc}\n`
let adminCommands = "";
adminCommands += `**${supportbot.Prefix}${supportbot.AnnounceCommand}** ${supportbot.AnnounceDesc} \`Admin Only\`\n`
adminCommands += `**${supportbot.Prefix}${supportbot.BanUser}** ${supportbot.BanDesc} \`Admin Only\` \n`
adminCommands += `**${supportbot.Prefix}${supportbot.KickUser}** ${supportbot.KickDesc} \`Admin Only\` \n`
adminCommands += `**${supportbot.Prefix}${supportbot.BlacklistUser}** ${supportbot.BlacklistDesc} \`Admin Only\` \n`
adminCommands += `**${supportbot.Prefix}${supportbot.BlacklistUser}** ${supportbot.BlacklistDesc} \`Admin Only\` \n`
const HelpEmbed1 = new Discord.MessageEmbed()
.setTitle(supportbot.Bot_Name)
+13 -3
View File
@@ -40,10 +40,20 @@ module.exports = {
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter)
.setTitle(supportbot.SuggestionTitle)
.setDescription(`\`\`\`${suggestion}\`\`\``)
.addField(supportbot.SuggestionTitle, suggestion, true)
.addField("From", `<@${message.author.id}>`, true)
.addFields( { name: "From", value: `<@${message.author.id}>`, inline: false }, )
if (supportbot.SuggestionMessage_Icon === "BOT") {
SuggestionMessage.setThumbnail(bot.user.displayAvatarURL())
}
if (supportbot.SuggestionMessage_Icon === "USER") {
SuggestionMessage.setThumbnail(message.author.displayAvatarURL())
}
if (supportbot.SuggestionMessage_Icon === "CUSTOM") {
SuggestionMessage.setThumbnail(supportbot.SuggestionIcon_URL)
}
locateChannel.send({ embed: SuggestionMessage }).then(async function(msg) {
msg.react(supportbot.SuggestReact_1).then(() => msg.react(supportbot.SuggestReact_2));
+1 -1
View File
@@ -208,7 +208,7 @@ module.exports = {
.setColor(supportbot.ErrorColour);
const TicketLogs = new Discord.MessageEmbed()
.setTitle("Ticket Log")
.setTitle(supportbot.TicketLog_Title)
.setThumbnail(supportbot.Ticket_Thumbnail)
.addFields(
{ name: 'Ticket', value: `<#${channel.id}>` },
+66
View File
@@ -0,0 +1,66 @@
// SupportBot, Created by Emerald Services
// Announce
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.ChatLog,
description: supportbot.ChatLogDesc,
execute(message, args) {
if (supportbot.DeleteMessages) message.delete();
let name = message.channel.name;
message.channel.messages.fetch({ limit: 100 }).then( msgs => {
let html = '';
msgs = msgs.sort( ( a, b ) => a.createdTimestamp - b.createdTimestamp );
html += `<strong>--- Channel Transcript ---</strong><br>`;
html += `<strong>Server Name:</strong> ${message.guild.name}<br>`;
html += `<strong>Channel:</strong> ${name}<br>`;
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
msgs.forEach( msg => {
if ( msg.content ) {
html += `<strong>User:</strong> ${msg.author.tag}<br>`;
html += `<strong>Message:</strong> ${msg.content}<br>`;
html += `-----<br><br>`;
}
});
const TranscriptSavedEmbed = new Discord.MessageEmbed()
.setDescription(supportbot.ChatLogSavedMessage)
.setColor(supportbot.SuccessColour)
message.channel.send({embed: TranscriptSavedEmbed})
const errornochannel = new Discord.MessageEmbed()
.setTitle("SupportBot Error!")
.setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.TicketLog}\`\n\nError Code: \`SB-03\``)
.setColor(supportbot.ErrorColour);
const ChatLogs = new Discord.MessageEmbed()
.setTitle(supportbot.ChatLog_Title)
.setThumbnail(supportbot.ChatLog_Thumbnail)
.addFields(
{ name: 'Channel', value: `<#${message.channel.id}>` },
{ name: 'User', value: `<@${message.author.id}>` },
)
.setColor(supportbot.EmbedColour)
.setFooter(supportbot.EmbedFooter)
let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === supportbot.ChatLogChannel) || message.guild.channels.cache.find(LocateChannel => LocateChannel.id === supportbot.ChatLogChannel)
if(!locateChannel) return message.channel.send({ embed: errornochannel });
locateChannel.send( new Discord.MessageAttachment( Buffer.from( html ), `${name}.html` ) );
locateChannel.send({ embed: ChatLogs });
})
}
}
+4
View File
@@ -36,6 +36,10 @@ module.exports = async (bot, member) => {
GuildAddMember.setThumbnail(member.user.displayAvatarURL())
}
if (supportbot.SystemMessage_Icon === "CUSTOM") {
SuggestionMessage.setThumbnail(supportbot.SystemMessageIcon_URL)
}
if (supportbot.SystemMessage_EmbedFooter) {
GuildAddMember.setFooter(supportbot.EmbedFooter)
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "supportbot",
"version": "7.1-pre-1",
"version": "7.1-pre-2",
"description": "SupportBot, a free open-source discord ticket application with ease of use.",
"main": "index.js",
"scripts": {
+19 -2
View File
@@ -9,7 +9,7 @@
#
# Discord Support: https://emeraldsrv.dev/discord
SupportBot_Version: "7.1 pre-1"
SupportBot_Version: "7.1 pre-2"
# -------------------------
# General Configuration
@@ -78,6 +78,7 @@ TicketLog: "ticket-logs"
TranscriptLog: "transcripts"
TranscriptTitle: "Ticket Transcript"
TicketLog_Title: "Ticket Log"
TicketBlackListMessage: "You are not allowed to open a ticket"
TicketSubject: "description"
@@ -187,6 +188,8 @@ SystemMessage_Type: "embed"
SystemMessage_Icon: "USER"
# USER - This will display the user's icon of who joins.
# BOT - This will display the bot's icon when a someone joins.
# CUSTOM - This will allow you to use a custom image, set this below!
SystemMessageIcon_URL: "https://imgur.com/example.png"
Welcome_Title: "User Joined!"
WelcomeMessage: "Hello %member%, Welcome to %guildname%!"
@@ -220,6 +223,12 @@ SuggestionStarter: "What would you like to suggest?"
SuggestReact_1: 👍
SuggestReact_2: 👎
SuggestionMessage_Icon: "USER"
# USER - This will display the user's icon of who joins.
# BOT - This will display the bot's icon when a someone joins.
# CUSTOM - This will allow you to use a custom image, set this below!
SuggestionIcon_URL: "https://imgur.com/example.png"
# ----------------------------
# Announcement Configuration
# ----------------------------
@@ -234,6 +243,12 @@ AnnouncementStarter: "What would you like to announce?"
# Moderation Configuration
# --------------------------
ChatLog_Title: "Chat Log"
ChatLogChannel: "chat-logs"
ChatLogColour: "#1BA30C"
ChatLog_Thumbnail: "https://cdn.iconscout.com/icon/free/png-256/chat-2639493-2187526.png"
ChatLogSavedMessage: "📝 **Channel Transcript Saved!**"
BanTitle: "User Banned!"
DaysBannedFor: 7
BanLogColour: "#D911B4"
@@ -272,6 +287,7 @@ RenameTicket: "rename"
# --- Staff/Admin Commands ---
ChatLog: "transcript"
BotSay: "say"
PurgeMessage: "purge"
@@ -286,6 +302,8 @@ BlacklistUser: "blacklist"
# --- Command Messages ---
BotSayDesc: "Say something with the bot"
ChatLogDesc: "Get a transcript of a channel"
NewTicketDesc: "Create a new support ticket"
AnnounceDesc: "Create a server announcement"
CloseTicketDesc: "Close your support ticket"
@@ -295,7 +313,6 @@ HelpDesc: "Get a list of all the commands"
RemoveUserDesc: "Remove a user from a support ticket"
AddUserDesc: "Add a user to a support ticket"
SuggestionDesc: "Create a server suggestion"
BotSayDesc: "Say something with the bot"
BanDesc: "Ban a member from this server."
KickDesc: "Kick a member from this server."
PurgeDesc: "Purge messages from the chat."