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.
Rubika Client API Framework | Python 3
Document
•
Telegram
•
Rubika
from rb import RubikaClient # rb: is main package
with RubikaClient('session', platform='rubx',) as client: # set the proxy, api client, api version, ...
client.send_message('Hey There!', 'username') # username, chat id, prviate links
from rb import RubikaClient
def respond(callable, params) -> dict:
return callable(**params)
with RubikaClient(...) as client:
print(
respond(
client.send_message,
dict(
chat_id=...,
text='**Hey** @User@ __My__ ``Friend`` ~~How r u?~~'
mention_user_ids=['u0...']),
)
)
# for emoji
# print(respond(client.send_message, dict(chat_id=..., sticker=True, emoji_character='😜', sticker_id=..., )))
# shorcuts
from rb import RubikaClient
from rb.responses import Self
with RubikaClient(...) as client:
print(client == Self.Text(text='Hey', chat_id='chat-guid')) # to send a message
# print(client * 'chat-guid') # to get chat info
# print(client['chat-guid']) # to get a message from chat
# client['send_message'] = dict(text='Hey there', chat_id='chat-guid') # example to usage methods with setitem
# use the all operators
from rb import RubikaClient
with RubikaClient('session') as client:
print(client.getChatInfo(client, 'chat-guid')) # GetChatInfo, GETchatINFO, or ...
# normally: client.get_chat_info('chat-guid')
from rb import RubinoClient
with RubinoClient('session') as app:
app.create_page(...)
from rb import Handler, EventBuilder, Filters
client = Handler(...)
# handlers: HandShake, ChatsUpdates, MessagesUpdates
client.add_event_handling(func='ChatsUpdates', events=dict(get_chats=True, get_messages=True, pattern=('/start', 'Hey from rubx lib.')))
@client.handler
def hello(app, message: EventBuilder, event):
# to print message: print(message) or print(event)
# to use all methods: app.create_objcet_voice_chat(...)
message.respond(message.pattern, Filters.author) # filters: chat, group, channel, author
from rb import Handler, Filters, Performers
client = Handler('session')
def event(message):
message.respond(message.pattern, Filters.author)
client.add_event_handling(func=Performers.hand_shake, events=dict(get_chats=True, get_messages=True, pattern=('/start', 'Hi from rubx lib.')))
client.starting = True
client.command_handler(event)
from rb import Handler, EventBuilder, Filters, Performers
client = Handler('abc...', 'u0...')
client.add_event_handling(func=Performers.hand_shake, events=dict(get_messages=True, get_chats=False))
@client.handler
def update(app, update, event):
if update.message.text == '/start':
message.reply(text='Hello my dear', chat_id=update.message.author_object_guid, reply_to_message_id=update.message.message_id)
# or using repond: message.respond('Hey!', Filters.author)
from rb import Client # Client: asycn reader
async def run(*args):
async with Client(...) as client:
result = await client.start(client.send_message, 'Hey! from rubx', 'chat-guid')
print(result)
Client.run(run)
from rb import BotAPI
with BotAPI(__name__, 'token') as app:
app.send_message('chat-id', 'Hey!')
from rb import BotAPI
with BotAPI(__name__, 'token') as app:
app.add_event_handling((r'\w{1}start .+', 'Hello'))
@app.handler
def update(methods, update, event):
...
sync
and asycn
library for Rubika's was developedRubx is an sync Python 3 rubika library to interact with Rubika's API as a user or through a bot account (self API alternative).
🔴 If you have code using Rubx before its 8.0.5 version, you must
read docs to learn how to migrate. 💡
🇮🇷 - Rubika is a popular messaging application. This library is meant to make it easy for you to write Python programs that can interact with Rubika. Think of it as a wrapper that has already done the heavy job for you, so you can focus on developing an application. This module provides all the desired methods with a very simple and beautiful user interface and has a very high speed. Give your employer the best experience of a project.
- Complete documentation and optimization.
pip install rubx
pip install rubx --upgrade
FAQs
Iranian rubx library - rubika client module
We found that rubx 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.