1
0
mirror of https://github.com/fumiama/NanoBot.git synced 2026-06-16 08:20:31 +08:00

optimize: メッセージ送信機能

This commit is contained in:
源文雨
2023-10-17 23:34:07 +09:00
parent d82564e798
commit 9c5a9796e1
4 changed files with 50 additions and 23 deletions

View File

@@ -63,6 +63,14 @@ func MessageUnescape(text string) string {
return text
}
// HideURL 转义 URL 以避免审核
func HideURL(s string) string {
s = strings.ReplaceAll(s, ".", "…")
s = strings.ReplaceAll(s, "http://", "🔗📄:")
s = strings.ReplaceAll(s, "https://", "🔗🔒:")
return s
}
// UnderlineToCamel convert abc_def to AbcDef
func UnderlineToCamel(s string) string {
sb := strings.Builder{}