#Allow ButtonBuilder to be URL or Custom ID only
5 messages · Page 1 of 1 (latest)
no?
It would be very useful if the Button Builder could be either a builder for a URL or a Custom ID. This way, I can set my functions to only accept Builders that are Custom ID builders. Right now, there is no easy way to filter out the builders for URLs without first converting them to JSON, which is not what I want.
There was some recent discussion on this #999222347682812005 here, Monbrey provided one way to do it 🤔
The nature of a builder is that the internal data isn't just with or without a customId, because it's a tool for building all the fields. The customId, the style, or anything really might not even be set yet.
Converting to JSON first is the correct way, because that will perform the validation and create an object with the required fields definitely set, which is typeguardable.