discord / discord-api-docs

Official Discord API Documentation
https://discord.com/developers/docs/intro
Other
5.94k stars 1.26k forks source link

Autocomplete payload received by bot does not match user input #5878

Open Gamebuster19901 opened 1 year ago

Gamebuster19901 commented 1 year ago

Description

If the user supplies an argument that ends with whitespace, the autocomplete interaction the bot receives is trimmed, and does not end with whitespace.

My bot is too complex to use slash command options for every argument; so I've opted only one option and provide autocomplete suggestions to the user.

If the user types a space for the next argument, the bot cannot supply suggestions because it does not receive the entire user input.

Steps to Reproduce

  1. Begin typing some text for a command that has autocomplete enabled.
  2. Notice that Autocomplete payload is sent to your bot
  3. Type a Space
  4. Notice that the autocomplete payload is exactly the same, with no space

Expected Behavior

The autocomplete payload will be sent to the bot with the user's exact input.

Current Behavior

The bot receives trimmed input, removing any leading whitespace.

Screenshots/Videos

Video Explaining the issue:

https://www.youtube.com/watch?v=s41KxSMWFwI

Client and System Information

Stable 169617 (1ce88dc) Host 0.0.24 Linux 64-Bit (5.15.0-58-Generic)

Library: net.dv8tion:JDA:5.0.0-beta.3

                          ./+o+-       gamebuster@gamebuster-Ryzen9-3900X-RTX-3080
                  yyyyy- -yyyyyy+      OS: Ubuntu 22.04 jammy
               ://+//////-yyyyyyo      Kernel: x86_64 Linux 5.15.0-58-generic
           .++ .:/++++++/-.+sss/`      Uptime: 3d 3h 27m
         .:++o:  /++++++++/:--:/-      Packages: 3316
        o:+o+:++.`..```.-/oo+++++/     Shell: bash 5.1.16
       .:+o:+o/.          `+sssoo+/    Resolution: 5760x2160
  .++/+:+oo+o:`             /sssooo.   DE: GNOME 41.7
 /+++//+:`oo+o               /::--:.   WM: Mutter
 \+/+o+++`o++o               ++////.   WM Theme: Adwaita
  .++.o+++oo+:`             /dddhhh.   GTK Theme: Yaru-dark [GTK2/3]
       .+.o+oo:.          `oddhhhh+    Icon Theme: Yaru
        \+.++o+o``-````.:ohdhhhhh+     Font: Ubuntu 11
         `:o+++ `ohhhhhhhhyo++os:      Disk: 730G / 1.8T (42%)
           .o:`.syhhhhhhh/.oo++o`      CPU: AMD Ryzen 9 3900X 12-Core @ 24x 3.8GHz
               /osyyyyyyo++ooo+++/     GPU: NVIDIA GeForce RTX 3080
                   ````` +oo+++o\:     RAM: 11524MiB / 32005MiB
                          `oo++.      
Gamebuster19901 commented 1 year ago

Any updates on this? I still can't give suggestions correctly for my bots.