Safe Haskell | None |
---|---|
Language | Haskell2010 |
- kickChatMember :: Token -> Text -> Int -> Manager -> IO (Either ServantError KickChatMemberResponse)
- kickChatMemberM :: Text -> Int -> TelegramClient KickChatMemberResponse
- leaveChat :: Token -> Text -> Manager -> IO (Either ServantError LeaveChatResponse)
- leaveChatM :: Text -> TelegramClient LeaveChatResponse
- unbanChatMember :: Token -> Text -> Int -> Manager -> IO (Either ServantError UnbanChatMemberResponse)
- unbanChatMemberM :: Text -> Int -> TelegramClient UnbanChatMemberResponse
- getChat :: Token -> Text -> Manager -> IO (Either ServantError GetChatResponse)
- getChatM :: Text -> TelegramClient GetChatResponse
- getChatAdministrators :: Token -> Text -> Manager -> IO (Either ServantError GetChatAdministratorsResponse)
- getChatAdministratorsM :: Text -> TelegramClient GetChatAdministratorsResponse
- getChatMembersCount :: Token -> Text -> Manager -> IO (Either ServantError GetChatMembersCountResponse)
- getChatMembersCountM :: Text -> TelegramClient GetChatMembersCountResponse
- getChatMember :: Token -> Text -> Int -> Manager -> IO (Either ServantError GetChatMemberResponse)
- getChatMemberM :: Text -> Int -> TelegramClient GetChatMemberResponse
- type TelegramBotChatsAPI = (TelegramToken :> ("kickChatMember" :> (QueryParam "chat_id" Text :> (QueryParam "user_id" Int :> Post '[JSON] KickChatMemberResponse)))) :<|> ((TelegramToken :> ("leaveChat" :> (QueryParam "chat_id" Text :> Post '[JSON] LeaveChatResponse))) :<|> ((TelegramToken :> ("unbanChatMember" :> (QueryParam "chat_id" Text :> (QueryParam "user_id" Int :> Post '[JSON] UnbanChatMemberResponse)))) :<|> ((TelegramToken :> ("getChat" :> (QueryParam "chat_id" Text :> Post '[JSON] GetChatResponse))) :<|> ((TelegramToken :> ("getChatAdministrators" :> (QueryParam "chat_id" Text :> Post '[JSON] GetChatAdministratorsResponse))) :<|> ((TelegramToken :> ("getChatMembersCount" :> (QueryParam "chat_id" Text :> Post '[JSON] GetChatMembersCountResponse))) :<|> (TelegramToken :> ("getChatMember" :> (QueryParam "chat_id" Text :> (QueryParam "user_id" Int :> Post '[JSON] GetChatMemberResponse)))))))))
- chatsApi :: Proxy TelegramBotChatsAPI
Functions
kickChatMember :: Token -> Text -> Int -> Manager -> IO (Either ServantError KickChatMemberResponse) Source #
Use this method to kick a user from a group or a supergroup. In the case of supergroups, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the group for this to work.
leaveChat :: Token -> Text -> Manager -> IO (Either ServantError LeaveChatResponse) Source #
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
unbanChatMember :: Token -> Text -> Int -> Manager -> IO (Either ServantError UnbanChatMemberResponse) Source #
Use this method to unban a previously kicked user in a supergroup. The user will not return to the group automatically, but will be able to join via link, etc. The bot must be an administrator in the group for this to work.
unbanChatMemberM :: Text -> Int -> TelegramClient UnbanChatMemberResponse Source #
See unbanChatMember
getChat :: Token -> Text -> Manager -> IO (Either ServantError GetChatResponse) Source #
Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.)
getChatM :: Text -> TelegramClient GetChatResponse Source #
See getChat
getChatAdministrators :: Token -> Text -> Manager -> IO (Either ServantError GetChatAdministratorsResponse) Source #
Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember
objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.
getChatMembersCount :: Token -> Text -> Manager -> IO (Either ServantError GetChatMembersCountResponse) Source #
Use this method to get the number of members in a chat. Returns Int
on success.
getChatMember :: Token -> Text -> Int -> Manager -> IO (Either ServantError GetChatMemberResponse) Source #
Use this method to get information about a member of a chat. Returns a ChatMember
object on success.
getChatMemberM :: Text -> Int -> TelegramClient GetChatMemberResponse Source #
See getChatMember
API
type TelegramBotChatsAPI = (TelegramToken :> ("kickChatMember" :> (QueryParam "chat_id" Text :> (QueryParam "user_id" Int :> Post '[JSON] KickChatMemberResponse)))) :<|> ((TelegramToken :> ("leaveChat" :> (QueryParam "chat_id" Text :> Post '[JSON] LeaveChatResponse))) :<|> ((TelegramToken :> ("unbanChatMember" :> (QueryParam "chat_id" Text :> (QueryParam "user_id" Int :> Post '[JSON] UnbanChatMemberResponse)))) :<|> ((TelegramToken :> ("getChat" :> (QueryParam "chat_id" Text :> Post '[JSON] GetChatResponse))) :<|> ((TelegramToken :> ("getChatAdministrators" :> (QueryParam "chat_id" Text :> Post '[JSON] GetChatAdministratorsResponse))) :<|> ((TelegramToken :> ("getChatMembersCount" :> (QueryParam "chat_id" Text :> Post '[JSON] GetChatMembersCountResponse))) :<|> (TelegramToken :> ("getChatMember" :> (QueryParam "chat_id" Text :> (QueryParam "user_id" Int :> Post '[JSON] GetChatMemberResponse))))))))) Source #
Telegram Bot API
chatsApi :: Proxy TelegramBotChatsAPI Source #
Proxy for Thelegram Bot API to administrate chats