Refactoring codes for more tg message types

This commit is contained in:
2026-03-07 22:16:14 +08:00
parent a396a381b5
commit 912f9fd0ad
26 changed files with 771 additions and 472 deletions

View File

@@ -13,6 +13,9 @@ type QueryResult struct {
Lang string
Error error
Query *query.QueryObject
ResultType string
isConsumed bool
}
func writeCCharInfo(sb *strings.Builder, cc *CChar) {
@@ -37,14 +40,20 @@ func writeCCharInfo(sb *strings.Builder, cc *CChar) {
}
}
func (this QueryResult) DataType() string { return this.ResultType }
func (this QueryResult) Consumed() bool { return this.isConsumed }
func (this QueryResult) GetTableData() [][]map[string]string { return nil }
func (this QueryResult) Message() (string, error) {
this.ResultType = "PlainText"
if this.Error != nil {
return "", this.Error
}
if this.Query == nil {
panic("Query is nil")
return "", nil
}
sb := strings.Builder{}