Giter Club home page Giter Club logo

reywen-revolt's Introduction

Hi I'm Toast

I like to make server applications and mess with APIs.

My main projects are in Rust and Bash, some are critical to my workflow and others are just for fun.

The projects I am most proud of can be found here

ko-fi

reywen-revolt's People

Contributors

declanchidlow avatar dependabot[bot] avatar toastxc avatar vloddot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

reywen-revolt's Issues

Parsing message struct when not needed

As a part of the RevX2 optimizations I will be reducing the amount of data that needs to be cloned and moved around.
For starters, rev_send() and similar functions requires a message data structure when only the channel is needed.
Additionally, the input content for rev_send() is a string but this is not needed, instead it could be a &str.
This is two of many changes that will be made in the coming days to reduce performance overhead.

NOTE: in production Reywen is only using 4.47 MB of ram in total.

rev_wordban() optimisation

changing rev_wordban() functionality so that the content and _id are taken from main() instead of parsing from raw

http error checking does not work for rev_user()

rev_user() is a pretty strange function (and will probably get rewritten soon). It cannot give information to the http_err function.

reqwest::Client data cannot be copied or cloned, nor can it be used in reference in a neat way (thanks alot lol).
If and when i rewrite rev_user hopefully the problem will fix itself.

Plural plugin no longer functional?

The Plural plugin no longer appears to be functional. The help command works, but search, query, rm, insert, and send commands all silently fail. I've tried using it on two different revolt servers (including my own), and have also tried DMing it directly, but in all cases it is the same behavior: the help command works, but nothing else.

Rewrite of reywen websocket

The code for the websocket is currently the oldest unchanged code in the entire project, while it is functional (somewhat) it has multiple problems that will be addressed in the rewrite.

this rewrite will introduce

  • builder patterns
  • verbose error logging
  • optional ability to restart on failure

Private Masqurade function

A system for sending masqurade messages that are unique to the user, so that multiple users cannot use the same alias.

This will most likely be a forked version of sendas, with custom perimeters, or could simply be an extra loop in main()

`BulkMessageResponse` doesn't handle `Vec<Message>`

image
Essentially, Revolt servers respond with a Vec<Message> instead of an expected struct of

{
    messages: Option<Vec<Message>>,
    users: Option<Vec<User>>,
    members: Option<Vec<Member>>,
}

This usually happens in small/new channels. This issue has been addressed before but has never been fixed.
For reproduction, this usually happens in servers like yui's server with most channels.

Try out different servers as well, or maybe create a testing server and just create a new channel. It usually happens there.

The channels #Joins / Leaves and #Testing in the video are mostly empty. #Joins / Leaves only has a few messages and #Testing has no messages.

2023-08-08.19-24-13.mp4

Switch from Ubuntu-rust to a alipine based image

Although I don't distribute any images or containers the documentation tells you to pull the template image 'rust' which is Ubuntu based.
While Ubuntu is very popular and well supported in the industry, its also massive. Which goes against one of the goals of Reywen.
I will look to see if there are any decent Alipine or minimal rust containers

Discord integration

If anyone would like to start creating a plugin for discord integration (data syncing, message bridge, etc) then feel free to help out.
This is a very low priority for me as I don't use Discord but if it's wanted then I can develop it (probably).

But it must fit this criteria

  • Using the plugin system, or is otherwise modular
  • Performs at an acceptable speed
  • is asynchronous
  • Abides by both the ToS of Discord and Revolt

Masquerade url length limit

users are able to create an entry to reywendb that revolt cannot accept
this problem is not liimted to avatar URLs, and there should be more checks for inserting

replacing AJSON with Serde_json

This will decrease the complexity of the program and reduce the chance of crashing by unwrap().
This change will also replace the old method of defining parameters individually with Ajson in exchange for defining an entire object

I will only make this change once most of the other issues are resolved, as this will require a rewrite of some libraries

Async functions cant be moved to external files

I tried moving rev_send() to rev_x.rs but it returned a very vague error.

expected struct rev_x::message::RMessage, found struct message::RMessage
rev_x is the library, message is the file name and RMessage is the struct.
there is no struct rev_x, and I have never had this issue before.
As of now I have no idea what this is or how to fix it.

Bot crashes due to malformed Message json on websocket

thread 'main' panicked at 'called Result::unwrap() on an Err value: Error("missing field nonce", line: 1, column: 196)', src/main.rs:163:48
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

{"type":"Message","_id":"01GDTJEMSP2433QKFRQ7PQCWMS","channel":"01FFZPSF7BYN0H8DWN3JV1HZA8","author":"00000000000000000000000000","system":{"type":"user_joined","id":"01FXKMW9P960G6BHCXTBS45N74"}}

This message doesnt make any sense... Revolt sends this rarely but when its sent the bot crashes due to a lack of error checking

Error logging with RevX2

Many features in RevX2 do not leave logs for errors or successful operations.
This can be a major problem as permission issues (especially with masquerade) are quite common on Revolt.
I will see if I can create a color coded better logging system.

Builder pattern for Reywen

The current paradigm for creating features in Reywen is... okay, but i know that there are far better ways of doing such.
The most promising system is builder pattern. I do not know much about these currently but will try my best to learn them, and eventually rewrite most of reywen (again) in a way that is more readable.
This has no affect on performance, and is purely for the developer experience.

I have already been testing impl and enums inside src/plugins/oop.rs and this will be a continuation of those efforts.

markdown for reywen

A simple data structure and impl for revolt markdown, nothing fancy.

it should look something like this

let string = md::new()
.content("hello")
.color("#2b2a2a")
.size("small")

No Conf

the config is hard coded, so modifications cannot be made without recompiling

No session feature

in its current state the bot is incapable of running by itself, it closes after all commands have been processed which for a bot is not very useful

Simplifying parameters for rev_ functions

Once the serde rewrite is done, I will change the parameters of functions to be just data

example

before
rev_send(data.token.clone(), channel.clone(), "invalid use of ?kick".to_string());

after
rev_send(data, "invalid use of ?kick".to_string());

this change may look minor, but it will decrease the clutter in main() dramatically

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.