You can use Twitch's Eventsub to recieve a notification when a Stream goes live then modify the payload to match Discord's Webhook format and forward the payload on. Which is essentially what IFTTT does anyway.
Currently EventSub only offers a Webhook Transport. So you need a "Server" that can recieve a HTTP Post from Twitch.
Twitch EventSub is covered here https://dev.twitch.tv/docs/eventsub
Discord Webhooks is covered here https://discord.com/developers/docs/resources/webhook
If you want your Discord Bot to do it itself, then you generally would not use EventSub as you don't want your Bot process to be directly web accesable, so you'd have to poll the Streams Endpoint of the Helix API periodically and test for the Stream changing from offline to online and do whatever is needed. (Or setup a side process to recieve and internal relay the data)
You would use a Twitch App Access/Client Credentials Token, since this is a server to server request.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…