The simple version
Create a command called !song whose reply is the credit line, for example Music: Purrple Cat, CC BY 4.0. The command generator builds the exact text for your bot.
Nightbot
In chat, as the channel owner or a moderator: !commands add !song Music: Purrple Cat, CC BY 4.0
StreamElements
Use !command add song Music: Purrple Cat, CC BY 4.0, or add it in the dashboard under custom commands.
Always up to date: fetch a text file
Both bots can read a plain-text URL. This site serves https://streamerfriendly.com/credit.txt. In Nightbot the reply becomes $(urlfetch https://streamerfriendly.com/credit.txt), and in StreamElements ${customapi.https://streamerfriendly.com/credit.txt}.
Which track is playing?
A static website can’t tell your chat bot what is playing in OBS, so the command gives the general credit or a track you pick. The overlay shows the live track on screen.
Other bots
For Streamlabs Cloudbot, Fossabot, Moobot and Kick bots, create a custom command in the dashboard and paste the reply from the generator.
Twitch chat messages are limited to 500 characters: the generator shows a counter.
Questions
Do I need a !song command to comply with the licence?
No, but credit is required somewhere. A command, a panel and the overlay together are a good habit.
Can the command show the current track automatically?
Not from a static page. Use the overlay for the live track on screen.