Skip to content

Commit 4d6c572

Browse files
author
xyzjesper
committed
Chnaged convertToEmojiToPng not need a client. Fixed Bugs from Bug Tracker. Fixed Ticker Module Interaction Errors. Fixed ticket related bugs. Fixed Embed-Editor-Remove-Select message edit.
1 parent 15afbe5 commit 4d6c572

File tree

397 files changed

+1638
-1676
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

397 files changed

+1638
-1676
lines changed

.env.example

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@ ENVIRONMENT="PRODUCTION"
55

66
# Disabled
77
SENTRY_AUTH_TOKEN=
8-
SENTRY_DSN=
8+
SENTRY_DSN=
9+
10+
# Database Help
11+
#
12+
# Add Migration - prisma migrate dev --name <name>
13+
# Deploy to Database - npx prisma migrate deploy
14+
# Read the Docs xD

prisma/schema.prisma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ model MessageTemplates {
605605
IsComponentsV2Message Boolean @default(false)
606606
OtherEmbeds String[]
607607
Name String @unique
608-
GuildId String
608+
GuildId String
609609
Guilds Guilds @relation(fields: [GuildId], references: [GuildId])
610610
}
611611

src/emojis/userdetail.png

192 Bytes
Loading

src/helper/InteractionHelper.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
} from "discord.js";
1010
import {DisBotInteractionType} from "../enums/disBotInteractionType.js";
1111
import {PermissionType} from "../enums/permissionType.js";
12-
import {convertToEmojiPng} from "./emojis.js";
12+
import {convertToEmojiToPng} from "./emojis.js";
1313
import {ExtendedClient} from "../types/client.js";
1414
import {database} from "../main/database.js";
1515

