GithubHelp home page GithubHelp logo

myrabot / diskord Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 1.08 MB

๐Ÿ’ฌ Custom Discord API Wrapper

Kotlin 100.00%
discord-api-wrapper discord-gateway discord-kotlin discord-rest discord-voice

diskord's Introduction

๐Ÿ’ฌ Diskord

Diskord is a Discord wrapper written in Kotlin, making use of coroutines and Kotlins async model.

Warning

This library is not stable! The gateway connection isn't stable and error with the following message:

ForkJoinPool.commonPool-work - Gateway - INFO - End of income, opening a new socket connection
Exception in thread "ForkJoinPool.commonPool-worker-1" java.lang.IllegalStateException: Unknown MessageType: 46

โœจ Features

  • Gateway
  • Rest
  • Caching (Gateway + Rest)
  • Voice
  • Sharding

๐Ÿ“ TODO

  • Make all events open classes
  • Name function fetchX to show that rest is being used
  • Do not put Interaction in InteractionModifier.kt - but still make it available to use in myra for finding out the language
  • Use normal Instant class instead of custom time class
  • Use https://kotlinlang.org/docs/type-safe-builders.html#scope-control-dslmarker
  • Create copy of cache for every event and fire then every cache event and functions immediatly instead of waiting for all events to finish and updating the cache then

๐Ÿ—„๏ธ Caching

Diskord has Rest caching as well as Gateway caching.

Though note that if you turn of gateway caching the objects won't be in sync anymore since update events are missing!

๐ŸŽŸ๏ธ Event abstraction

If an even can be interpreted in different ways the event has the following structure

    FooEventBroker
          |
          V
    FooBarEvent โ”€โ”
                 โ”œโ”€ GenericFooEvent
    FooBazEvent โ”€โ”˜

FooEventBroker: Event handler which calls GenericFooEvents subclasses
GenericFooEvent: Abstract class which shares common methods across its subclasses

Because the cache waits for all functions of the fired event to finish, the cache may be outdated for events following very close on each other.

diskord's People

Contributors

m5rian avatar pringlers avatar

diskord's Issues

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.