summaryrefslogtreecommitdiff
path: root/src/discord/embeds.ts
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-09-09 18:07:32 -0700
committerFuwn <[email protected]>2025-09-09 18:07:32 -0700
commit982e16f8d94f74b5ec7dbbdf62fbdbc106530941 (patch)
tree1c4163564305fb45cd9f105462cc2cd783399364 /src/discord/embeds.ts
parentrefactor: Move Discord APIs to Discord module (diff)
downloadumabotdiscord-982e16f8d94f74b5ec7dbbdf62fbdbc106530941.tar.xz
umabotdiscord-982e16f8d94f74b5ec7dbbdf62fbdbc106530941.zip
refactor(src): Use arrow functions everywhere
Diffstat (limited to 'src/discord/embeds.ts')
-rw-r--r--src/discord/embeds.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/discord/embeds.ts b/src/discord/embeds.ts
index f88cec2..833c831 100644
--- a/src/discord/embeds.ts
+++ b/src/discord/embeds.ts
@@ -1,7 +1,7 @@
import type { DiscordEmbed } from './interfaces.ts';
import type { RedditPost } from '../reddit.ts';
-function decodeHtmlEntities(str: string): string {
+const decodeHtmlEntities = (str: string): string => {
return str
.replace(/&amp;/g, '&')
.replace(/&lt;/g, '<')
@@ -11,9 +11,9 @@ function decodeHtmlEntities(str: string): string {
.replace(/&#x2F;/g, '/')
.replace(/&#x60;/g, '`')
.replace(/&#x3D;/g, '=');
-}
+};
-export function createPostEmbed(post: RedditPost): DiscordEmbed {
+export const createPostEmbed = (post: RedditPost): DiscordEmbed => {
const mediaUrl =
post.media?.reddit_video?.fallback_url ||
post.secure_media?.reddit_video?.fallback_url ||
@@ -87,4 +87,4 @@ export function createPostEmbed(post: RedditPost): DiscordEmbed {
}
return embed;
-}
+};