Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Obtaining Messenger bot token: link
Usage:
pip install yambot-client
# Add handlers to MessengerBot
# Supported handlers: text, command, button, regex, any
from yambot import MessengerBot
yb = MessengerBot('bot_token')
# Add command handler ex. when user sends /my_command
@yb.add_handler(command='/my_command')
def my_handler1(update):
yb.send_message('test1', update)
# Add text handler ex. when user sends some_text
@yb.add_handler(text='some_text')
def my_handler2(update):
yb.send_message('test2', update)
# Add button handler. Button must have callback_data with 'cmd': '/my_button' JSON object
# For more details about CallbackData see API description: https://yandex.ru/dev/messenger/doc/ru/data-types#button
@yb.add_handler(button='/my_button')
def my_handler3(update):
yb.send_message('test3', update)
# Add regex handler. Provide regular expression that will be tested against user text message
@yb.add_handler(regex='\d{5}')
def my_handler3(update):
yb.send_message('test4', update)
# Handler that will be applied when no other handlers match
@yb.add_handler(any=True)
def process_any(update):
yb.send_message('Unknown text', update)
Available Bot methods:
# Send text message. If update has chat or thread id message will be sent to chat or thread
# Otherwise message will be sent directly to user
yb.send_message('text', update)
# Send image. image_data can be either ASCII string or bytes object
yb.send_image(image_data, update)
# Send buttons. buttons must be a list of Button objects
yb.send_inline_keyboard(buttons, update)
Button example for send_inline_keyboard()
:
button1 = {'text': 'Button 1', 'callback_data': {'cmd': '/button_1'}}
button2 = {'text': 'Button 2', 'callback_data': {'cmd': '/button_2'}}
buttons = [button1, button2]
yb.send_gallery(images, update)
where images
is a list of image objects same as insend_image
methodmessage_id
disable_web_page_preview
to yb.send_message(images, update, disable_web_page_preview=True)
method. Default value is True
log_level=logging.DEBUG
argument for debug output. By default log level is INFO.yb = MessengerBot('bot_token', log_level=logging.DEBUG)
FAQs
Client for Yandex Messenger Bot API
We found that yambot-client demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.