Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
Izocel committed May 11, 2024
1 parent e0795e5 commit e3c13df
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 25 deletions.
15 changes: 9 additions & 6 deletions src/class/appClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ import {
Collection,
Interaction,
ClientEvents,
ThreadChannelType,
GatewayIntentBits,
Partials
} from "discord.js";
import { client, ytFetch } from "..";
import { ytFetch } from "..";
import { PathLike } from "fs";
import { Event } from "./event";
import { CommandType } from "../typings/command";
Expand Down Expand Up @@ -70,7 +69,7 @@ export class AppClient extends Client {
// Commands
const coreCommands = await this.getSlashCommandsFromDir(`${__dirname}/../commands/`);
const pluginsCommands = await this.registerPlugins();

const publics = [...coreCommands?.publics, ...pluginsCommands?.publics];
const privates = [...coreCommands?.privates, ...pluginsCommands?.privates];

Expand Down Expand Up @@ -152,7 +151,7 @@ export class AppClient extends Client {
try {
this.guilds.cache.get(guildId)?.commands.set(commands);
console.info(`\nRegistered ${commands.length} commands to ${guildId}`);
} catch {}
} catch { }

return;
}
Expand Down Expand Up @@ -208,15 +207,19 @@ export class AppClient extends Client {

const command: CommandType = await importFile(filePath);

if (!command.name) continue;
if (!command?.name) {
console.error("Error a command import:");
console.error(command);
continue;
};

this.emit('debug', JSON.stringify(command));
this.commands.set(command.name, command);
command.public
? publics.push(command)
: privates.push(command);
}

console.info(dirPath, { publics, privates })
return { publics, privates };
}

Expand Down
9 changes: 5 additions & 4 deletions src/commands/banner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ export default new Command({
const type = args.getInteger("type", false) ? "goodbye" : "welcome";
const channel = args.getChannel('channel', false, [ChannelType.GuildText])
?? guild.systemChannel;

channel.sendTyping();
interaction.channel.sendTyping();

interaction?.channel?.sendTyping();
await sendBanner(member, type, channel);
interaction.reply({ content: "Done!", ephemeral: true });
} catch (error) {
Expand All @@ -53,7 +52,8 @@ export async function sendBanner(
interaction?: any) {

if (!member || member.user.bot) return;


debugger
const defConfigs = getGuildConfigsById("default");
const guildConfigs = getGuildConfigsById(member.guild.id) ?? defConfigs;

Expand All @@ -73,6 +73,7 @@ export async function sendBanner(
: member.guild.systemChannel;
channel = channelOverride ? channelOverride : channel;

debugger
const card = await newCard.render(member, cardData.getTitle(), cardData.getMsg({ member }));
return await DiscordManager.guildSend(channel, {
content: getContent({ member }),
Expand Down
28 changes: 14 additions & 14 deletions src/helpers/themeHelper.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import { PATHS } from "..";
import { getRndInteger } from "./helpers";

export class ThemeHelper {

BackgroundImages = {
WelcomerLightStyle: [
"assets/img/banners/light.png",
"assets/img/banners/light-1.png",
"assets/img/banners/light-2.png",
"assets/img/banners/light-3.png",
"assets/img/banners/light-4.png",
`${PATHS.banners}light.png`,
`${PATHS.banners}light-1.png`,
`${PATHS.banners}light-2.png`,
`${PATHS.banners}light-3.png`,
`${PATHS.banners}light-4.png`,
],
WelcomerDarkStyle: [
"assets/img/banners/dark.png",
"assets/img/banners/dark-1.png",
"assets/img/banners/dark-2.png",
"assets/img/banners/dark-3.png",
`${PATHS.banners}dark.png`,
`${PATHS.banners}dark-1.png`,
`${PATHS.banners}dark-2.png`,
`${PATHS.banners}dark-3.png`,
],
WelcomerCustomStyle: [
"assets/img/banners/custom.png",
"assets/img/banners/custom-1.png",
"assets/img/banners/custom-2.png",
"assets/img/banners/custom-3.png",
`${PATHS.banners}custom.png`,
`${PATHS.banners}custom-1.png`,
`${PATHS.banners}custom-2.png`,
`${PATHS.banners}custom-3.png`,
],
}

Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const PATHS = {
root: `${rootDir}/`,
shells: `${rootDir}/shells/`,
bashes: `${rootDir}/shells/bash/`,
banners: `${rootDir}/assets/img/banners/`
};

export const sentryHelper = new SentryHelper().init();
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"services",
"plugins",
"environments.d.ts",
"plugins"
],
"exclude": [
"node_modules",
Expand Down

0 comments on commit e3c13df

Please sign in to comment.