@@ -33,7 +33,7 @@ export class InteractionHelper {
3333
if (cooldown && client.cooldowns?.has(cooldownKey)) {
3434
const expiration = client.cooldowns.get(cooldownKey)! + cooldownTime;
3535
if (now < expiration) {
36-
const emoji = await convertToEmojiPng("timer", client.user!.id);
36+
const emoji = await convertToEmojiToPng("timer");
3737
const timestamp = Math.floor(expiration / 1000);
3838

3939
return await this.sendReply(interaction, emoji, `Please wait <t:${timestamp}:R> before using this command again.`)
@@ -54,7 +54,7 @@ export class InteractionHelper {
5454
const missingPermissions = botPermissions.filter(permission => !interaction.guild?.members.me?.permissions.has(permission));
5555

5656
if (missingPermissions.length > 0) {
57-
const emoji = await convertToEmojiPng("permission", client.user!.id);
57+
const emoji = await convertToEmojiToPng("permission");
5858
const bitfield = missingPermissions.reduce((a, b) => a | Number(b), 0);
5959
const readable = new PermissionsBitField(BigInt(bitfield)).toArray();
6060
const formatted = readable.map(p => `\`${p}\``).join(", ");
@@ -76,7 +76,7 @@ export class InteractionHelper {
7676
const missingPermissions = userPermissions.filter(permission => !(interaction.member as GuildMember).permissions.has(permission));
7777

7878
if (missingPermissions.length > 0) {
79-
const emoji = await convertToEmojiPng("permission", client.user!.id);
79+
const emoji = await convertToEmojiToPng("permission");
8080
const bitfield = missingPermissions.reduce((a, b) => a | Number(b), 0);
8181
const readable = new PermissionsBitField(BigInt(bitfield)).toArray();
8282
const formatted = readable.map(p => `\`${p}\``).join(", ");
@@ -97,7 +97,7 @@ export class InteractionHelper {
9797

9898
if (guild.ownerId !== member.id) {
9999
return await (interaction as any).reply({
100-
content: `## ${await convertToEmojiPng("permission", client.user!.id)} OoO, You need to be the server owner to execute this interaction.`,
100+
content: `## ${await convertToEmojiToPng("permission")} OoO, You need to be the server owner to execute this interaction.`,
101101
flags: MessageFlags.Ephemeral
102102
})
103103
}

src/helper/emojis.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ import {Config} from "../main/config.js";
44
/**
55
*
66
* @param emoji
7-
* @param {ExtendedClient} client
87
*/
9-
export async function convertToEmojiPng(emoji: string, client: string) {
8+
export async function convertToEmojiToPng(emoji: string) {
109

1110

1211
const response = await axios.get(
13-
`https://discord.com/api/applications/${client}/emojis`,
12+
`https://discord.com/api/applications/${Config.Bot.DiscordApplicationId}/emojis`,
1413
{
1514
headers: {
1615
Authorization: `Bot ${Config.Bot.DiscordBotToken}`,
@@ -30,10 +29,10 @@ export async function convertToEmojiPng(emoji: string, client: string) {
3029
return `<:${emoji}:${findemoji.id}>`;
3130
}
3231

33-
export async function convertToEmojiGif(emoji: string, client: string) {
32+
export async function convertToEmojiGif(emoji: string) {
3433

3534
const response = await axios.get(
36-
`https://discord.com/api/applications/${client}/emojis`,
35+
`https://discord.com/api/applications/${Config.Bot.DiscordApplicationId}/emojis`,
3736
{
3837
headers: {
3938
Authorization: `Bot ${Config.Bot.DiscordBotToken}`

src/helper/errorHelper.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
TextDisplayBuilder,
1010
WebhookClient
1111
} from "discord.js";
12-
import {convertToEmojiPng} from "./emojis.js";
12+
import {convertToEmojiToPng} from "./emojis.js";
1313
import {LoggingAction} from "../enums/loggingTypes.js";
1414
import {Logger} from "../main/logger.js";
1515
import {Config} from "../main/config.js";
@@ -41,7 +41,7 @@ export async function errorHandler(interaction: ButtonInteraction | ModalSubmitI
4141
.addTextDisplayComponents(
4242
new TextDisplayBuilder()
4343
.setContent([
44-
`## ${await convertToEmojiPng("error", client.user?.id)} An error occurred while processing your actions.`,
44+
`## ${await convertToEmojiToPng("error")} An error occurred while processing your actions.`,
4545
`-# **Steps you can do**`,
4646
`-# - Check your Action or Input.`,
4747
`-# - Check the Error Message and the Error Details below.`,
@@ -62,7 +62,7 @@ export async function errorHandler(interaction: ButtonInteraction | ModalSubmitI
6262
.setContent([
6363
`### ${customMessage ? customMessage : "Process and Action Failed"}`,
6464
`-# __${customDescription ? customDescription : "You Interaction or Action failed!"}__`,
65-
`### ${await convertToEmojiPng("box", client.user.id)} Error Message`,
65+
`### ${await convertToEmojiToPng("box")} Error Message`,
6666
].join("\n"))
6767
)
6868
.addTextDisplayComponents(
@@ -78,7 +78,7 @@ export async function errorHandler(interaction: ButtonInteraction | ModalSubmitI
7878
.addTextDisplayComponents(
7979
new TextDisplayBuilder()
8080
.setContent([
81-
`### ${await convertToEmojiPng("info", client.user?.id)} What will happen if you do it.`,
81+
`### ${await convertToEmojiToPng("info")} What will happen if you do it.`,
8282
`> -# You will share you public user ID`,
8383
`> -# You will send an Error stack trace`,
8484
`> -# You will send Interaction related data`,
@@ -189,7 +189,7 @@ export async function errorHandler(interaction: ButtonInteraction | ModalSubmitI
189189
.addTextDisplayComponents(
190190
new TextDisplayBuilder()
191191
.setContent([
192-
`## ${await convertToEmojiPng("check", client.user?.id)} Successfully sent your Error Report to the Discord!\n-# View your Bug Report on the Discord\n-# - https://discord.com/channels/1084507523492626522/${message.channel_id}/${message.id}\n-# View your Bug Report on the GitHub\n-# - ${issue}`,
192+
`## ${await convertToEmojiToPng("check")} Successfully sent your Error Report to the Discord!\n-# View your Bug Report on the Discord\n-# - https://discord.com/channels/1084507523492626522/${message.channel_id}/${message.id}\n-# View your Bug Report on the GitHub\n-# - ${issue}`,
193193
].join("\n"))
194194
)
195195
.setButtonAccessory(new ButtonBuilder()

src/helper/paginationHelper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
StringSelectMenuBuilder,
88
TextDisplayBuilder, UserSelectMenuBuilder
99
} from "discord.js";
10-
import {convertToEmojiPng} from "./emojis.js";
10+
import {convertToEmojiToPng} from "./emojis.js";
1111
import {PaginationData} from "../types/pagination.js";
1212

1313
export async function PaginationBuilder(data: PaginationData) {
@@ -20,7 +20,7 @@ export async function PaginationBuilder(data: PaginationData) {
2020
if (data.paginationData.length <= 0) {
2121
if (!data.client.user) throw new Error("Client User is not defined");
2222
return data.interaction.reply({
23-
content: `## ${await convertToEmojiPng("error", data.client.user?.id)} No data for pagination found! Failed to Build Message`,
23+
content: `## ${await convertToEmojiToPng("error")} No data for pagination found! Failed to Build Message`,
2424
flags: MessageFlags.Ephemeral
2525
});
2626
}

0 commit comments

Comments
 (0)