diff --git a/components/Form/TextArea.tsx b/components/Form/TextArea.tsx index 53edc59..b15e809 100644 --- a/components/Form/TextArea.tsx +++ b/components/Form/TextArea.tsx @@ -6,6 +6,7 @@ import { Picker } from 'emoji-mart' import useOutsideClick from '@utils/useOutsideClick' import 'emoji-mart/css/emoji-mart.css' +import { KoreanbotsEmoji } from '@utils/Constants' @@ -40,13 +41,7 @@ const TextArea = ({ name, placeholder, theme='auto', setValue, value }:TextAreaP flags: '국기', custom: '커스텀' } - }} custom={[{ - name: '한국 디스코드봇 리스트', - short_names: ['koreanbots', 'kbots', 'dbkr'], - emoticons: [], - keywords: ['koreanbots', '한국 디스코드봇 리스트', '한디리', 'kbots'], - imageUrl: '/logo.png' - }]}/> + }} custom={KoreanbotsEmoji}/> }
diff --git a/public/emojis/javascript.png b/public/emojis/javascript.png new file mode 100644 index 0000000..9bca9f3 Binary files /dev/null and b/public/emojis/javascript.png differ diff --git a/public/emojis/python.png b/public/emojis/python.png new file mode 100644 index 0000000..a215d68 Binary files /dev/null and b/public/emojis/python.png differ diff --git a/utils/Constants.ts b/utils/Constants.ts index b3816dc..037dc9d 100644 --- a/utils/Constants.ts +++ b/utils/Constants.ts @@ -157,9 +157,28 @@ export const git = { 'github.com': { icon: 'github', text: 'Github' }, 'gitlab. export const KoreanbotsDiscord = 'https://discord.gg/JEh53MQ' export const ThemeColors = [{ name: '파랑', rgb: 'rgb(51, 102, 255)', hex: '#3366FF', color: 'koreanbots-blue' }, { name: '하양', rgb: 'rgb(251, 251, 251)', hex: '#FBFBFB', color: 'little-white' }, { name: '검정', rgb: 'rgb(27, 30, 35)', hex: '#1B1E23', color: 'very-black' }, { name: '보라', rgb: 'rgb(114, 137, 218)', hex: '#7289DA', color: 'discord-blurple' } ] -export const KoreanbotsEmoji = { - koreanbots: '/logo.png' -} +export const KoreanbotsEmoji = [{ + name: '한국 디스코드봇 리스트', + short_names: ['koreanbots', 'kbots', 'dbkr'], + emoticons: [], + keywords: ['koreanbots', '한국 디스코드봇 리스트', '한디리', 'kbots'], + imageUrl: '/logo.png' +}, +{ + name: 'Javascript', + short_names: ['javascript', 'js'], + emoticons: [], + keywords: ['javascript', 'js', '자바스크립트'], + imageUrl: '/emojis/javascript.png' +}, +{ + name: 'Python', + short_names: ['python', 'py'], + emoticons: [], + keywords: ['python', 'py', '파이썬'], + imageUrl: '/emojis/python.png' +}] + export const ErrorText = { DEFAULT: '예상치 못한 에러가 발생하였습니다.', 200: '문제가 없는데 여기를 어떻게 오셨죠?', diff --git a/utils/ShowdownExtensions.ts b/utils/ShowdownExtensions.ts index b8d2a1f..7b43d81 100644 --- a/utils/ShowdownExtensions.ts +++ b/utils/ShowdownExtensions.ts @@ -35,7 +35,8 @@ export const customEmoji = { type: 'output', regex: EmojiSyntax, replace: function(__match: string, name: string) { - if(!name || !KoreanbotsEmoji[name]) return `:${name}:` - return `${name}` + const result = KoreanbotsEmoji.find(el => el.short_names.includes(name)) + if(!name || !result) return `:${name}:` + return `${name}` } } \ No newline at end of file