BastliBridge

A bot framework bridgin multiple IM protocols, and mail
git clone git://xatko.vsos.ethz.ch/BastliBridge.git
Log | Files | Refs | Submodules

commit 0459c3abfcd0e894eb74e8882c5a56d9fba748b5
parent da987ff20a43bef86df3571ac7146c1fd65bd144
Author: Dominik Schmidt <das1993@hotmail.com>
Date:   Sun, 24 Sep 2017 00:13:00 +0200

Implement the getFile API-Call

Diffstat:
src/telegram.d | 16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/telegram.d b/src/telegram.d @@ -331,6 +331,22 @@ struct Telegram{ string _botName=response(sock)["username"].str; return _botName; } + string getFile(in char[] file_id){ + JSONValue j; + j.object=null; + j["file_id"]=file_id; + json("getFile", j.toString, sock2); + auto r=response(sock2); + if(r.isNull){ + return getFile(file_id); + } + j=r.get; + auto v="file_path" in j; + if(v) + return v.str; + else + throw new TelegramException(cast(string)("Path of file "~file_id~" was not found")); + } } struct LookupTable{