telegram-api-0.7.0.0: Telegram Bot API bindings

Safe HaskellNone
LanguageHaskell2010

Web.Telegram.API.Bot.API.Chats

Contents

Synopsis

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.

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.)

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.

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