other: the last moving to the best domain name damn it.

This commit is contained in:
Andrey Parhomenko 2024-05-15 22:41:53 +05:00
parent e119b75640
commit c576e891b8
9 changed files with 20 additions and 22 deletions

View file

@ -1,18 +1,18 @@
package main package main
import ( import (
"vultras.su/core/tg" "surdeus.su/core/tg"
"os" "os"
) )
var UsageAction = tg.Func(func(c tg.Context){ var UsageAction = tg.Func(func(c tg.Context) {
c.Sendf( c.Sendf(
"There is no such command %q", "There is no such command %q",
c.CallbackUpdate().Message.Command(), c.CallbackUpdate().Message.Command(),
) )
}) })
var PreStartAction = tg.Func(func(c tg.Context){ var PreStartAction = tg.Func(func(c tg.Context) {
c.Sendf("Please, use /start ") c.Sendf("Please, use /start ")
}) })
@ -25,7 +25,7 @@ var BotCommands = []tg.Command{
"info", "info",
"info desc", "info desc",
).WithAction(tg.Func(func(c tg.Context) { ).WithAction(tg.Func(func(c tg.Context) {
c.SendfHTML(`<a href="https://res.cloudinary.com/demo/image/upload/v1312461204/sample.jpg">cock</a><strong>cock</strong> die`) c.SendfHTML(`<a href="https://res.cloudinary.com/demo/image/upload/v1312461204/sample.jpg">cock</a><strong>cock</strong> die`)
})), })),
tg.NewCommand("hello", "sends the 'Hello, World!' message back"). tg.NewCommand("hello", "sends the 'Hello, World!' message back").
WithAction(tg.Func(func(c tg.Context) { WithAction(tg.Func(func(c tg.Context) {
@ -84,4 +84,3 @@ var BotCommands = []tg.Command{
) )
})), })),
} }

View file

@ -1,7 +1,7 @@
package main package main
import ( import (
"vultras.su/core/tg" "surdeus.su/core/tg"
"fmt" "fmt"
) )
@ -63,4 +63,3 @@ var IncDecWidget = tg.RenderFunc(func(c tg.Context) tg.UI {
), ),
} }
}) })

View file

@ -1,7 +1,7 @@
package main package main
import ( import (
"vultras.su/core/tg" "surdeus.su/core/tg"
) )
var HomeButton = tg.Buttonf("Home").Go("/") var HomeButton = tg.Buttonf("Home").Go("/")

View file

@ -1,7 +1,7 @@
package main package main
import ( import (
"vultras.su/core/tg" "surdeus.su/core/tg"
) )
const ( const (

View file

@ -4,7 +4,7 @@ import (
"log" "log"
"os" "os"
"vultras.su/core/tg" "surdeus.su/core/tg"
) )
type BotData struct { type BotData struct {
@ -74,7 +74,7 @@ func main() {
log.Panic(err) log.Panic(err)
} }
bot = bot.SetBehaviour(beh) bot = bot.SetBehaviour(beh)
//SetDebug(true) //SetDebug(true)
bot.SetData(&BotData{ bot.SetData(&BotData{
Name: "Jay", Name: "Jay",

View file

@ -1,7 +1,7 @@
package main package main
import ( import (
"vultras.su/core/tg" "surdeus.su/core/tg"
"strings" "strings"
) )
@ -44,10 +44,10 @@ func (w *MutateMessageCompo) Filter(u tg.Update) bool {
} }
const ( const (
UpperCasePath tg.Path = "upper-case" UpperCasePath tg.Path = "upper-case"
LowerCasePath = "lower-case" LowerCasePath = "lower-case"
EscapePath = "escape" EscapePath = "escape"
MutateMessagesPath = "mutate-messages" MutateMessagesPath = "mutate-messages"
) )
var MutateMessagesWidget = tg.RenderFunc(func(c tg.Context) tg.UI { var MutateMessagesWidget = tg.RenderFunc(func(c tg.Context) tg.UI {
@ -97,4 +97,3 @@ var MutateMessagesEscapeWidget = tg.RenderFunc(func(c tg.Context) tg.UI {
NewMutateMessageCompo(tg.Escape2), NewMutateMessageCompo(tg.Escape2),
} }
}) })

View file

@ -1,7 +1,7 @@
package main package main
import ( import (
"vultras.su/core/tg" "surdeus.su/core/tg"
) )
const ( const (
@ -10,8 +10,8 @@ const (
var PanelWidget = tg.RenderFunc(func(c tg.Context) tg.UI { var PanelWidget = tg.RenderFunc(func(c tg.Context) tg.UI {
var ( var (
n = 0 n = 0
ln = 4 ln = 4
panel *tg.PanelCompo panel *tg.PanelCompo
) )

View file

@ -1,13 +1,14 @@
package main package main
import ( import (
"vultras.su/core/tg" "surdeus.su/core/tg"
"fmt" "fmt"
) )
const ( const (
StartAbsPath tg.Path = "/" StartAbsPath tg.Path = "/"
) )
var StartWidget = tg.RenderFunc(func(c tg.Context) tg.UI { var StartWidget = tg.RenderFunc(func(c tg.Context) tg.UI {
return tg.UI{ return tg.UI{
tg.Messagef( tg.Messagef(

2
go.mod
View file

@ -1,4 +1,4 @@
module vultras.su/core/tg module surdeus.su/core/tg
go 1.20 go 1.20