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.
A Discord API library, written in Python, for those that like to dance. [QUEUE COWBOY BEBOP THEME]
BetterDisco is an up-to-date modernized fork of Disco, a library witten by b1nzy, the creator of Discord's API, iirc.
Disco is a library, written in Python 3 to interface with Discord's API as efficiently and effectively as possible.
Disco is expressive, and contains a functional interface.
Disco is built for performance and efficiency.
Disco is scalable and works well in large and small deployments.
Disco is configurable and modular.
Disco contains evented network and IO pipes, courtesy of gevent
.
Buzzwords 100. WYSIWYG.
Disco is designed to run both as a generic-use library, and as a standalone bot toolkit. Installing disco is as easy as running pip install betterdisco-py --upgrade --no-cache-dir
, however, additional options are available for extended features, performance, and support:
This | Installs these | Why? |
---|---|---|
betterdisco-py | gevent , requests , websocket-client | Required for base Disco functionality. |
betterdisco-py[http] | flask | Useful for hosting an API to interface with your bot. |
betterdisco-py[performance] | erlpack , isal , regex , pylibyaml , ujson , wsaccel | Useful for performance improvement in several areas. I am speed. |
betterdisco-py[sharding] | gipc , dill | Required for auto-sharding and inter-process communication. |
betterdisco-py[voice] | libnacl | Required for VC connectivity and features. |
betterdisco-py[yaml] | pyyaml | Required for YAML support, particularly if using config.yaml . |
betterdisco-py[all] | All of the above, unless otherwise noted. | All additional packages, for the poweruser that absolutely needs it all. |
Simple bot using the built-in bot authoring tools:
from disco.bot import Plugin
class SimplePlugin(Plugin):
# Plugins provide an easy interface for listening to Discord events
@Plugin.listen('ChannelCreate')
def on_channel_create(self, event):
event.channel.send_message('Woah, a new channel huh!')
# They also provide an easy-to-use command component
@Plugin.command('ping')
def on_ping_command(self, event):
event.reply('Pong!')
# Which includes command argument parsing
@Plugin.command('echo', '<content:str...>')
def on_echo_command(self, event, content):
event.reply(content)
Using the default bot configuration, we can now run this script like so:
python -m disco.cli --token="MY_DISCORD_TOKEN" --run-bot --plugin simpleplugin
And commands can be triggered by mentioning the bot (configured by the BotConfig.command_require_mention flag):
FAQs
A Discord API library, written in Python, for those that like to dance. [QUEUE COWBOY BEBOP THEME]
We found that betterdisco-py demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
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.