A Fosscord API Wrapper for Userbots/Selfbots written in Python.
Project description
fossbotpy
A simple, easy to use, non-restrictive, synchronous fossbotpy API Wrapper for Selfbots/Userbots written in Python.
-using requests and websockets :)
Table of Contents
Key features
- easy-to-use (make selfbots/userbots)
- easy-to-extend/edit (add api wrappers)
- readable (organized 😃 )
- mimics the client while giving you control
- on-event (gateway) capabilities
- op14 and op8 member fetching
- support for python 2.7
Installation
Python 2.7 or higher required
# Linux/macOS
python3 -m pip install -U fossbotpy
# Windows
py -3 -m pip install -U fossbotpy
Prerequisites (installed automatically using above methods)
- requests
- requests_toolbelt
- brotli
- websocket_client==0.59.0
- filetype
- ua-parser
- random_user_agent
- colorama
Contributing
Contributions are welcome. You can submit issues, make pull requests, or suggest features.
Please see the contribution guidelines
Quick example
import fossbotpy
token = 'token'
base_url = 'https://dev.fosscord.com/api/v9/'
bot = fossbotpy.Client(token=token, base_url=base_url, log={"console":True, "file":False})
bot.sendMessage("238323948859439", "Hello :)")
@bot.gateway.command
def helloworld(resp):
if resp.event.ready:
user = bot.gateway.session.user
print("Logged in as {}#{}".format(user['username'], user['discriminator']))
if resp.event.message:
m = resp.parsed.auto()
guildID = m.get('guild_id') #dms do not have a guild_id
channelID = m['channel_id']
username = m['author']['username']
discriminator = m['author']['discriminator']
content = m['content']
print("> guild {} channel {} | {}#{}: {}".format(guildID, channelID, username, discriminator, content))
bot.gateway.run()
Links
Documentation
More examples
Changelog
Source
PyPi
Checklist
- Sending basic text messages
- Sending Images
- Sending Embeds
- Sending Requests (Friends etc)
- Profile Editing (Name,Status,Avatar)
- On-Message (and other on-anything gateway) capabilities
- Getting guild members
- improve documentation
- add interactions (slash command triggering, buttons, and dropdowns/menus)
- add more guild http api wraps
- media (voice & video calls, along with the various discord games/activites)
- Everything
FAQ
Q: How to fix "[SSL: CERTIFICATE_VERIFY_FAILED]" errors?
A: https://stackoverflow.com/a/53310545/14776493
Q: import _brotli ImportError: DLL load failed: The specified module could not be found.
How to fix?
A: https://github.com/google/brotli/issues/782
Q: The owner of this website (discord.com) has banned your access based on your browser's signature...
. How to fix?
A: This is because of your user agent (https://stackoverflow.com/a/24914742/14776493). Either try again or reinitialize your client with a new user agent.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for fossbotpy-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7c8a9e49d8955aee5397b45f468f047fa82ce2991a4e59d654cc95ece735b3d |
|
MD5 | a8441ec89cdf99416033e9e30837b7ad |
|
BLAKE2b-256 | 3d8b6ff945038a767a144b120e86dc7628a8ce12b59b0bd1121d205bb1c2b515 |