Refactoring codes for more tg message types
This commit is contained in:
@@ -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{}
|
||||
|
||||
Reference in New Issue
Block a user