File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
calamity/Calamity/Types/Model/Channel Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,19 @@ $(deriveTextShow ''ChannelType)
28
28
$ (makeFieldLabelsNoPrefix ''ChannelType)
29
29
30
30
instance Aeson. ToJSON ChannelType where
31
- toJSON t = Aeson. toJSON (fromEnum t)
32
- toEncoding t = Aeson. toEncoding (fromEnum t)
31
+ toJSON t = Aeson. Number $ case t of
32
+ GuildTextType -> 0
33
+ DMType -> 1
34
+ GuildVoiceType -> 2
35
+ GroupDMType -> 3
36
+ GuildCategoryType -> 4
37
+ GuildNewsType -> 5
38
+ GuildNewsThreadType -> 10
39
+ GuildPublicThreadType -> 11
40
+ GuildPrivateThreadType -> 12
41
+ GuildStageVoiceType -> 13
42
+ GuildDirectoryType -> 14
43
+ GuildForumType -> 15
33
44
34
45
instance Aeson. FromJSON ChannelType where
35
46
parseJSON = Aeson. withScientific " ChannelType" $ \ n -> case toBoundedInteger @ Int n of
You can’t perform that action at this time.
0 commit comments