* main: refactor MESSAGe_CREATE event to separate function * main: add thread channel as child to guild text channel * main: write thread channel messages to messages TextView on select * *: refactor to use for range loops * main: write discord.Message.ReferencedMessage if message type is ThreadStarterMessage * fix(util): write Message.Content if it is not an empty string * refactor(util): remove WriteMessages * refactor(main): defer-close websocket connection * refactor(main): update api.UserAgent to latest * refactor: use named return values * fix: increase guilds TreeView fixedSize * docs(README): update preview
14 lines
280 B
Go
14 lines
280 B
Go
package ui
|
|
|
|
import (
|
|
"github.com/gdamore/tcell/v2"
|
|
"github.com/rivo/tview"
|
|
)
|
|
|
|
func NewApp(onAppInputCapture func(*tcell.EventKey) *tcell.EventKey) (app *tview.Application) {
|
|
app = tview.NewApplication().
|
|
EnableMouse(true).
|
|
SetInputCapture(onAppInputCapture)
|
|
|
|
return app
|
|
}
|