UNPKG
tgapi
Version:
latest (2.2.6)
2.2.6
2.2.5
2.2.3
2.2.2
2.2.1
2.2.0
2.1.1
2.1.0
2.0.2
2.0.1
2.0.0
1.2.2
1.2.1
1.2.0
1.1.0
1.0.17
1.0.16
1.0.15
1.0.14
1.0.13
1.0.12
1.0.11
1.0.10
1.0.9
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
0.4.0
0.3.1
0.3.0
0.2.2
0.2.1
0.2.0
0.1.1
0.1.0
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
Actual Telegram bot API JS implementation
github.com/bigslycat/tgapi
bigslycat/tgapi
tgapi
/
src
/
Bot
/
defaultCallMethod.js
11 lines
(6 loc)
•
252 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
/* @flow */
import
fetch
from
'isomorphic-fetch'
import
type
{
APIRequest
}
from
'./privates'
const
json
= res => res.
json
()
export
const
callMethod
= (
request
:
APIRequest
) =>
fetch
(request.
url
, {
method
:
'POST'
,
body
: request.
body
}).
then
(json)