Git Product home page Git Product logo

pyre's Introduction

Pyre

A Revolt.chat API bot wrapper

This wrapper is a WIP. Pyre is a fast and stable-ish wrapper for revolt.

I want to achieve a wrapper that will be stable, easy to use and understand.

What works?

  • Caching and cache management of servers, users, members, roles, channels
  • Raw methods for interacting with the API I deemed neccessary
  • Recieving events from the API
  • Sending messages, embeds, uploading to the API
  • Basic Commands system

What needs to be done?

  • Adding methods to models
  • Proper rate limiting and rate limit prevention
  • Documentation
  • Extension system
  • Improvements, making stuff more efficient
  • More stuff, idk...

Example usage: Python 3.10+ needed.

import pyre.models as models
from pyre import PyreClient
import os

bot = PyreClient(os.getenv('token'), ["!", "+"])


@bot.listen(models.ClientReady)
async def on_ready():
    print(f'{bot.user.username} fed to the Pyre!')
    latency = await bot.latency() * 1000
    print(f"Bot's latency: {latency:.0f}ms")


@bot.listen(models.Message)
async def send_message(message: models.Message):
    if message.content == '+ina' and message.author.bot is False:
        embed = models.Embed()
        embed.title = "INA"
        embed.icon_url = "https://media.tenor.com/images/3b4e1e628bb5778cc1b27b66a3f6b5d3/tenor.gif"
        embed.media = 'tenor-3608348314.gif'
        embed.description = "INA"
        embed.colour = "#6d5f7b"
        await message.channel.send(embed=embed)


@bot.listen(models.MessageUpdate)
async def udpate_message(message: models.MessageUpdate):
    print(message.before)
    print(message.after)

@bot.listen(models.ServerRoleCreate)
async def memupd(event: models.ServerRoleCreate):
    print(event.before)
    print(event.after)

@bot.command()
async def repeat(ctx: models.CommandContext, text:str):
    await ctx.reply(text)

bot.start()

pyre's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.