Coder Social home page Coder Social logo

Comments (3)

Katrix avatar Katrix commented on August 31, 2024

I've been planning some in general higher level API on top of AckCord, but that's some way into the future.

As for how commands will look, not sure. Probably won't go with annotation macros though because they play horrible with IntelliJ, and I have no idea how long they will stay alive.

In the meantime though, there's always the slightly less verbose non raw commands.

client.registerCmd[NotUsed, Id](
  prefix = GeneralCommands,
  aliases = Seq("ping"),
  filters = Seq(CmdFilter.NonBot, CmdFilter.InGuild),
  description = Some(CmdDescription("Ping", "Check if the bot is alive"))
) { _ =>
  println(s"Received ping command}")
}

Another option if you only care about the in memory cache is to not care about the F type at all, just hardcode it as Id in most places.

If I did add some sort of annotation macro, it would probably just be syntactic sugar for the above.

from ackcord.

Katrix avatar Katrix commented on August 31, 2024

To give some update on the situation here. With 0.13 comes a new experimental commands API completely detached from the previous API.

You can see the equivalent of a ping command here https://github.com/Katrix/AckCord/blob/master/exampleCore/src/main/scala/ackcord/examplecore/NewCommandsController.scala#L15

Do note that command registration is not yet as clean, but I got some plans for that too.

from ackcord.

Katrix avatar Katrix commented on August 31, 2024

New commands API is now the default. Old API is being phased out

from ackcord.

Related Issues (20)

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.