Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Python SDK and samples for Bale bot messenger.
You'll need to create your bot by @Bot_Father. Bot_Father gives you a Token to start.
pip install -r requirements.txt
import asyncio
from balebot.filters import *
from balebot.handlers import MessageHandler, CommandHandler
from balebot.models.messages import *
from balebot.updater import Updater
updater = Updater(token="Bot_token",
loop=asyncio.get_event_loop())
bot = updater.bot
dispatcher = updater.dispatcher
Note: You need to set Config.py if you want to use the logger class
Allows you to hear from client and answer.
@dispatcher.message_handler(filters=TextFilter(keywords=["hello"])) # filter text the client enter to bot
def hear(bot, update):
message = TextMessage('Hello')
user_peer = update.get_effective_user()
bot.send_message(message, user_peer, success_callback=success, failure_callback=failure)
Note:You should upload the voice file first.
Allows you to send a voice message. (You can also send a document in the same way).
def send_voice(bot, update):
user_peer = update.get_effective_user()
v_message = VoiceMessage(file_id=file_id, access_hash=access_hash, name="Hello", file_size='259969',
mime_type="audio/mpeg",
duration=20, file_storage_version=1)
bot.send_message(v_message, user_peer, success_callback=success, failure_callback=failure)
Note:Generic Template Messages
Allows you to add cool text buttons to a general message.
def ask_question(bot, update):
general_message = TextMessage("a message")
btn_list = [TemplateMessageButton(text="yes", value="yes", action=0),
TemplateMessageButton(text="no", value="no", action=0)]
template_message = TemplateMessage(general_message=general_message, btn_list=btn_list)
bot.send_message(template_message, user_peer, success_callback=success, failure_callback=failure)
Allows you send a purchase message. Clients can pay the money requested by the message by pressing "pay" button.
@dispatcher.message_handler(PhotoFilter())
def purchase_message(bot, update):
message = update.get_effective_message()
user_peer = update.get_effective_user()
first_purchase_message = PurchaseMessage(msg=message, account_number=6037991067471130, amount=10,
money_request_type=MoneyRequestType.normal)
bot.send_message(first_purchase_message, user_peer, success_callback=success, failure_callback=failure)
dispatcher.finish_conversation(update)
visit bale-developers for more information
FAQs
Python framework for Bale messenger Bot API
We found that balebot 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.