♣️ A flexible and powerful command framework with default Guilded API implementations using deck

Related tags

Miscellaneous clubs
Overview

GitHub Workflow Status GitHub issues GitHub Repo stars

♣️ clubs

A simple and versatile command framework made with the primary objective of making Guilded command experience a little more elegant.

The default implementation of the common module is the client, which uses deck to communicate with Guilded's API.

Documentation

There is no official documentation, but you can find a nice example of the structure here:

common

This is module containing the main functionalities of the framework, being less powerful than the others:

send("Count: $count") } } } }">
val command = newCommand("repeat", "repeattask") {
    // Integer type
    val times by integer("times")
    // Nullable string type, only accepts a word
    val exampleWord by word("word").optional()
    // Nullable string type, only accepts text between quotes ("")
    val exampleQuotedString by quote("quote").optional()
    // Nullable string type, accepts unlimited words, but must be the last argument
    val exampleGreedyString by text("greedy_string").optional()
    runs {
        repeat(times) {
            send("$times")
            send(exampleWord)
            send(exampleQuotedString)
            send(exampleGreedyString)
        }
    }
    // Subcommand
    command("massive") {
        val times by long("times")
        runs {
            repeat(times) { count ->
                 send("Count: $count")
            }
        }
    }
}

You can't use this module alone, since it does not have a command handler, in other words, it doesn't have a bridge to send and receive content from, so it can't reply nor parse commands.

client

This is the framework's guilded client API implementation, supporting more data types and structures, take a look at the example:

suspend fun main() {
    val deck = DeckClient {}
    val clubs: ClubsInstance = ClientClubsInstance()
    clubs.register(HelloCommand())
    deck.login()
    clubs.start(deck)
}

private fun HelloCommand() = command("hello") {
    val user by user("user")
    val role by role("role")
    val channel by channel("channel")
    runs {
        this.channel.sendContent {
            paragraph {
                + "Channel: "
                + channel
            }
            paragraph {
                + "User: "
                + user
            }
            paragraph {
                + "Role: "
                + role
            }
        }
    }
}

The above example accepts user, role and channel mentions and sends a reply mentioning them again.

If you want to get the channel's state (like name, topic etc...), just like with deck, you can use channel.getState() to fetch this data making a request to guilded's API.

Implementation

To use clubs in your project, you only need to add this to your build.gradle.kts:

repositories {
    maven("https://jitpack.io/")
}

Here you can replace clubsVersion with the latest version (0.7-SNAPSHOT).

And if you only want to use the common module, you can just replace clubs-client with clubs-common.

dependencies {
    implementation("com.github.srgaabriel.clubs:clubs-client:$clubsVersion")
}

Thanks

I got inspiration from Hexalite, a project I'm working on with eexsty and other amazing devs!

You might also like...
****. Use the native and support library variants instead - https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml.html. An android library that makes it easy to add custom fonts to edittexts and textviews

Add to your project Add this line to your dependencies in build.gradle compile 'in.workarounds.typography:typography:0.0.8' Using the views There are

SL4A brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreters directly on the Android device.

#Scripting Layer for Android (SL4A) SL4A brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreter

An application for runners and cyclists. Allows you to monitor your physical activity, weight and receive reminders about workouts.

An application for runners and cyclists. Allows you to monitor your physical activity, weight and receive reminders about workouts.

A curated list of standards, tests and benchmarks that can be used for testing and evaluating dev-tools

A curated list of standards, tests and benchmarks that can be used for testing and evaluating dev tools Contribution Add the description of the benchm

A gradle plugin for getting java lambda support in java 6, 7 and android

Gradle Retrolambda Plugin This plugin will automatically build your java or android project with retrolambda, giving you lambda goodness on java 6 or

A Job Queue specifically written for Android to easily schedule jobs (tasks) that run in the background, improving UX and application stability.

Development in this repository is stopped. Future development continues on https://github.com/yigit/android-priority-jobqueue ========================

An android library for displaying fps from the choreographer and percentage of time with two or more frames dropped
An android library for displaying fps from the choreographer and percentage of time with two or more frames dropped

DEPRECATED TinyDancer is deprecated. No more development will be taking place. Check out the Google Android developer documentation for UI performance

It makes a preview from an url, grabbing all the information such as title, relevant texts and images. This a version for Android of my web link preview https://github.com/LeonardoCardoso/Link-Preview
It makes a preview from an url, grabbing all the information such as title, relevant texts and images. This a version for Android of my web link preview https://github.com/LeonardoCardoso/Link-Preview

LeoCardz Link Preview for Android It makes a preview from an url, grabbing all the information such as title, relevant texts and images. Visual Exampl

A plug and play ;) android library for displaying a
A plug and play ;) android library for displaying a "rate this app" dialog

Easy Rating Dialog This lib provides a simple way to display an alert dialog for rating app. Default conditions to show: User opened the app more than

Releases(1.3.12)
Owner
Gabriel
Gabriel
A simple and scalable Android bot emulation framework, as presented at Black Hat Europe's Arsenal

m3 A simple and scalable Android bot emulation framework. A detailed explanation can be found here. This project was first published at Black Hat Euro

null 22 Aug 20, 2022
Android framework for node.js applications

Introduction Anode is an embryonic framework for running node.js applications on Android. There are two main parts to this: a port of node.js to the A

Paddy Byers 586 Dec 9, 2022
A Java client for the Sixpack A/B testing framework https://github.com/seatgeek/sixpack

sixpack-java A Java client for SeatGeek's Sixpack a/b testing framework: https://github.com/seatgeek/sixpack Installing Sixpack-java is currently only

null 135 Oct 7, 2022
A RS3 RSPS framework targeted at NXT, the goal is to stay up-to-date with RS3

OpenNXT - RS3 919 A RS3 RSPS framework targeted at NXT, the goal is to stay up-to-date with RS3 Discord We have a Discord server you can join! https:/

Daniël Voort 23 Oct 13, 2022
JVM Bytecode Transformation Framework

unboks - JVM Bytecode Transformation Framework ⚠️ Read the State of the Project section before considering use! ⚠️ This framework exposes a graph-base

Anders Høst 1 May 25, 2022
An auto IBCS API response status checking tool which test tax, address and account module

IB IBCS API Test Tool An auto IBCS API response status checking tool which test tax, address and account module. Getting Started Cd to the cloned dire

Gabriel Liu 0 Oct 15, 2021
Open-source Desktop library to connect Alsat pardakht peyment API

Open-source Desktop library to connect Alsat pardakht peyment API

Alsat Pardakht 3 Apr 4, 2022
Vanced Manager built with official vanced source & my API

Vanced Manager (mirrored) This is a version of Vanced Manager using mirrors that I did myself, since the official APIs were disabled along with the di

Mahin Ahmed 4 Jul 31, 2022
Using Resilience4J, this is a Demo project which uses a Library as background and manages all its requests.

Using Resilience4J, this is a Demo project which uses a Library as background and manages all its requests. This library can rent books online and the usage rate is extremely high. There is a reactive way to access, which is the one normally used, but sometimes, the system needs a bit of help from an old machine running a non-reactive MVC Spring application using JPA. Let's make this in Kotlin and find the best solution!

João Filipe Sabino Esperancinha 2 Jan 10, 2022
Make your IDE play Wilhelm Scream effect when you are using unsafe !! operator in Kotlin

Make your IDE play Wilhelm Scream effect when you are using unsafe !! operator in Kotlin

Mikhail Levchenko 78 Nov 15, 2022