Add support of Chat Notifications

This commit is contained in:
Dmitrii Okunev
2024-10-28 19:33:14 +00:00
parent e0bc4885ba
commit 0d5fbafa24
7 changed files with 165 additions and 79 deletions

View File

@@ -27,6 +27,10 @@ func Eval[T any](
if value == "" {
return result, nil
}
if v, ok := any(value).(T); ok {
return v, nil
}
_, err = fmt.Sscanf(value, "%v", &result)
if err != nil {
return result, fmt.Errorf("unable to scan value '%v' into %T: %w", value, result, err)