
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@gramio/types
Advanced tools
7.0.x types - for 7.0 Telegram Bot API
import type { ApiMethods } from "@gramio/types";
type SendMessageReturn = ReturnType<ApiMethods["sendMessage"]>;
// ^? type SendMessageReturn = Promise<TelegramMessage>
index
- exports everything in the sectionmethods
- exports ApiMethods
which describes the api functionsobjects
- exports objects with the Telegram
prefix (for example Update)params
- exports params that are used in methods
import { stringify } from "node:querystring";
import type { ApiMethods } from "@gramio/types";
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 data = await response.json();
if (!response.ok) throw new Error("some error");
return data.result;
},
});
api.sendMessage({
chat_id: 1,
text: "msg",
});
This library is updated automatically to the latest version of the Telegram Bot Api in case of changes thanks to CI CD! If the github action failed, there are no changes in the bot api
Prerequire - rust
git clone https://github.com/gramiojs/types.git
cloned
foldergit clone https://github.com/ark0f/tg-bot-api.git
cloned
foldercd tg-bot-api && cargo run --package gh-pages-generator --bin gh-pages-generator -- dev && cd ..
root
of the projectbun generate
or, if you don't use bun
, use tsx
npx tsx src/index.ts
types
folder!FAQs
Code-generated and Auto-published Telegram Bot API types
The npm package @gramio/types receives a total of 220 weekly downloads. As such, @gramio/types popularity was classified as not popular.
We found that @gramio/types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.