Git Product home page Git Product logo

dippy.core's Introduction

Dippy.Core

This is a bare-bones Discord gateway client that can be used to build Python bot frameworks for Discord.

☢️ THIS IS ALPHA SOFTWARE ☢️

There will be bugs and not all features are implemented. It should be fine to use it but if it goes crazy and gets your bot token reset, well, you've been warned. (Fwiw I've not had issues during development so far)

PLEASE report any bugs or issues here. If you would like to contribute feel free!

Installation

pip install dippy.core

Usage

dippy.core relies heavily on the Bevy Package. Since this is not intended as a consumer facing package it will be necessary to directly set up a Bevy context with all of the dippy.core dependencies.

Connecting

import asyncio
from bevy import Context
from asyncio import get_event_loop
from dippy.core import CacheManager, EventDispatch, Intents
from dippy.core.api.api import DiscordAPI
import logging
import os


async def start(loop):
    context = Context()
    context.add(loop)

    async with context.create(
        DiscordAPI, os.getenv("DISCORD_TOKEN"), intents=Intents.ALL
    ) as api:
        context.add(api)

        events = context.create(EventDispatch)
        context.add(events)

        cache = context.create(CacheManager)
        context.add(cache)

        async def ready(event):
            await asyncio.sleep(2)
            logging.info(f"Everything should be ready now {event.user.username}!")

        events.on("READY", ready)

        await api.connect()


loop = get_event_loop()
loop.run_until_complete(start(loop))

Future

  • Add models to wrap the event payload data
  • Add rate limiting
  • Add methods to models for using the API

dippy.core's People

Contributors

zechcodes 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.