
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Client for telegram bots
npm i z-telbot
const { ZTelBot } = require('z-telbot');
import { ZTelBot } from 'z-telbot';
const telBot = new ZTelBot({ token: getApiToken() });
telBot.addTextMessageListener(evt => {
console.log(`[${evt.chat.name} (ID: ${evt.chat.id})] ${evt.from?.name}(ID: ${evt.from?.id}): ${evt.message?.text}`);
});
telBot.addCommandListener('hi', evt => {
evt.reply().text({ text: `Hi: ${evt.command.argsText}` });
});
telBot.addDefaultCommandListener(evt => {
if (!evt.commandFound) {
evt.reply().text({ text: `Comando inválido: ${evt.command.commandName}` });
}
});
telBot.listenUpdates().then((botInfo) => {
console.log(`Bot iniciado com sucesso: ${botInfo.username}`);
});
constructor getMe getUpdates sendMessage sendAudio listenUpdates addUpdateListener addMessageListener addSentMessageListener addTextMessageListener addDefaultCommandListener addCommandListener removeUpdateListener removeSentMessageListener removeMessageListener removeTextMessageListener removeDefaultCommandListener removeCommandListener sendCommands setMyCommands getMyCommands
const telBot = new ZTelBot({token: '...'});
Parameters:
{
token!: string;
}
const botInfo = await telBot.getMe();
console.log(botInfo);
const updates = await telBot.getUpdates();
console.log(updates);
Parameters:
{
offset?: number;
limit?: number;
timeout?: number;
allowedUpdates?: string[];
}
const messageInfo = telBot.sendMessage({text: 'Oi', chatId: 1234, parseMode: 'MarkdownV2'});
console.log(messageInfo);
Parameters:
{
chatId!: number | string;
text!: string;
parseMode?: ParseMode;
entities?: MessageEntity[];
disableWebPagePreview?: boolean;
disableNotification?: boolean;
replyToMessageId?: number;
allowSendingWithoutReply?: boolean;
replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
}
const messageInfo = telBot.sendAudio({audio: fileFromPath('song.mp3')});
console.log(messageInfo);
Parameters:
{
chatId!: number | string;
audio!: InputFile | string;
duration?: number;
width?: number;
height?: number;
thumb?: InputFile | string;
caption?: string;
parseMode?: ParseMode;
captionEntities?: MessageEntity[];
disableNotification?: boolean;
allowSendingWithoutReply?: boolean;
replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
}
telBot.listenUpdates().then((botInfo) => {
console.log(`Bot iniciado com sucesso: ${botInfo.username}`);
});
Parameters:
{
once?: boolean;
offset?: number;
limit?: number;
timeout?: number;
allowedUpdates?: string[];
skipFirstBatch?: boolean;
delay?: number;
}
telBot.addUpdateListener((evt)=>{
console.log(evt);
});
telBot.addMessageListener((evt)=>{
console.log(evt);
});
telBot.addSentMessageListener((evt)=>{
console.log(evt);
});
telBot.addSentMessageListener((evt)=>{
console.log(evt.text);
});
telBot.addCommandListener('hi', (evt)=>{
evt.reply().text({text: 'Hi'});
});
telBot.addDefaultCommandListener((evt)=>{
if (!evt.commandFound){
evt.reply().text({text: `Invalid command: ${evt.command.commandName}`});
}
});
telBot.addCommandListener('hi', (evt)=>{
evt.reply().text({text: 'Hi'});
});
const cmd = {command: 'hi', description: 'Send hi'};
telBot.addCommandListener(cmd, (evt)=>{
evt.reply().text({text: 'Hi'});
});
Parameters:
{
command!: string;
hidden?: boolean;
description?: string;
}
telBot.addCommandListener('test', (evt)=>{
evt.reply().text({text: 'Test'});
}
const cmd = {command: 'hi', description: 'Send hi'};
telBot.addCommandListener(cmd, (evt)=>{
evt.reply().text({text: 'Hi'});
});
telBot.sendCommands();
telBot.addCommandListener('hi', (evt)=>{
evt.reply().text({text: 'Hi'});
});
telBot.addDefaultCommandListener((evt)=>{
if (evt.command.commandName==='test'){
evt.reply().text({text: 'Test'});
}
});
telBot.sendCommands([{command: 'test', description: 'Test'}]);
const listenerId = telBot.addCommandListener('test', (evt)=>{
evt.reply().text({text: 'Test'});
});
telBot.removeCommandListener(listenerId);
const commands: BotCommand[] = await telBot.getMyCommands();
console.log(commands);
telBot.setMyCommands([{
command: 'hi'
description: 'Send hi'
}]);
FAQs
Client for telegram bots
We found that z-telbot demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.