commit
This commit is contained in:
@@ -17,7 +17,6 @@ func RegisterAdmin() *laniakea.Plugin[database.Context] {
|
||||
p := laniakea.NewPlugin[database.Context]("Admin")
|
||||
p.AddCommand(laniakea.NewCommand(uploadPhoto, "uploadPhoto").SkipCommandAutoGen())
|
||||
p.AddCommand(laniakea.NewCommand(emojiId, "emojiId").SkipCommandAutoGen())
|
||||
p.AddCommand(laniakea.NewCommand(getProxy, "proxy").SkipCommandAutoGen())
|
||||
p.AddCommand(laniakea.NewCommand(execSql, "sql").SkipCommandAutoGen())
|
||||
|
||||
p.AddMiddleware(AdminMiddleware())
|
||||
@@ -62,14 +61,7 @@ func execSql(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
}
|
||||
ctx.Answerf("`%s`", data)
|
||||
}
|
||||
func getProxy(ctx *laniakea.MsgContext, _ *database.Context) {
|
||||
ruProxy := "tg://proxy?port=3128&secret=7qaZyfQN-IQ7ZMwrR_zWnHBvem9uLnJ1&server=185.231.245.25"
|
||||
fiProxy := "tg://proxy?port=3128&secret=7vmNtw_233xvIRFvImm2PLtvem9uLnJ1&server=46.243.6.125"
|
||||
kb := laniakea.NewInlineKeyboard(1)
|
||||
kb.AddUrlButtonStyle("🇷🇺Russia", laniakea.ButtonStylePrimary, ruProxy)
|
||||
kb.AddUrlButtonStyle("🇫🇮Finland", laniakea.ButtonStylePrimary, fiProxy)
|
||||
ctx.Keyboard("Доступные прокси", kb)
|
||||
}
|
||||
|
||||
func emojiId(ctx *laniakea.MsgContext, _ *database.Context) {
|
||||
var id string
|
||||
for _, e := range ctx.Msg.Entities {
|
||||
|
||||
34
plugins/ban.go
Normal file
34
plugins/ban.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package plugins
|
||||
|
||||
import (
|
||||
"ymgb/database"
|
||||
"ymgb/utils"
|
||||
|
||||
"git.nix13.pw/scuroneko/laniakea"
|
||||
)
|
||||
|
||||
func RegisterProxy() *laniakea.Plugin[database.Context] {
|
||||
p := laniakea.NewPlugin[database.Context]("Proxy")
|
||||
p.AddCommand(laniakea.NewCommand(getH2Link, "h2link"))
|
||||
p.AddCommand(laniakea.NewCommand(getProxy, "proxy"))
|
||||
return p
|
||||
}
|
||||
|
||||
func getH2Link(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
api := utils.NewHysteria2API()
|
||||
url, err := api.GetConnectLink(1, "K1321xt90RUS")
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
return
|
||||
}
|
||||
ctx.Answerf("`%s`", url)
|
||||
}
|
||||
|
||||
func getProxy(ctx *laniakea.MsgContext, _ *database.Context) {
|
||||
ruProxy := "tg://proxy?port=3128&secret=7qaZyfQN-IQ7ZMwrR_zWnHBvem9uLnJ1&server=185.231.245.25"
|
||||
fiProxy := "tg://proxy?port=3128&secret=7vmNtw_233xvIRFvImm2PLtvem9uLnJ1&server=46.243.6.125"
|
||||
kb := laniakea.NewInlineKeyboard(1)
|
||||
kb.AddUrlButtonStyle("🇷🇺Russia", laniakea.ButtonStylePrimary, ruProxy)
|
||||
kb.AddUrlButtonStyle("🇫🇮Finland", laniakea.ButtonStylePrimary, fiProxy)
|
||||
ctx.Keyboard("Доступные прокси", kb)
|
||||
}
|
||||
@@ -453,7 +453,7 @@ func newChatStage2(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
//if err != nil {
|
||||
// ctx.Error(err)
|
||||
//}
|
||||
//ctx.AnswerCbQueryText(fmt.Sprintf("Ты выбрал сеттинг %s", setting.Name))
|
||||
//ctx.AnswerCbQueryText(fmt.Sprintf("Ты выбрал сеттинг %s", setting.name))
|
||||
ctx.AnswerCbQuery()
|
||||
}
|
||||
func newChat(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
|
||||
Reference in New Issue
Block a user