Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gramio/types

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gramio/types - npm Package Compare versions

Comparing version 7.0.7 to 7.0.8

2

out/methods.d.ts
/**
* Based on Bot Api v7.0.0 (29.12.2023)
* Generated at 2/2/2024, 12:18:23 AM using {@link https://github.com/gramiojs/types | [types]} and {@link https://ark0f.github.io/tg-bot-api | [schema]} generators
* Generated at 2/2/2024, 4:07:25 PM using {@link https://github.com/gramiojs/types | [types]} and {@link https://ark0f.github.io/tg-bot-api | [schema]} generators
*/

@@ -5,0 +5,0 @@ import * as Params from "./params"

{
"name": "@gramio/types",
"version": "7.0.7",
"version": "7.0.8",
"homepage": "https://github.com/gramiojs/types",

@@ -5,0 +5,0 @@ "readme": "https://github.com/gramiojs/types",

@@ -31,23 +31,19 @@ # Code-generated and Auto-published Telegram Bot API types

```typescript
import { stringify } from "node:querystring";
import type { ApiMethods } from "@gramio/types";
import type { ApiMethods, TelegramAPIResponse } from "@gramio/types";
const TBA_BASE_URL = "https://api.telegram.org/bot";
const TOKEN = "";
const api = new Proxy<ApiMethods>({} as ApiMethods, {
get: (_target, method: string) => async (args: Record<string, any>) => {
const url =
`http://api.telegram.org/bot` +
TOKEN +
"/" +
method +
`?` +
stringify(args);
const response = await fetch(url, {
method: "GET",
const api = new Proxy({} as ApiMethods, {
get: (_target, method: string) => async (args: Record<string, unknown>) => {
const response = await fetch(`${TBA_BASE_URL}${TOKEN}/${method}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
});
const data = await response.json();
if (!response.ok) throw new Error("some error");
const data = (await response.json()) as TelegramAPIResponse;
if (!data.ok) throw new Error(`Some error occurred in ${method}`);

@@ -54,0 +50,0 @@ return data.result;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc