freya022 / botcommands Goto Github PK
View Code? Open in Web Editor NEWA JDA command framework (& much more) which helps to develop your bots faster
Home Page: https://freya022.github.io/BotCommands/
License: Mozilla Public License 2.0
A JDA command framework (& much more) which helps to develop your bots faster
Home Page: https://freya022.github.io/BotCommands/
License: Mozilla Public License 2.0
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
Live templates:
autocomplete
: Annotated autocomplete methodbuttonListener
: Annotated listener methodselectListener
: Annotated listener methodeventListener
: Annotated listener methodlogger
: Uses Logging
for Java, KotlinLogger
for KotlinFile templates:
Enables fail-fast when using LocalizationContext#withBundle
This should not perform worse as using a localization context is now on-demand
Requires on JDAService
and custom conditional annotations
Provide factories so Java users can at least change the executor
Will be useful for Loom, possibly allowing for #complete
to be used, facilitating post-interaction hooks
Should return null if the template does not exist
Depends on fail-fast LocalizationContext
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)
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)
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
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
Depends on JDAService
Warnings can be suppressed by giving suppressed intents in BConfig
This will avoid having to use constants
Perhaps use extension functions accepting KFunction[N]
, with up to 10 arguments
Careful to give links to Java variants in README
s
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, 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?
This does not imply JDA will be started when this interface is used
The interface would allow retrieving enabled intents
Allows replying a localized message (ephemeral or not), only accept PairEntry for arguments
One goal would be allowing users to efficiently create parameter resolvers for enumerations, such as:
@BService
fun timeUnitResolver() = enumResolver<TimeUnit> { unit ->
// Return the choice name for autocomplete
unit.name.lowercase().replaceFirstChar { it.uppercase() }
}
Consider giving a similar Java API
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
This is critical for manually-parsed commands
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.