mirror of
https://codeberg.org/SafeTwitch/safetwitch-backend.git
synced 2025-01-10 14:50:11 -05:00
23 lines
444 B
Go
23 lines
444 B
Go
|
package chat
|
||
|
|
||
|
import (
|
||
|
"github.com/gin-gonic/gin"
|
||
|
|
||
|
"safetwitch-backend/extractor"
|
||
|
"safetwitch-backend/extractor/twitch"
|
||
|
)
|
||
|
|
||
|
func Routes(route *gin.Engine) {
|
||
|
auth := route.Group("/api/chat")
|
||
|
|
||
|
auth.GET(":streamerName/history", func(context *gin.Context) {
|
||
|
data, err := twitch.GetChatHistory(context.Param("streamerName"))
|
||
|
if err != nil {
|
||
|
context.Error(err)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
context.JSON(200, extractor.FormatMessage(data, true))
|
||
|
})
|
||
|
}
|