Giter VIP home page Giter VIP logo

botcommands's Introduction

Github Stats


Github trophies

botcommands's People

Contributors

dependabot[bot] avatar freya022 avatar oxkitsune avatar

Stargazers

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

Watchers

 avatar  avatar

botcommands's Issues

Add a way to get a list of mentions from a STRING option

Slash parameter resolvers for IMentionable as well as their subtypes would be required

An annotation could be used, so the resolvers (existing ones transformed to resolver factories) can read the annotation and return the appropriate OptionType (STRING instead of [entity type])

Note: this does not require varargs, but the parameter type might need not to be List as it could be confusing and be considered as a vararg. Needs to be checked

Update live templates

Live templates:

  • autocomplete: Annotated autocomplete method
  • buttonListener: Annotated listener method
  • selectListener: Annotated listener method
  • eventListener: Annotated listener method
  • logger: Uses Logging for Java, KotlinLogger for Kotlin

File templates:

  • Service (Java/Kotlin)
  • Condition annotations (Java/Kotlin)
  • Text command (Java/Kotlin/DSL)
  • Slash/user/message command (Java/Kotlin/DSL)

Mentions in Arguments return as U:Name(ID)

When I was setting up a command to work with mentions the arguments return the mention as U:MistyyBoi(635005205104164875) which makes it hard to use the ID to find the member in the guild.
image

DefaultComponentManager with MariaDB

i test it with PostgresSQL and it's working, but when i use MariaDB (with HikariCP) i got error message and stopping when generating table "version"

java.sql.SQLSyntaxErrorException: (conn=31) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'drop sequence if exists group_seq cascade;

create table if not exists Versio...' at line 2
        at org.mariadb.jdbc.export.ExceptionFactory.createException(ExceptionFactory.java:282)
        at org.mariadb.jdbc.export.ExceptionFactory.create(ExceptionFactory.java:370)
        at org.mariadb.jdbc.message.ClientMessage.readPacket(ClientMessage.java:134)
        at org.mariadb.jdbc.client.impl.StandardClient.readPacket(StandardClient.java:883)
        at org.mariadb.jdbc.client.impl.StandardClient.readResults(StandardClient.java:822)
        at org.mariadb.jdbc.client.impl.StandardClient.readResponse(StandardClient.java:741)
        at org.mariadb.jdbc.client.impl.StandardClient.execute(StandardClient.java:665)
        at org.mariadb.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:92)
        at org.mariadb.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:271)
        at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
        at com.freya02.botcommands.api.components.DefaultComponentManager.resetTables(DefaultComponentManager.java:467)
        at com.freya02.botcommands.api.components.DefaultComponentManager.setupTables(DefaultComponentManager.java:431)
        at com.freya02.botcommands.api.components.DefaultComponentManager.<init>(DefaultComponentManager.java:56)
        at saha.Main.main(Main.java:45)

Messages containing only the mention-as-prefix should be ignored

java.lang.IllegalArgumentException: Path component must match regex ^[\w-]+$. Provided: "<@921044182552969246>"
    at net.dv8tion.jda.internal.utils.Checks.check(Checks.java:69)
    at net.dv8tion.jda.internal.utils.Checks.matches(Checks.java:181)
    at com.freya02.botcommands.api.commands.CommandPath.of(CommandPath.java:34)
    at com.freya02.botcommands.internal.commands.prefixed.TextCommandsListener$onMessageReceived$3.invokeSuspend(TextCommandsListener.kt:72)
    at dev.reformator.stacktracedecoroutinator.stdlib.StdlibKt.decoroutinatorResumeWith$lambda$1(stdlib.kt:36)
    at dev.reformator.stacktracedecoroutinator.stdlib.StdlibKt.decoroutinatorResumeWith(stdlib.kt:127)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1623)

Add target-specific filters for text/application/component interactions

Extend command filters, to allow applying them on specific commands.

Global filters must be sorted by their service priority.
Global filters cannot be referenced.

Command DSLs would allow for complex filters using filters += (filter<AdminOnly>() or (filter<ModOnly>() and filter<OwnerOnly>())) and filter<InVoiceChannel>() for example

Annotation would be @Filter(classes) with the services implementing the filters

Components have the same usage as with command DSLs, but requires storing the filters FQCN in the database

Add builder pattern for components

Delegated interfaces could have an instance property of type T

Delegates do not have access to the implementation as the delegates are in their own world

Kotlin does not support this in super constructors or in delegates, so we can use a class which holds our instance, the implementation's init block sets the instance, so it is accessible when the user actually gets its hands on the builder

Separate Java and Kotlin bot templates

Careful to give links to Java variants in READMEs

Environment#folder should be the current working directory

While the examples will remain in Kotlin, examples used in the Wiki should be in Java too

How do you customize the help command?

How do you customize the help command, I've read over the docs several and I might've missed if it was documented, but if it isn't, is there a supported way to edit the help command or do I need to fork the repo and make changes?

Add `runCatchingResponse`

This should allow users to run code which throws certain error responses

The top level function should return Result<Unit> as we cannot recover any data, extensions to Result<Unit> will "recover" the Result (suppress the exception), while still wanting to use Result#getOrThrow to notify the caller of unrelated exceptions

The goal would be to somewhat replicate JDA's ErrorHandler, typical use case is sending a DM, while handling/ignoring only CANNOT_SEND_TO_USER and rethrowing other exceptions/error responses

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.