A simple, easy to use, non-restrictive, synchronous Fosscord API Wrapper for Selfbots/Userbots written in Python.
-using requests and websockets :)
-based off of the discum library
- 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
Python 2.7 or higher required
# Linux/macOS
python -m pip install -U fossbotpy
# Windows
py -m pip install -U fossbotpy
installed automatically using above methods
- requests
- requests_toolbelt
- websocket_client==0.59.0
- filetype
- ua-parser
- random_user_agent
- colorama
Contributions are welcome. You can submit issues, make pull requests, or suggest features.
Please see the contribution guidelines
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.send_message('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()
guild_id = m.get('guild_id') #dms do not have a guild_id
channel_id = m['channel_id']
username = m['author']['username']
discriminator = m['author']['discriminator']
content = m['content']
print('> guild {} channel {} | {}#{}: {}'.format(guild_id, channel_id, username, discriminator, content))
bot.gateway.run()
Documentation
More examples
Changelog
Source
PyPi
- 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
- camelCase -> snake_case
- add the rest of the api wraps
- Everything
Q: How to fix "[SSL: CERTIFICATE_VERIFY_FAILED]" errors?
A: https://stackoverflow.com/a/53310545/14776493
Q: The owner of this website 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.
Q: Does this library also work as a discord self/userbotting library? A: Due to quite a few differences in discord and fosscord's apis, I recommended that you do not use this library for discord selfbotting. Only use this library for fosscord instances.