From ec94732984cde284bdefba24dc9b8ba6d1e7aebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E8=B6=85=E8=B6=8A?= <993921@qq.com> Date: Sun, 17 Mar 2024 22:18:43 +0800 Subject: [PATCH] translation --- config/config.toml | 6 +++--- telegram/handle.go | 22 ++++++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/config/config.toml b/config/config.toml index 57af796..b6831f4 100644 --- a/config/config.toml +++ b/config/config.toml @@ -19,9 +19,9 @@ max_backups=3 #消息模板 [message] -join_hint="欢迎 [%s](%s) 加入 %s\n ⚠️本群已开启新成员验证功能,未通过验证的用户无法发言 \n超时未完成验证会被移除本群! \n⏱本条消息 %d 秒后自动删除\n👇点击下方按钮自助解除禁言" -captcha_image="欢迎您加入[%s]!\n⚠本群已开启新成员验证功能。\n👆为了证明您不是机器人,请发送以上图片验证码内容\n🤖机器人将自动验证您发送的验证码内容是否正确\n⏱本条验证消息有效期[%d]秒" -verification_complete="恭喜您成功通过[🤖人机验证],系统已为您解除禁言限制。\n如若还是无法发言,请重启telegram客户端\n请同时注意群内发言规范,以防永久禁止" +join_hint="Welcom [%s](%s) to join %s\\!\n ⚠️ This group has enabled new member verification\\.\n User who failed to complete verification in time will be removed from this group\\!\n ⏱ This message will be deleted after %d seconds automatically\\.\n 👇 Click the button below to self\\-unmute\\." +captcha_image="Welcome to join[%s]!\n⚠This group has enabled new member verification.\n👆Please send the captcha above\n🤖I'll check if it is correct\n⏱This message is vaild in [%d]seconds" +verification_complete="Welcome to join us!\nYou can restart telegram if you still can't speak.\nPlease also pay attention to the norms of communication to avoid permanent bans." block_hint="\\#封禁预警\n[%s](%s) 请注意,您的消息中含有部分违禁词 \n⚠️您已被系统判断为高风险用户,已被封禁\n系统已向超管发送预警信息,若由超管判定为误杀,会及时将您解除封禁。\n您的违禁词包含:%s" #广告阻止 diff --git a/telegram/handle.go b/telegram/handle.go index 6523f95..bdeb119 100644 --- a/telegram/handle.go +++ b/telegram/handle.go @@ -64,7 +64,7 @@ func StartCaptcha(c tb.Context) error { File: tb.FromDisk(imgUrl), Caption: captchaMessage, } - refreshCaptchaImageBtn := captchaMessageMenu.Data("🔁刷新验证码", "refreshCaptchaImageBtn", captchaId) + refreshCaptchaImageBtn := captchaMessageMenu.Data("🔁Refresh", "refreshCaptchaImageBtn", captchaId) Bot.Handle(&refreshCaptchaImageBtn, refreshCaptcha()) captchaMessageMenu.Inline( captchaMessageMenu.Row(refreshCaptchaImageBtn), @@ -72,7 +72,7 @@ func StartCaptcha(c tb.Context) error { botMsg, err := Bot.Send(c.Chat(), sendMessage, captchaMessageMenu) if err != nil { log.Sugar.Error("[StartCaptcha] send image captcha err:", err) - return c.Send("服务器异常~,请稍后再试") + return c.Send("Service is busy,please try later") } err = service.SetCaptchaCodeMessageIdByCaptchaId(captchaId, botMsg.ID) if err != nil { @@ -165,12 +165,12 @@ func VerificationProcess(c tb.Context) error { captchaId, ok := captchaIdObj.(string) if !ok { log.Sugar.Error("Value is not a string") - return c.Send("服务器异常~,请稍后再试") + return c.Send("Service is busy,please try later") } captchaRecord, err := service.GetRecordByCaptchaId(captchaId) if err != nil { log.Sugar.Error("[VerificationProcess] GetRecordByCaptchaId err:", err) - return c.Send("服务器异常~,请稍后再试") + return c.Send("Service is busy,please try later") } if captchaRecord.ID <= 0 || captchaRecord.TelegramUserId != c.Sender().ID || captchaRecord.CaptchaStatus != model.CaptchaStatusPending { return c.Send("您在该群没有待验证记录,或已超时,请重新加入后验证") @@ -178,7 +178,7 @@ func VerificationProcess(c tb.Context) error { // 验证 replyCode := c.Message().Text if !captcha.VerifyCaptcha(captchaRecord.CaptchaCode, replyCode) { - return c.Send("验证码错误,请重新输入!") + return c.Send("Incorrect captcha") } // 解禁用户 err = Bot.Restrict(&tb.Chat{ID: captchaRecord.TelegramChatId}, &tb.ChatMember{ @@ -187,7 +187,7 @@ func VerificationProcess(c tb.Context) error { }) if err != nil { log.Sugar.Error("[OnTextMessage] unban err:", err) - return c.Send("服务器异常~,请稍后重试~") + return c.Send("Service is busy,please try later") } err = service.SuccessRecordByCaptchaId(captchaId) if err != nil { @@ -205,6 +205,8 @@ func VerificationProcess(c tb.Context) error { func UserJoinGroup(c tb.Context) error { var err error + m := c.ChatMember().NewChatMember.Role + _ = m if c.ChatMember().NewChatMember.Role != tb.Member { return nil } @@ -232,10 +234,10 @@ func UserJoinGroup(c tb.Context) error { chat.Title, config.SystemC.JoinHintAfterDelTime) captchaId := uuid.NewV4().String() - doCaptchaBtn := joinMessageMenu.URL("👉🏻点我开始人机验证🤖", fmt.Sprintf("https://t.me/%s?start=%s", Bot.Me.Username, captchaId)) + doCaptchaBtn := joinMessageMenu.URL("👉🏻To Verify🤖", fmt.Sprintf("https://t.me/%s?start=%s", Bot.Me.Username, captchaId)) var ( - manageBanBtn = joinMessageMenu.Data("👮‍管理员禁止🈲", "manageBanBtn", captchaId) - managePassBtn = joinMessageMenu.Data("👮‍管理员通过✅", "managePassBtn", captchaId) + manageBanBtn = joinMessageMenu.Data("👮Ban🈲", "manageBanBtn", captchaId) + managePassBtn = joinMessageMenu.Data("👮Pass✅", "managePassBtn", captchaId) ) // 按钮点击事件 Bot.Handle(&manageBanBtn, ManageBan(), isManageMiddleware) @@ -366,7 +368,7 @@ func refreshCaptcha() func(c tb.Context) error { }) } return c.Respond(&tb.CallbackResponse{ - Text: "验证码已刷新~", + Text: "Refreshed", }) } }