File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change 33
33
import importlib .resources
34
34
import itertools
35
35
import json
36
+ import logging
36
37
import re
37
38
import sys
38
39
import types
100
101
"filter_params" ,
101
102
)
102
103
104
+ _log = logging .getLogger (__name__ )
105
+
103
106
DISCORD_EPOCH = 1420070400000
104
107
105
- with (
106
- importlib .resources .files (__package__ )
107
- .joinpath ("emojis.json" )
108
- .open (encoding = "utf-8" ) as f
109
- ):
110
- EMOJIS_MAP = json .load (f )
108
+ try :
109
+ with (
110
+ importlib .resources .files (__package__ )
111
+ .joinpath ("emojis.json" )
112
+ .open (encoding = "utf-8" ) as f
113
+ ):
114
+ EMOJIS_MAP = json .load (f )
115
+ except FileNotFoundError :
116
+ _log .debug (
117
+ "Couldn't find emojis.json. Is the package data missing? Discord emojis names will not work." ,
118
+ )
119
+ EMOJIS_MAP = {}
120
+
111
121
112
122
UNICODE_EMOJIS = set (EMOJIS_MAP .values ())
113
123
You can’t perform that action at this time.
0 commit comments