Skip to content

Commit

Permalink
update bot.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
GhomKrosmonaute committed Apr 25, 2024
1 parent 8f506db commit 45cfbf6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ export interface Config {
client: discord.ClientOptions

/**
* Custom emotes for the paginator
* Custom emotes for the paginator (use guild emojis IDs or web emotes)
*/
paginatorEmojis?: pagination.PaginatorEmojis

/**
* Custom emotes for system messages
* Custom emotes for system messages (use guild emojis IDs or web emotes)
*/
systemEmojis?: Partial<util.SystemEmojis>

Expand Down
2 changes: 1 addition & 1 deletion src/app/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ export const orm = new ORM({
logger,
})

export * from "@ghom/orm"
export * from "@ghom/orm"
9 changes: 8 additions & 1 deletion src/app/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import toObject from "dayjs/plugin/toObject.js"

import * as logger from "./logger.js"
import * as config from "./config.js"
import * as client from "./client.js"

export type PermissionsNames = keyof typeof v10.PermissionFlagsBits

Expand Down Expand Up @@ -457,7 +458,13 @@ const defaultSystemEmojis: SystemEmojis = {
}

export function getSystemEmoji(name: keyof SystemEmojis): string {
return config.getConfig().systemEmojis?.[name] ?? defaultSystemEmojis[name]
const rawEmoji =
config.getConfig().systemEmojis?.[name] ?? defaultSystemEmojis[name]

return (
client.ClientSingleton.get().emojis.resolve(rawEmoji)?.toString() ??
rawEmoji
)
}

export interface SystemMessageOptions {
Expand Down

0 comments on commit 45cfbf6

Please sign in to comment.