Giter Club home page Giter Club logo

Comments (8)

invakid404 avatar invakid404 commented on May 28, 2024 1

Latest dev works like a charm, thanks @lcsmuller!

from concord.

invakid404 avatar invakid404 commented on May 28, 2024 1

Cool, I'll just use the dev branch for now.

from concord.

lcsmuller avatar lcsmuller commented on May 28, 2024

Thanks for notifying us - are you able to replicate this bug from the dev branch?

from concord.

invakid404 avatar invakid404 commented on May 28, 2024

@lcsmuller indeed. I can tell the function name was renamed (an 's' was appended), but it still takes a discord_application_commands struct, so I'm assuming it's still putting "id":0 for all of the commands in the request body.

Here's the actual Discord API response btw:

02:59:05 ERROR discord-rest_request.c:382: [DISCORD_REQUEST] {"code": 50035, "errors": {"0": {"_errors": [{"code": "APPLICATION_COMMANDS_INVALID_ID", "message": "Invalid application command id provided"}]}}, "message": "Invalid Form Body"}

from concord.

lcsmuller avatar lcsmuller commented on May 28, 2024

Please give latest dev a try, if you're doing a git pull make sure to run make purge first so gencodecs files are generated from scratch.

from concord.

invakid404 avatar invakid404 commented on May 28, 2024

BTW, since I'm not familiar with your release schedule, when can I expect a new release to come out for the fix?

from concord.

lcsmuller avatar lcsmuller commented on May 28, 2024

BTW, since I'm not familiar with your release schedule, when can I expect a new release to come out for the fix?

Hopefully soon but we still got a couple things that needs to be tackled first. You can keep track of #74 to know when the next release has been merged, or join our Discord server to get notified.

from concord.

NEsanya avatar NEsanya commented on May 28, 2024

I'm using dev version of library and this still doesn't work.

Reproduction:

  1. Library installation
git clone https://github.com/Cogmasters/concord
cd concord
git checkout dev
make
sudo make install
  1. Code
#include <concord/discord.h>
#include <string.h>

void on_ready(struct discord *client, const struct discord_ready *event) {
  struct discord_create_global_application_command params = {
      .name = "example", .description = "example description"};
  discord_bulk_overwrite_global_application_commands(
      client, event->application->id, &params, NULL);
}

void on_interaction(struct discord *client,
                    const struct discord_interaction *event) {
  if (event->type != DISCORD_INTERACTION_APPLICATION_COMMAND)
    return; /* return if interaction isn't a slash command */

  if (strcmp(event->data->name, "example") == 0) {
    struct discord_interaction_response params = {
        .type = DISCORD_INTERACTION_CHANNEL_MESSAGE_WITH_SOURCE,
        .data = &(struct discord_interaction_callback_data){.content = "pong"}};
    discord_create_interaction_response(client, event->id, event->token,
                                        &params, NULL);
  }
}

int main() {
  struct discord *client = discord_init("PASTE YOUR TOKEN HERE!");
  discord_set_on_ready(client, &on_ready);
  discord_set_on_interaction_create(client, &on_interaction);
  discord_run(client);
  return 0;
}
  1. Compilation command
    clang main.c -o main -g -ldiscord -lcurl

image
image

from concord.

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.