Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57d420a9f4 | ||
|
|
f8cc08ba3e | ||
|
|
60d5c4cb1f | ||
|
|
0288e2f4de | ||
|
|
33d5a79759 | ||
|
|
30b89a3cf9 | ||
|
|
427dc2d040 |
No files matched your search
@@ -12,7 +12,7 @@
|
|||||||
#
|
#
|
||||||
# SupportBot Configuration (supportbot.yml)
|
# SupportBot Configuration (supportbot.yml)
|
||||||
|
|
||||||
SupportBot_Version: "v26.1 DEV-2"
|
SupportBot_Version: "v26.1.1"
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# General
|
# General
|
||||||
|
|||||||
+13
-10
@@ -8,7 +8,7 @@ const {
|
|||||||
TextDisplayBuilder,
|
TextDisplayBuilder,
|
||||||
SectionBuilder,
|
SectionBuilder,
|
||||||
ThumbnailBuilder,
|
ThumbnailBuilder,
|
||||||
AttachmentBuilder
|
MediaGalleryBuilder
|
||||||
} = require("discord.js");
|
} = require("discord.js");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const yaml = require("js-yaml");
|
const yaml = require("js-yaml");
|
||||||
@@ -35,12 +35,12 @@ function getWelcomeThumbnail(client, member, iconCfg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buildModernComponents(client, member) {
|
function buildModernComponents(client, member) {
|
||||||
const container = new ContainerBuilder()
|
const container = new ContainerBuilder();
|
||||||
|
|
||||||
if (msgconfig.Welcome.Modern.Colour) {
|
if (msgconfig.Welcome.Modern.Colour) {
|
||||||
container .setAccentColor(parseInt(msgconfig.Welcome.Modern.Colour.replace("#", ""), 16));
|
container.setAccentColor(parseInt(msgconfig.Welcome.Modern.Colour.replace("#", ""), 16));
|
||||||
}
|
}
|
||||||
|
|
||||||
const section = new SectionBuilder().addTextDisplayComponents(
|
const section = new SectionBuilder().addTextDisplayComponents(
|
||||||
new TextDisplayBuilder().setContent(
|
new TextDisplayBuilder().setContent(
|
||||||
msgconfig.Welcome.Modern.Title.replace(/%joined_user%/g, member.user)
|
msgconfig.Welcome.Modern.Title.replace(/%joined_user%/g, member.user)
|
||||||
@@ -60,11 +60,16 @@ function buildModernComponents(client, member) {
|
|||||||
|
|
||||||
container.addSectionComponents(section);
|
container.addSectionComponents(section);
|
||||||
|
|
||||||
|
// FIXED: Using MediaGalleryBuilder instead of TextDisplayBuilder for images
|
||||||
if (msgconfig.Welcome.Modern.Image?.Enabled && msgconfig.Welcome.Modern.Image.URL) {
|
if (msgconfig.Welcome.Modern.Image?.Enabled && msgconfig.Welcome.Modern.Image.URL) {
|
||||||
container.addTextDisplayComponents(
|
container.addMediaGalleryComponents(
|
||||||
new TextDisplayBuilder().setContent(
|
new MediaGalleryBuilder().addItems([
|
||||||
``
|
{
|
||||||
)
|
media: {
|
||||||
|
url: msgconfig.Welcome.Modern.Image.URL
|
||||||
|
}
|
||||||
|
}
|
||||||
|
])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,7 +86,6 @@ function buildModernComponents(client, member) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
container.addActionRowComponents(row);
|
container.addActionRowComponents(row);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return [container];
|
return [container];
|
||||||
@@ -150,5 +154,4 @@ module.exports = new Event("guildMemberAdd", async (client, member) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
console.log("\u001b[32m", "[+]", "\u001b[33m", `${member.user.username} joined the server!`);
|
console.log("\u001b[32m", "[+]", "\u001b[33m", `${member.user.username} joined the server!`);
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -60,26 +60,29 @@ class Client extends Discord.Client {
|
|||||||
|
|
||||||
async getChannel(channel, guild) {
|
async getChannel(channel, guild) {
|
||||||
if (!channel) return null;
|
if (!channel) return null;
|
||||||
|
const channelStr = String(channel).toLowerCase();
|
||||||
return guild.channels.cache.find(
|
return guild.channels.cache.find(
|
||||||
(c) =>
|
(c) =>
|
||||||
(c.type === Discord.ChannelType.GuildText || c.type === Discord.ChannelType.GuildNews) &&
|
(c.type === Discord.ChannelType.GuildText || c.type === Discord.ChannelType.GuildNews) &&
|
||||||
(c.id === channel || (c.name && c.name.toLowerCase() === channel.toLowerCase())),
|
(c.id === channel || (c.name && c.name.toLowerCase() === channelStr)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getRole(role, guild) {
|
async getRole(role, guild) {
|
||||||
if (!role) return null;
|
if (!role) return null;
|
||||||
|
const roleStr = String(role).toLowerCase();
|
||||||
return guild.roles.cache.find(
|
return guild.roles.cache.find(
|
||||||
(r) => r.id === role || (r.name && r.name.toLowerCase() === role.toLowerCase()),
|
(r) => r.id === role || (r.name && r.name.toLowerCase() === roleStr),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getCategory(category, guild) {
|
async getCategory(category, guild) {
|
||||||
if (!category) return null;
|
if (!category) return null;
|
||||||
|
const catStr = String(category).toLowerCase();
|
||||||
return guild.channels.cache.find(
|
return guild.channels.cache.find(
|
||||||
(c) =>
|
(c) =>
|
||||||
c.type === Discord.ChannelType.GuildCategory &&
|
c.type === Discord.ChannelType.GuildCategory &&
|
||||||
(c.id === category || (c.name && c.name.toLowerCase() === category.toLowerCase())),
|
(c.id === category || (c.name && c.name.toLowerCase() === catStr)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const APIServer = require("./API/server.js");
|
|||||||
|
|
||||||
client.start(supportbot.General.Token);
|
client.start(supportbot.General.Token);
|
||||||
|
|
||||||
client.once('ready', () => {
|
client.once('clientReady', () => {
|
||||||
const api = new APIServer(client);
|
const api = new APIServer(client);
|
||||||
api.start();
|
api.start();
|
||||||
});
|
});
|
||||||
@@ -77,14 +77,3 @@ process.on("unhandledRejection", (reason) => {
|
|||||||
process.on("uncaughtException", (err) => {
|
process.on("uncaughtException", (err) => {
|
||||||
console.error("Uncaught Exception:", err);
|
console.error("Uncaught Exception:", err);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "supportbot",
|
"name": "supportbot",
|
||||||
"version": "26.0.0-prerelease-1",
|
"version": "26.1.1",
|
||||||
"description": "SupportBot is an open-sourced support system for discord. It's completely free to use with high amounts of customization to match your own brand.",
|
"description": "SupportBot is an open-sourced support system for discord. It's completely free to use with high amounts of customization to match your own brand.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in new issue
Block a user