WebRodent / chappie-gpt-bot

BSD 2-Clause "Simplified" License
0 stars 1 forks source link

Response text from OpenAI to long for discord #2

Closed Brakistad closed 1 year ago

Brakistad commented 1 year ago

discord has a message cap on 2000.

The error message i got:

DiscordAPIError[50035]: Invalid Form Body
content[BASE_TYPE_MAX_LENGTH]: Must be 2000 or fewer in length.
    at SequentialHandler.runRequest (/workspaces/chappie-gpt-bot/node_modules/@discordjs/rest/dist/lib/handlers/SequentialHandler.cjs:293:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async SequentialHandler.queueRequest (/workspaces/chappie-gpt-bot/node_modules/@discordjs/rest/dist/lib/handlers/SequentialHandler.cjs:99:14)
    at async REST.request (/workspaces/chappie-gpt-bot/node_modules/@discordjs/rest/dist/lib/REST.cjs:52:22)
    at async TextChannel.send (/workspaces/chappie-gpt-bot/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:175:15) {
  rawError: {
    message: 'Invalid Form Body',
    code: 50035,
    errors: {
      content: {
        _errors: [
          {
            code: 'BASE_TYPE_MAX_LENGTH',
            message: 'Must be 2000 or fewer in length.'
          }
        ]
      }
    }
  },
  code: 50035,
  status: 400,
  method: 'POST',
  url: 'https://discord.com/api/v10/channels/1142174611946082496/messages',
  requestBody: {
    files: [],
    json: {
      content: 'To improve client outreach early in the development of a new product, you can consider implementing the following strategies:\n' +
        '\n' +
        '1. Clearly define your target audience: Understand who your product is intended for and what problem it solves. This will help you tailor your outreach efforts and reach the right people.\n' +
        '\n' +
        '2. Create a compelling value proposition: Clearly communicate the unique benefits and value your product offers to potential clients. Show them how it will solve their pain points or improve their lives.\n' +
        '\n' +
        '3. Develop a strong online presence: Build a professional website, create engaging content, and leverage social media platforms to reach potential clients. Regularly share valuable information and engage in conversations to build your brand and attract attention.\n' +
        '\n' +
        '4. Utilize networking opportunities: Attend industry events, conferences, and trade shows where you can meet potential clients face-to-face. Focus on building relationships, showcasing your product, and collecting contact information for further follow-up.\n' +
        '\n' +
        '5. Offer product demos or free trials: Provide potential clients with an opportunity to experience your product firsthand. This can help build trust, demonstrate its value, and increase the likelihood of conversion.\n' +
        '\n' +
        '6. Invest in targeted advertising: Use online advertising platforms to reach your target audience directly. This can include search engine ads, social media ads, or targeted email campaigns.\n' +
        '\n' +
        '7. Leverage partnerships and influencers: Identify strategic partnerships or influencers in your industry who can help promote your product to their existing network of clients or followers.\n' +
        '\n' +
        '8. Gather and showcase positive reviews: Encourage early adopters to share their positive experiences and reviews. These testimonials can help build credibility and trust in your product.\n' +
        '\n' +
        '9. Implement a referral program: Incentivize existing clients to refer your product to others. This can help expand your reach and attract new clients.\n' +
        '\n' +
        '10. Continuously track and analyze results: Monitor the effectiveness of your outreach efforts and make data-driven adjustments as needed. Use analytics tools to gain insights into your client acquisition process and identify areas for improvement.\n' +
        '\n' +
        'Remember, successful client outreach requires a combination of targeted marketing, relationship-building, and delivering a valuable product. Adapt your strategies based on your specific industry, target audience, and product offering.',
      tts: false,
      nonce: undefined,
      embeds: undefined,
      components: undefined,
      username: undefined,
      avatar_url: undefined,
      allowed_mentions: undefined,
      flags: undefined,
      message_reference: undefined,
      attachments: undefined,
      sticker_ids: undefined
    }
  }
}
Brakistad commented 1 year ago

6c1af96 fixed the issue