Git Product home page Git Product logo

Comments (6)

fischervincent avatar fischervincent commented on August 27, 2024

I would have thought it would work. I didn't not try on a forum channel.
Do you have an error message that might help me investigate? Also if you can send the template you are trying to use it might help me find the issue.

from semantic-release-discord.

oliveirarafa avatar oliveirarafa commented on August 27, 2024

Yeah, for what I searched the code I tought it would work too. Probably i'm doing something wrong since I dont have a lot of pratice with discord APIs.

My plugin config is:

...
[
      "semantic-release-discord",
      {
        notifyOnFail: false,
        onSuccessTemplate: {
          thread_name: "GOVBR-DS ($package_name) v$npm_package_version",
          content:
            "A versão v$npm_package_version do GOVBR-DS ($package_name) já está disponível no NPMJS! :partying_face:\n\nPara conhecer melhor as novidades:\n\n:book: [Página de releases]($repo_url/-/releases 'Releases')\n\n:computer: [Repositório no Gitlab]($repo_url)\n\nDeseja contribuir com o Design System? Consulte a nossa [wiki](https://govbr-ds.gitlab.io/govbr-ds-wiki/ 'Wiki GOVBR-DS') para mais detalhes.",
          embeds: [
            {
              color: 16736031,
              description: "$release_notes",
              title: "RELEASE NOTES",
              url: "$repo_url/-/releases/$npm_package_version",
            },
          ],
          username: "GOVBR-DS - Core v$npm_package_version",
        },
      },
    ]

I get the following error message:

[1:41:28 AM] [semantic-release] › ✔  Completed step "fail" of plugin "semantic-release-discord"
[1:41:28 AM] [semantic-release] › ✖  DISCORD CALL FAILED Webhooks posted to forum channels must have a thread_name or thread_id
AggregateError: 
    SemanticReleaseError: Webhooks posted to forum channels must have a thread_name or thread_id
        at module.exports (/builds/govbr-ds/dev/govbr-ds-dev-core/node_modules/semantic-release-discord/src/utils/post-message-to-discord.js:13:11)

The messagem tells me that i'm not passing the thread_name to the API call, but I tried putting the param on different places with different strings and got the same result. Using the same webhook and the CLI I managed to post a message on the forum to see that it works. The command that I used on CLI was:

curl https://discord.com/api/webhooks/[ID]/[TOKEN] -H "Content-Type: application/json" --data '{"thread_name": "Thread Name", "content": "Content", "username": "Blue"}'

from semantic-release-discord.

fischervincent avatar fischervincent commented on August 27, 2024

My guess is that it is "discord.js" the issue (v12). I will try to use the last version of discord.js, if nothing breaks I will push it.
I will let you know.

from semantic-release-discord.

fischervincent avatar fischervincent commented on August 27, 2024

I upgraded discordjs to 14.
I was not able to create a forum so I could not try the fix.
Let me know if that solves the issue.
1.2.0

from semantic-release-discord.

oliveirarafa avatar oliveirarafa commented on August 27, 2024

Ok. I'll try and let you know. Thank you very much!

from semantic-release-discord.

oliveirarafa avatar oliveirarafa commented on August 27, 2024

Ok. I'll try and let you know. Thank you very much!

Well, now it is working.

It needed 2 things:

  1. Update discord.js
  2. Use threadName instead of thread_name

The second really bugged me but I found a documentation here with the correct name.

Now its is working. Thank you very much!

from semantic-release-discord.

Related Issues (4)

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.