This release is a pre-release and may not be stable for production use.
swagsocialbots
Now on PyPI: https://pypi.org/project/swagsocialbots/
Python module to make bots in swagsocial with swagsocial.py
Created by maxie!
Getting your API key
Log into your desired swagsocial account and go to Settings --> API, or click this link
If you would like to grant manage post permissions, which includes making posts and replies. It also allows deleting posts and replies, so be careful!
an example
from swagsocialbots import SwagBot
import time
bot = SwagBot()
# example command
# on swagsocial you would mention the bot
# write the command afterwards, and the arguments for it
#
# here its gonna be @botexample hello @user
# will reply with "Hello User Display Example"
#
# be aware that arguments that start with @ are always converted to User objects
# digits are converted to integers, the rest are just strings
@bot.command()
def hello(ctx, user):
ctx.reply(f"Hello {user.display_name}")
@bot.event() # will reply to a post the bot is tagged on
def on_mention(ctx):
ctx.reply(f"Hello, @{ctx.post.author.username}")
# will do anything in a forever loop, useful for bots that
# post something every N amount of time
@bot.event()
def forever_loop():
bot.post("meow")
time.sleep(3600) # bot will post "meow" every 1 hour
# will reply with an error message related to the comamnd
@bot.event()
def on_command_error(ctx, exception):
ctx.reply(f"something went wrong: {exception.__class__.__name__}: {exception}")
@bot.event()
def on_error(ctx, exception):
# for now exception in this block will always be "Command not found"
ctx.reply(f"something went wrong: {exception.__class__.__name__}: {exception}")
bot.run("api key")
Metadata
Release files for swagsocialbots 1.0.0.dev8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| swagsocialbots-1.0.0.dev8.tar.gz | 16.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swagsocialbots-1.0.0.dev8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.3 kB
Security for swagsocialbots 1.0.0.dev8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.