-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Brand new IMessageSystem-based Telegram client (#29)
- Loading branch information
Showing
6 changed files
with
46 additions
and
38 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
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 |
---|---|---|
@@ -1,13 +1,14 @@ | ||
namespace Emulsion.Telegram | ||
|
||
open Emulsion | ||
open Emulsion.MessageSystem | ||
open Emulsion.Settings | ||
|
||
type Client = | ||
{ run : (Emulsion.Message -> unit) -> unit | ||
send : OutgoingMessage -> unit } | ||
type Client(restartContext: RestartContext, settings: TelegramSettings) = | ||
inherit MessageSystemBase(restartContext) | ||
|
||
with | ||
static member funogram (settings : TelegramSettings) : Client = | ||
{ run = Funogram.run settings | ||
send = Funogram.send settings } | ||
override __.Run receiver _ = | ||
// TODO[F]: Update Funogram and don't ignore the cancellation token here. | ||
Funogram.run settings receiver | ||
|
||
override __.Send message = | ||
Funogram.send settings message |
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