Dolfik1/Funogram

Funogram.Telegram v6.7.0 falls with method not found exception

punkrelique opened this issue · 2 comments

I experience problems with v6.7.0 version of Funogram.Telegram. Basiclly, It falls with method not found exception in the HelloWorld app. Downgrading to v6.5.0.1 helps

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net6.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="Program.fs" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Funogram" Version="2.0.6" />
    <PackageReference Include="Funogram.Telegram" Version="6.7.0" />
  </ItemGroup>

</Project>
open Funogram.Api
open Funogram.Telegram
open Funogram.Telegram.Bot

let updateArrived (ctx: UpdateContext) =
  match ctx.Update.Message with
  | Some { MessageId = messageId; Chat = chat } ->
    Api.sendMessageReply chat.Id "Hello, world!" messageId |> api ctx.Config
    |> Async.Ignore
    |> Async.Start
  | _ -> ()

[<EntryPoint>]
let main _ =
  async {
    let config = Config.defaultConfig |> Config.withReadTokenFromFile
    let! _ = Api.deleteWebhookBase () |> api config
    return! startBot config updateArrived None
  } |> Async.RunSynchronously
  0
 ---> System.MissingMethodException: Method not found: 'Void BotConfig..ctor(Boolean, System.String, Microsoft.FSharp.Core.FSharpOption`1<Int64>, Microsoft.FSharp.Core.FSharpOption`1<Int64>, Microsoft.FSharp.Core.FSharpOption`1<Int64>, Microsoft.FSharp.Core.FSharpOption`1<System.Collections.Generic.IEnumerable`1<System.String>>, Microsoft.FSharp.Core.FSharpFunc`2<System.Exception,Microsoft.FSharp.Core.Unit>, System.Uri, System.Net.Http.HttpClient, Microsoft.FSharp.Core.FSharpOption`1<BotWebHook>)'.
   at <StartupCode$Funogram-Telegram>.$Funogram.Telegram.Bot..cctor()
   --- End of inner exception stack trace ---
   at Funogram.Telegram.Bot.Config.get_defaultConfig()
   at Program.Pipe #1 input at line 15@16.Invoke(Unit unitVar) in C:\dev\bug\Program.fs:line 16
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[T,TResult](AsyncActivation`1 ctxt, TResult result1, FSharpFunc`2 part2) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 510
   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 112
--- End of stack trace from previous location ---
   at Microsoft.FSharp.Control.AsyncResult`1.Commit() in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 454
   at Microsoft.FSharp.Control.AsyncPrimitives.QueueAsyncAndWaitForResultSynchronously[a](CancellationToken token, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1140
   at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[T](CancellationToken cancellationToken, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1167
   at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1511
   at Program.main(String[] _arg1) in C:\dev\bug\Program.fs:line 19

Maybe as #46

Thank you for report! I have updated Funogram to 2.0.7, so this issue should be fixed after update.