-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93a5697
commit a2ffcb9
Showing
9 changed files
with
75 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
open System.Web | ||
|
||
|
||
type Genre = | ||
| NonFiction | ||
| Fiction | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module Botinok.Requests | ||
|
||
open Funogram.Telegram | ||
open Funogram.Telegram.Bot | ||
open Funogram.Telegram.Types | ||
|
||
let private getMessageId (ctx: UpdateContext) = | ||
match ctx.Update.Message with | ||
| Some msg -> msg.MessageId | ||
| _ -> | ||
match ctx.Update.CallbackQuery.Value.Message.Value with | ||
| Message m -> m.MessageId | ||
| InaccessibleMessage im -> im.MessageId | ||
|
||
let sendReply (chatId: int64) msg ctx = | ||
Req.SendMessage.Make(chatId, msg, replyParameters = ReplyParameters.Create(messageId = getMessageId ctx)) | ||
|
||
let sendReplyMarkup (chatId: int64) msg ctx markup = | ||
Req.SendMessage.Make(chatId, msg, replyParameters = ReplyParameters.Create(messageId = getMessageId ctx), replyMarkup = markup) | ||
|
||
let editMessageReplyMarkup (chatId: int64) (ctx: UpdateContext) markup = | ||
Req.EditMessageReplyMarkup.Make(chatId = ChatId.Int chatId, messageId = getMessageId ctx, replyMarkup = markup) | ||
|
||
let sendDocument (chatId: int64) filename file ctx = | ||
Req.SendDocument.Make(chatId, InputFile.File(filename, file), replyParameters = ReplyParameters.Create(messageId = getMessageId ctx)) |