Skip to main content

Bloyid Bot Bibliothek

Project description

bloyid.py

Python API wrapper for Bloyid originating from Fiiral, maintained by Deutscher775

Bloyid Server

For questions, help or anything else feel free to join the nerimity.py Bloyid server.

Quick jumps

Current features

Command Handling:

  • Define and register commands using the @client.command decorator.
  • Execute commands with parameters. Register event listeners using the @client.listen decorator. Handle various events such as:
  • on_ready
  • on_message_create
  • on_message_updated
  • on_message_deleted
  • on_button_clicked
  • on_presence_change
  • on_reaction_add
  • on_member_updated
  • on_role_updated
  • on_role_deleted
  • on_role_created
  • on_channel_updated
  • on_channel_deleted
  • on_channel_created
  • on_server_updated
  • on_member_join
  • on_member_left
  • on_server_joined
  • on_server_left
  • on_friend_request_sent
  • on_friend_request_pending
  • on_friend_request_accepted
  • on_friend_removed
  • on_minute_pulse
  • on_hour_pulse

Message Handling:

  • Send messages to channels.
    • add attachments
    • add buttons with custom callback
  • Edit and delete messages.
  • React and unreact to messages.

Attachment Handling:

  • Create and upload attachments.
  • Deserialize attachments from JSON.

Channel Management:

  • Update channel information.
  • Send messages to channels.
  • Get messages from channels.
  • Purge messages from channels.
  • Deserialize channels from JSON.

Context Handling:

  • Send messages, remove messages, and react to messages within a command context.

Invite Management:

  • Create and delete server invites.
  • Deserialize invites from JSON.

Member Management:

  • Follow, unfollow, add friend, remove friend, and send direct messages to members.
  • Kick, ban, and unban server members.
  • Deserialize members and server members from JSON.

Post Management:

  • Create, delete, comment on, like, and unlike posts.
  • Get comments on posts.
  • Deserialize posts from JSON.

Role Management:

  • Create, update, and delete roles.
  • Deserialize roles from JSON.

Server Management:

  • Get server details and ban list.
  • Create, update, and delete channels and roles.
  • Create and delete invites.
  • Update server members.
  • Deserialize servers from JSON.

Status Management:

  • Change the presence status of the bot.

Button Interaction:

  • Handle button interactions and send popups.
  • Deserialize button interactions from JSON.

Installation

Currently there is no direct installation method. (WIP)

Follow these 2 simple steps:

  1. Clone the repository
git clone https://github.com/ukyyyy/bloyid.py.git
  1. Copy the bloyid folder and insert it into your workspace. It should look like this: Image

Done!

Example commands bot

import nerimity


client = nerimity.Client(
    token="YOUR_BOT_TOKEN",
    prefix='!',
)

@client.command(name="ping")
async def ping(ctx: nerimity.Context, params: str):
    await ctx.send("Pong!")


@client.listen("on_ready")
async def on_ready(params):
    print(f"Logged in as {client.account.username}")


client.run()

Use case examples

Sending an attachment

@client.command(name="testattachment")
async def testattachment(ctx: nerimity.Context, params):
    file = await nerimity.Attachment.construct("test.png").upload()
    result = await ctx.send("Test", attachment=file)

Sending buttons with messages

@client.command(name="testbutton")
async def testbutton(ctx: nerimity.Context, params):
    popup_button = nerimity.Button.construct(label="Popup!", id="popuptestbutton", alert=True)
    async def popup_callback(buttoninteraction: nerimity.ButtonInteraction):
        user = client.get_user(buttoninteraction.userId)
        buttoninteraction.send_popup("Test", f"Hello, {user.username}!")
    await popup_button.set_callback(popup_callback)

    message_button = nerimity.Button.construct(label="Message!", id="messagetestbutton")
    async def message_callback(buttoninteraction: nerimity.ButtonInteraction):
        user = client.get_user(buttoninteraction.userId)
        await ctx.send(f"Hello, {user.username}!")
    await message_button.set_callback(message_callback)
    await ctx.send("Test", buttons=[message_button, popup_button])

Creating a post

@client.command(name="createpost")
async def createpost(ctx: nerimity.Context, params):
    content = ""
    for param in params:
        content += param + " "
    await ctx.send("Creating post with text: " + content)
    post = nerimity.Post.create_post(content)
    print(post)
    await ctx.send("Post created.")

Commenting on a post

@client.command(name="comment")
async def comment(ctx: nerimity.Context, params):
    post_id = int(params[0])
    content = ""
    for param in params[1:]:
        content += param + " "
    post = nerimity.Post.get_post(post_id)
    post.create_comment(content)
    await ctx.send("Commented on post.")

Deleting a post

@client.command(name="deletepost")
async def deletepost(ctx: nerimity.Context, params):
    post_id = int(params[0])
    post = nerimity.Post.get_post(post_id)
    post.delete_post()
    await ctx.send("Deleted post.")

Issues

If you encounter any issues while using the framework feel free to open an Issue.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bloyid-0.1.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bloyid-0.1-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file bloyid-0.1.tar.gz.

File metadata

  • Download URL: bloyid-0.1.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for bloyid-0.1.tar.gz
Algorithm Hash digest
SHA256 73558cfb3b679b98e2d5f89506356b3db865eba4306f082b7114cdd57824515f
MD5 de9bc78da00656cb47ddc8fbfa64c5c3
BLAKE2b-256 85d4ac982ef7af1e977949ed7649a5dd38b400670bc280dd0653623d24a1ec67

See more details on using hashes here.

File details

Details for the file bloyid-0.1-py3-none-any.whl.

File metadata

  • Download URL: bloyid-0.1-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.1

File hashes

Hashes for bloyid-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe35e04aefd3b3cc920d57d3a9266bb6b28ccd1d3be445daf9a11af3af27bbc7
MD5 a7668138d1f96398fc9c51a5adaf19ff
BLAKE2b-256 d00dcfea5d86161bb1ff1f7e84eff6d186accd55e7c2c565acb8e8737fda0956

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page