summaryrefslogtreecommitdiff
path: root/Network/API/Telegram/Bot/Object/Member/Powers.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Network/API/Telegram/Bot/Object/Member/Powers.hs')
-rw-r--r--Network/API/Telegram/Bot/Object/Member/Powers.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/Network/API/Telegram/Bot/Object/Member/Powers.hs b/Network/API/Telegram/Bot/Object/Member/Powers.hs
new file mode 100644
index 0000000..5db3c2f
--- /dev/null
+++ b/Network/API/Telegram/Bot/Object/Member/Powers.hs
@@ -0,0 +1,21 @@
+module Network.API.Telegram.Bot.Object.Member.Powers (Powers (..)) where
+
+import "aeson" Data.Aeson (FromJSON (parseJSON), withObject, (.:))
+import "base" Data.Bool (Bool)
+import "base" Control.Applicative ((<*>))
+import "base" Data.Function (($))
+import "base" Data.Functor ((<$>))
+import "base" Text.Show (Show)
+
+data Powers = Powers Bool Bool Bool Bool Bool Bool Bool Bool deriving Show
+
+instance FromJSON Powers where
+ parseJSON = withObject "Powers" $ \v -> Powers
+ <$> v .: "can_change_info"
+ <*> v .: "can_post_messages"
+ <*> v .: "can_edit_messages"
+ <*> v .: "can_delete_messages"
+ <*> v .: "can_invite_users"
+ <*> v .: "can_restrict_members"
+ <*> v .: "can_pin_messages"
+ <*> v .: "can_promote_members"