diff --git a/src/commands/admin/create-ticket-system.ts b/src/commands/admin/create-ticket-system.ts index 05ed7af..0482179 100644 --- a/src/commands/admin/create-ticket-system.ts +++ b/src/commands/admin/create-ticket-system.ts @@ -168,25 +168,22 @@ export class CreateTicketSystem { await threadChannel.members.add(owner) // close interaction - await interaction.reply({ + await interaction.editReply({ embeds: [ ticketCreatedEmbed({ username: interaction.user.username, threadChannelId: threadChannel.id, }), ], - ephemeral: true, }) } @ButtonComponent({ id: 'close-btn' }) async closeBtn(interaction: ButtonInteraction): Promise { - await interaction.deferReply({ ephemeral: true }) if (!interaction.channel) { await interaction.editReply('❌ Ticket channel does not exist') return } await interaction.channel.delete() - await interaction.editReply('Deleted ticket') } } diff --git a/src/commands/admin/set-welcome-channel.ts b/src/commands/admin/set-welcome-channel.ts index c6ec421..bb30427 100644 --- a/src/commands/admin/set-welcome-channel.ts +++ b/src/commands/admin/set-welcome-channel.ts @@ -1,4 +1,4 @@ -import { Discord, Slash, SlashOption } from 'discordx' +import { Client, Discord, Slash, SlashOption } from 'discordx' import { ApplicationCommandOptionType, CommandInteraction, @@ -7,6 +7,7 @@ import { } from 'discord.js' import { db, DBTableEnum } from '../../db' import { logger } from '../../lib' +import { Workload } from '../../utils' @Discord() export class SetWelcomeChannel { @@ -33,6 +34,31 @@ export class SetWelcomeChannel { interaction: CommandInteraction, ) { await interaction.deferReply({ ephemeral: true }) + + const portfolioChannelId = await db.get(DBTableEnum.PORTFOLIO_CHANNEL) + if (!portfolioChannelId) { + logger.error( + 'Missing portfolio channel', + 'Set using /set-portfolio-channel', + ) + await interaction.editReply( + '❌ Missing portfolio channel\nSet using /set-portfolio-channel', + ) + return + } + + const orderChannelId = await db.get(DBTableEnum.MAKE_AN_ORDER_CHANNEL) + if (!orderChannelId) { + logger.error( + 'Missing make an order channel', + 'Set using /set-order-channel', + ) + await interaction.editReply( + '❌ Missing make an order channel\nSet using /set-order-channel', + ) + return + } + await db .set(DBTableEnum.WELCOME_CHANNEL, channel.id) .catch(async () => { diff --git a/src/events/guildMemberAdd.ts b/src/events/guildMemberAdd.ts index 7993c0a..09171ee 100644 --- a/src/events/guildMemberAdd.ts +++ b/src/events/guildMemberAdd.ts @@ -1,6 +1,7 @@ import { ArgsOf, Discord, On } from 'discordx' import { EmbedBuilder, channelMention, userMention } from 'discord.js' import { db, DBTableEnum } from '../db' +import { logger } from '../lib' @Discord() export class GuildMemberAdd { @@ -34,7 +35,11 @@ export class GuildMemberAdd { content: `What's up, ${userMention(member.id)}`, }) - await member.roles.add(role) + try { + await member.roles.add(role) + } catch (e) { + logger.error('Role is too high', 'Bot role must be higher than the role it gives') + } } } } diff --git a/src/index.ts b/src/index.ts index be9c534..695d60f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,7 +22,7 @@ export const bot = new Client({ presence: { status: 'online', - activities: [{ name: 'Designing...', type: 3 }], + activities: [{ name: 'Designing stuff', type: 4 }], }, }) diff --git a/src/utils/embeds/payments.ts b/src/utils/embeds/payments.ts index 296e1e4..f701b53 100644 --- a/src/utils/embeds/payments.ts +++ b/src/utils/embeds/payments.ts @@ -5,7 +5,7 @@ export function paymentsEmbed() { { name: 'Crypto:', value: - 'Wallet number: `TRdGKNPABvoTrdwHgfUTX65DbqbguTh6cc`\n' + + 'Wallet number: `TEsLTpQnTgMHw4J1RaQHheYbCfuADXRns8`\n' + 'Crypto name: `USDT`\n' + 'Network name: `TRC20`', },