diff --git a/ent/migrate/schema.go b/ent/migrate/schema.go
index df5c894..7980ec2 100644
--- a/ent/migrate/schema.go
+++ b/ent/migrate/schema.go
@@ -181,6 +181,7 @@ var (
{Name: "chat_id", Type: field.TypeInt64, Unique: true},
{Name: "auto_recap_send_mode", Type: field.TypeInt, Default: 0},
{Name: "manual_recap_rate_per_seconds", Type: field.TypeInt64, Default: 0},
+ {Name: "auto_recap_rates_per_day", Type: field.TypeInt, Default: 0},
{Name: "created_at", Type: field.TypeInt64},
{Name: "updated_at", Type: field.TypeInt64},
}
diff --git a/ent/mutation.go b/ent/mutation.go
index 2fab4fc..fa6b3f0 100644
--- a/ent/mutation.go
+++ b/ent/mutation.go
@@ -8262,6 +8262,8 @@ type TelegramChatRecapsOptionsMutation struct {
addauto_recap_send_mode *int
manual_recap_rate_per_seconds *int64
addmanual_recap_rate_per_seconds *int64
+ auto_recap_rates_per_day *int
+ addauto_recap_rates_per_day *int
created_at *int64
addcreated_at *int64
updated_at *int64
@@ -8544,6 +8546,62 @@ func (m *TelegramChatRecapsOptionsMutation) ResetManualRecapRatePerSeconds() {
m.addmanual_recap_rate_per_seconds = nil
}
+// SetAutoRecapRatesPerDay sets the "auto_recap_rates_per_day" field.
+func (m *TelegramChatRecapsOptionsMutation) SetAutoRecapRatesPerDay(i int) {
+ m.auto_recap_rates_per_day = &i
+ m.addauto_recap_rates_per_day = nil
+}
+
+// AutoRecapRatesPerDay returns the value of the "auto_recap_rates_per_day" field in the mutation.
+func (m *TelegramChatRecapsOptionsMutation) AutoRecapRatesPerDay() (r int, exists bool) {
+ v := m.auto_recap_rates_per_day
+ if v == nil {
+ return
+ }
+ return *v, true
+}
+
+// OldAutoRecapRatesPerDay returns the old "auto_recap_rates_per_day" field's value of the TelegramChatRecapsOptions entity.
+// If the TelegramChatRecapsOptions object wasn't provided to the builder, the object is fetched from the database.
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
+func (m *TelegramChatRecapsOptionsMutation) OldAutoRecapRatesPerDay(ctx context.Context) (v int, err error) {
+ if !m.op.Is(OpUpdateOne) {
+ return v, errors.New("OldAutoRecapRatesPerDay is only allowed on UpdateOne operations")
+ }
+ if m.id == nil || m.oldValue == nil {
+ return v, errors.New("OldAutoRecapRatesPerDay requires an ID field in the mutation")
+ }
+ oldValue, err := m.oldValue(ctx)
+ if err != nil {
+ return v, fmt.Errorf("querying old value for OldAutoRecapRatesPerDay: %w", err)
+ }
+ return oldValue.AutoRecapRatesPerDay, nil
+}
+
+// AddAutoRecapRatesPerDay adds i to the "auto_recap_rates_per_day" field.
+func (m *TelegramChatRecapsOptionsMutation) AddAutoRecapRatesPerDay(i int) {
+ if m.addauto_recap_rates_per_day != nil {
+ *m.addauto_recap_rates_per_day += i
+ } else {
+ m.addauto_recap_rates_per_day = &i
+ }
+}
+
+// AddedAutoRecapRatesPerDay returns the value that was added to the "auto_recap_rates_per_day" field in this mutation.
+func (m *TelegramChatRecapsOptionsMutation) AddedAutoRecapRatesPerDay() (r int, exists bool) {
+ v := m.addauto_recap_rates_per_day
+ if v == nil {
+ return
+ }
+ return *v, true
+}
+
+// ResetAutoRecapRatesPerDay resets all changes to the "auto_recap_rates_per_day" field.
+func (m *TelegramChatRecapsOptionsMutation) ResetAutoRecapRatesPerDay() {
+ m.auto_recap_rates_per_day = nil
+ m.addauto_recap_rates_per_day = nil
+}
+
// SetCreatedAt sets the "created_at" field.
func (m *TelegramChatRecapsOptionsMutation) SetCreatedAt(i int64) {
m.created_at = &i
@@ -8690,7 +8748,7 @@ func (m *TelegramChatRecapsOptionsMutation) Type() string {
// order to get all numeric fields that were incremented/decremented, call
// AddedFields().
func (m *TelegramChatRecapsOptionsMutation) Fields() []string {
- fields := make([]string, 0, 5)
+ fields := make([]string, 0, 6)
if m.chat_id != nil {
fields = append(fields, telegramchatrecapsoptions.FieldChatID)
}
@@ -8700,6 +8758,9 @@ func (m *TelegramChatRecapsOptionsMutation) Fields() []string {
if m.manual_recap_rate_per_seconds != nil {
fields = append(fields, telegramchatrecapsoptions.FieldManualRecapRatePerSeconds)
}
+ if m.auto_recap_rates_per_day != nil {
+ fields = append(fields, telegramchatrecapsoptions.FieldAutoRecapRatesPerDay)
+ }
if m.created_at != nil {
fields = append(fields, telegramchatrecapsoptions.FieldCreatedAt)
}
@@ -8720,6 +8781,8 @@ func (m *TelegramChatRecapsOptionsMutation) Field(name string) (ent.Value, bool)
return m.AutoRecapSendMode()
case telegramchatrecapsoptions.FieldManualRecapRatePerSeconds:
return m.ManualRecapRatePerSeconds()
+ case telegramchatrecapsoptions.FieldAutoRecapRatesPerDay:
+ return m.AutoRecapRatesPerDay()
case telegramchatrecapsoptions.FieldCreatedAt:
return m.CreatedAt()
case telegramchatrecapsoptions.FieldUpdatedAt:
@@ -8739,6 +8802,8 @@ func (m *TelegramChatRecapsOptionsMutation) OldField(ctx context.Context, name s
return m.OldAutoRecapSendMode(ctx)
case telegramchatrecapsoptions.FieldManualRecapRatePerSeconds:
return m.OldManualRecapRatePerSeconds(ctx)
+ case telegramchatrecapsoptions.FieldAutoRecapRatesPerDay:
+ return m.OldAutoRecapRatesPerDay(ctx)
case telegramchatrecapsoptions.FieldCreatedAt:
return m.OldCreatedAt(ctx)
case telegramchatrecapsoptions.FieldUpdatedAt:
@@ -8773,6 +8838,13 @@ func (m *TelegramChatRecapsOptionsMutation) SetField(name string, value ent.Valu
}
m.SetManualRecapRatePerSeconds(v)
return nil
+ case telegramchatrecapsoptions.FieldAutoRecapRatesPerDay:
+ v, ok := value.(int)
+ if !ok {
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
+ }
+ m.SetAutoRecapRatesPerDay(v)
+ return nil
case telegramchatrecapsoptions.FieldCreatedAt:
v, ok := value.(int64)
if !ok {
@@ -8804,6 +8876,9 @@ func (m *TelegramChatRecapsOptionsMutation) AddedFields() []string {
if m.addmanual_recap_rate_per_seconds != nil {
fields = append(fields, telegramchatrecapsoptions.FieldManualRecapRatePerSeconds)
}
+ if m.addauto_recap_rates_per_day != nil {
+ fields = append(fields, telegramchatrecapsoptions.FieldAutoRecapRatesPerDay)
+ }
if m.addcreated_at != nil {
fields = append(fields, telegramchatrecapsoptions.FieldCreatedAt)
}
@@ -8824,6 +8899,8 @@ func (m *TelegramChatRecapsOptionsMutation) AddedField(name string) (ent.Value,
return m.AddedAutoRecapSendMode()
case telegramchatrecapsoptions.FieldManualRecapRatePerSeconds:
return m.AddedManualRecapRatePerSeconds()
+ case telegramchatrecapsoptions.FieldAutoRecapRatesPerDay:
+ return m.AddedAutoRecapRatesPerDay()
case telegramchatrecapsoptions.FieldCreatedAt:
return m.AddedCreatedAt()
case telegramchatrecapsoptions.FieldUpdatedAt:
@@ -8858,6 +8935,13 @@ func (m *TelegramChatRecapsOptionsMutation) AddField(name string, value ent.Valu
}
m.AddManualRecapRatePerSeconds(v)
return nil
+ case telegramchatrecapsoptions.FieldAutoRecapRatesPerDay:
+ v, ok := value.(int)
+ if !ok {
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
+ }
+ m.AddAutoRecapRatesPerDay(v)
+ return nil
case telegramchatrecapsoptions.FieldCreatedAt:
v, ok := value.(int64)
if !ok {
@@ -8908,6 +8992,9 @@ func (m *TelegramChatRecapsOptionsMutation) ResetField(name string) error {
case telegramchatrecapsoptions.FieldManualRecapRatePerSeconds:
m.ResetManualRecapRatePerSeconds()
return nil
+ case telegramchatrecapsoptions.FieldAutoRecapRatesPerDay:
+ m.ResetAutoRecapRatesPerDay()
+ return nil
case telegramchatrecapsoptions.FieldCreatedAt:
m.ResetCreatedAt()
return nil
diff --git a/ent/runtime.go b/ent/runtime.go
index 7b2d3a8..a5f245e 100644
--- a/ent/runtime.go
+++ b/ent/runtime.go
@@ -373,12 +373,16 @@ func init() {
telegramchatrecapsoptionsDescManualRecapRatePerSeconds := telegramchatrecapsoptionsFields[3].Descriptor()
// telegramchatrecapsoptions.DefaultManualRecapRatePerSeconds holds the default value on creation for the manual_recap_rate_per_seconds field.
telegramchatrecapsoptions.DefaultManualRecapRatePerSeconds = telegramchatrecapsoptionsDescManualRecapRatePerSeconds.Default.(int64)
+ // telegramchatrecapsoptionsDescAutoRecapRatesPerDay is the schema descriptor for auto_recap_rates_per_day field.
+ telegramchatrecapsoptionsDescAutoRecapRatesPerDay := telegramchatrecapsoptionsFields[4].Descriptor()
+ // telegramchatrecapsoptions.DefaultAutoRecapRatesPerDay holds the default value on creation for the auto_recap_rates_per_day field.
+ telegramchatrecapsoptions.DefaultAutoRecapRatesPerDay = telegramchatrecapsoptionsDescAutoRecapRatesPerDay.Default.(int)
// telegramchatrecapsoptionsDescCreatedAt is the schema descriptor for created_at field.
- telegramchatrecapsoptionsDescCreatedAt := telegramchatrecapsoptionsFields[4].Descriptor()
+ telegramchatrecapsoptionsDescCreatedAt := telegramchatrecapsoptionsFields[5].Descriptor()
// telegramchatrecapsoptions.DefaultCreatedAt holds the default value on creation for the created_at field.
telegramchatrecapsoptions.DefaultCreatedAt = telegramchatrecapsoptionsDescCreatedAt.Default.(func() int64)
// telegramchatrecapsoptionsDescUpdatedAt is the schema descriptor for updated_at field.
- telegramchatrecapsoptionsDescUpdatedAt := telegramchatrecapsoptionsFields[5].Descriptor()
+ telegramchatrecapsoptionsDescUpdatedAt := telegramchatrecapsoptionsFields[6].Descriptor()
// telegramchatrecapsoptions.DefaultUpdatedAt holds the default value on creation for the updated_at field.
telegramchatrecapsoptions.DefaultUpdatedAt = telegramchatrecapsoptionsDescUpdatedAt.Default.(func() int64)
// telegramchatrecapsoptionsDescID is the schema descriptor for id field.
diff --git a/ent/schema/telegramchatautorecapsoptions.go b/ent/schema/telegramchatautorecapsoptions.go
index 3137498..3305783 100644
--- a/ent/schema/telegramchatautorecapsoptions.go
+++ b/ent/schema/telegramchatautorecapsoptions.go
@@ -20,6 +20,7 @@ func (TelegramChatRecapsOptions) Fields() []ent.Field {
field.Int64("chat_id").Unique(),
field.Int("auto_recap_send_mode").Default(0),
field.Int64("manual_recap_rate_per_seconds").Default(0),
+ field.Int("auto_recap_rates_per_day").Default(0),
field.Int64("created_at").DefaultFunc(func() int64 { return time.Now().UnixMilli() }),
field.Int64("updated_at").DefaultFunc(func() int64 { return time.Now().UnixMilli() }),
}
diff --git a/ent/telegramchatrecapsoptions.go b/ent/telegramchatrecapsoptions.go
index 0c6b76e..aeb2022 100644
--- a/ent/telegramchatrecapsoptions.go
+++ b/ent/telegramchatrecapsoptions.go
@@ -23,6 +23,8 @@ type TelegramChatRecapsOptions struct {
AutoRecapSendMode int `json:"auto_recap_send_mode,omitempty"`
// ManualRecapRatePerSeconds holds the value of the "manual_recap_rate_per_seconds" field.
ManualRecapRatePerSeconds int64 `json:"manual_recap_rate_per_seconds,omitempty"`
+ // AutoRecapRatesPerDay holds the value of the "auto_recap_rates_per_day" field.
+ AutoRecapRatesPerDay int `json:"auto_recap_rates_per_day,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt int64 `json:"created_at,omitempty"`
// UpdatedAt holds the value of the "updated_at" field.
@@ -35,7 +37,7 @@ func (*TelegramChatRecapsOptions) scanValues(columns []string) ([]any, error) {
values := make([]any, len(columns))
for i := range columns {
switch columns[i] {
- case telegramchatrecapsoptions.FieldChatID, telegramchatrecapsoptions.FieldAutoRecapSendMode, telegramchatrecapsoptions.FieldManualRecapRatePerSeconds, telegramchatrecapsoptions.FieldCreatedAt, telegramchatrecapsoptions.FieldUpdatedAt:
+ case telegramchatrecapsoptions.FieldChatID, telegramchatrecapsoptions.FieldAutoRecapSendMode, telegramchatrecapsoptions.FieldManualRecapRatePerSeconds, telegramchatrecapsoptions.FieldAutoRecapRatesPerDay, telegramchatrecapsoptions.FieldCreatedAt, telegramchatrecapsoptions.FieldUpdatedAt:
values[i] = new(sql.NullInt64)
case telegramchatrecapsoptions.FieldID:
values[i] = new(uuid.UUID)
@@ -78,6 +80,12 @@ func (tcro *TelegramChatRecapsOptions) assignValues(columns []string, values []a
} else if value.Valid {
tcro.ManualRecapRatePerSeconds = value.Int64
}
+ case telegramchatrecapsoptions.FieldAutoRecapRatesPerDay:
+ if value, ok := values[i].(*sql.NullInt64); !ok {
+ return fmt.Errorf("unexpected type %T for field auto_recap_rates_per_day", values[i])
+ } else if value.Valid {
+ tcro.AutoRecapRatesPerDay = int(value.Int64)
+ }
case telegramchatrecapsoptions.FieldCreatedAt:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for field created_at", values[i])
@@ -135,6 +143,9 @@ func (tcro *TelegramChatRecapsOptions) String() string {
builder.WriteString("manual_recap_rate_per_seconds=")
builder.WriteString(fmt.Sprintf("%v", tcro.ManualRecapRatePerSeconds))
builder.WriteString(", ")
+ builder.WriteString("auto_recap_rates_per_day=")
+ builder.WriteString(fmt.Sprintf("%v", tcro.AutoRecapRatesPerDay))
+ builder.WriteString(", ")
builder.WriteString("created_at=")
builder.WriteString(fmt.Sprintf("%v", tcro.CreatedAt))
builder.WriteString(", ")
diff --git a/ent/telegramchatrecapsoptions/telegramchatrecapsoptions.go b/ent/telegramchatrecapsoptions/telegramchatrecapsoptions.go
index 0647b8d..3778928 100644
--- a/ent/telegramchatrecapsoptions/telegramchatrecapsoptions.go
+++ b/ent/telegramchatrecapsoptions/telegramchatrecapsoptions.go
@@ -18,6 +18,8 @@ const (
FieldAutoRecapSendMode = "auto_recap_send_mode"
// FieldManualRecapRatePerSeconds holds the string denoting the manual_recap_rate_per_seconds field in the database.
FieldManualRecapRatePerSeconds = "manual_recap_rate_per_seconds"
+ // FieldAutoRecapRatesPerDay holds the string denoting the auto_recap_rates_per_day field in the database.
+ FieldAutoRecapRatesPerDay = "auto_recap_rates_per_day"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
@@ -32,6 +34,7 @@ var Columns = []string{
FieldChatID,
FieldAutoRecapSendMode,
FieldManualRecapRatePerSeconds,
+ FieldAutoRecapRatesPerDay,
FieldCreatedAt,
FieldUpdatedAt,
}
@@ -51,6 +54,8 @@ var (
DefaultAutoRecapSendMode int
// DefaultManualRecapRatePerSeconds holds the default value on creation for the "manual_recap_rate_per_seconds" field.
DefaultManualRecapRatePerSeconds int64
+ // DefaultAutoRecapRatesPerDay holds the default value on creation for the "auto_recap_rates_per_day" field.
+ DefaultAutoRecapRatesPerDay int
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() int64
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
@@ -82,6 +87,11 @@ func ByManualRecapRatePerSeconds(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldManualRecapRatePerSeconds, opts...).ToFunc()
}
+// ByAutoRecapRatesPerDay orders the results by the auto_recap_rates_per_day field.
+func ByAutoRecapRatesPerDay(opts ...sql.OrderTermOption) OrderOption {
+ return sql.OrderByField(FieldAutoRecapRatesPerDay, opts...).ToFunc()
+}
+
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
diff --git a/ent/telegramchatrecapsoptions/where.go b/ent/telegramchatrecapsoptions/where.go
index 3da6757..c2548c2 100644
--- a/ent/telegramchatrecapsoptions/where.go
+++ b/ent/telegramchatrecapsoptions/where.go
@@ -68,6 +68,11 @@ func ManualRecapRatePerSeconds(v int64) predicate.TelegramChatRecapsOptions {
return predicate.TelegramChatRecapsOptions(sql.FieldEQ(FieldManualRecapRatePerSeconds, v))
}
+// AutoRecapRatesPerDay applies equality check predicate on the "auto_recap_rates_per_day" field. It's identical to AutoRecapRatesPerDayEQ.
+func AutoRecapRatesPerDay(v int) predicate.TelegramChatRecapsOptions {
+ return predicate.TelegramChatRecapsOptions(sql.FieldEQ(FieldAutoRecapRatesPerDay, v))
+}
+
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v int64) predicate.TelegramChatRecapsOptions {
return predicate.TelegramChatRecapsOptions(sql.FieldEQ(FieldCreatedAt, v))
@@ -198,6 +203,46 @@ func ManualRecapRatePerSecondsLTE(v int64) predicate.TelegramChatRecapsOptions {
return predicate.TelegramChatRecapsOptions(sql.FieldLTE(FieldManualRecapRatePerSeconds, v))
}
+// AutoRecapRatesPerDayEQ applies the EQ predicate on the "auto_recap_rates_per_day" field.
+func AutoRecapRatesPerDayEQ(v int) predicate.TelegramChatRecapsOptions {
+ return predicate.TelegramChatRecapsOptions(sql.FieldEQ(FieldAutoRecapRatesPerDay, v))
+}
+
+// AutoRecapRatesPerDayNEQ applies the NEQ predicate on the "auto_recap_rates_per_day" field.
+func AutoRecapRatesPerDayNEQ(v int) predicate.TelegramChatRecapsOptions {
+ return predicate.TelegramChatRecapsOptions(sql.FieldNEQ(FieldAutoRecapRatesPerDay, v))
+}
+
+// AutoRecapRatesPerDayIn applies the In predicate on the "auto_recap_rates_per_day" field.
+func AutoRecapRatesPerDayIn(vs ...int) predicate.TelegramChatRecapsOptions {
+ return predicate.TelegramChatRecapsOptions(sql.FieldIn(FieldAutoRecapRatesPerDay, vs...))
+}
+
+// AutoRecapRatesPerDayNotIn applies the NotIn predicate on the "auto_recap_rates_per_day" field.
+func AutoRecapRatesPerDayNotIn(vs ...int) predicate.TelegramChatRecapsOptions {
+ return predicate.TelegramChatRecapsOptions(sql.FieldNotIn(FieldAutoRecapRatesPerDay, vs...))
+}
+
+// AutoRecapRatesPerDayGT applies the GT predicate on the "auto_recap_rates_per_day" field.
+func AutoRecapRatesPerDayGT(v int) predicate.TelegramChatRecapsOptions {
+ return predicate.TelegramChatRecapsOptions(sql.FieldGT(FieldAutoRecapRatesPerDay, v))
+}
+
+// AutoRecapRatesPerDayGTE applies the GTE predicate on the "auto_recap_rates_per_day" field.
+func AutoRecapRatesPerDayGTE(v int) predicate.TelegramChatRecapsOptions {
+ return predicate.TelegramChatRecapsOptions(sql.FieldGTE(FieldAutoRecapRatesPerDay, v))
+}
+
+// AutoRecapRatesPerDayLT applies the LT predicate on the "auto_recap_rates_per_day" field.
+func AutoRecapRatesPerDayLT(v int) predicate.TelegramChatRecapsOptions {
+ return predicate.TelegramChatRecapsOptions(sql.FieldLT(FieldAutoRecapRatesPerDay, v))
+}
+
+// AutoRecapRatesPerDayLTE applies the LTE predicate on the "auto_recap_rates_per_day" field.
+func AutoRecapRatesPerDayLTE(v int) predicate.TelegramChatRecapsOptions {
+ return predicate.TelegramChatRecapsOptions(sql.FieldLTE(FieldAutoRecapRatesPerDay, v))
+}
+
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtEQ(v int64) predicate.TelegramChatRecapsOptions {
return predicate.TelegramChatRecapsOptions(sql.FieldEQ(FieldCreatedAt, v))
diff --git a/ent/telegramchatrecapsoptions_create.go b/ent/telegramchatrecapsoptions_create.go
index e9a9ddb..ac2c99b 100644
--- a/ent/telegramchatrecapsoptions_create.go
+++ b/ent/telegramchatrecapsoptions_create.go
@@ -54,6 +54,20 @@ func (tcroc *TelegramChatRecapsOptionsCreate) SetNillableManualRecapRatePerSecon
return tcroc
}
+// SetAutoRecapRatesPerDay sets the "auto_recap_rates_per_day" field.
+func (tcroc *TelegramChatRecapsOptionsCreate) SetAutoRecapRatesPerDay(i int) *TelegramChatRecapsOptionsCreate {
+ tcroc.mutation.SetAutoRecapRatesPerDay(i)
+ return tcroc
+}
+
+// SetNillableAutoRecapRatesPerDay sets the "auto_recap_rates_per_day" field if the given value is not nil.
+func (tcroc *TelegramChatRecapsOptionsCreate) SetNillableAutoRecapRatesPerDay(i *int) *TelegramChatRecapsOptionsCreate {
+ if i != nil {
+ tcroc.SetAutoRecapRatesPerDay(*i)
+ }
+ return tcroc
+}
+
// SetCreatedAt sets the "created_at" field.
func (tcroc *TelegramChatRecapsOptionsCreate) SetCreatedAt(i int64) *TelegramChatRecapsOptionsCreate {
tcroc.mutation.SetCreatedAt(i)
@@ -139,6 +153,10 @@ func (tcroc *TelegramChatRecapsOptionsCreate) defaults() {
v := telegramchatrecapsoptions.DefaultManualRecapRatePerSeconds
tcroc.mutation.SetManualRecapRatePerSeconds(v)
}
+ if _, ok := tcroc.mutation.AutoRecapRatesPerDay(); !ok {
+ v := telegramchatrecapsoptions.DefaultAutoRecapRatesPerDay
+ tcroc.mutation.SetAutoRecapRatesPerDay(v)
+ }
if _, ok := tcroc.mutation.CreatedAt(); !ok {
v := telegramchatrecapsoptions.DefaultCreatedAt()
tcroc.mutation.SetCreatedAt(v)
@@ -164,6 +182,9 @@ func (tcroc *TelegramChatRecapsOptionsCreate) check() error {
if _, ok := tcroc.mutation.ManualRecapRatePerSeconds(); !ok {
return &ValidationError{Name: "manual_recap_rate_per_seconds", err: errors.New(`ent: missing required field "TelegramChatRecapsOptions.manual_recap_rate_per_seconds"`)}
}
+ if _, ok := tcroc.mutation.AutoRecapRatesPerDay(); !ok {
+ return &ValidationError{Name: "auto_recap_rates_per_day", err: errors.New(`ent: missing required field "TelegramChatRecapsOptions.auto_recap_rates_per_day"`)}
+ }
if _, ok := tcroc.mutation.CreatedAt(); !ok {
return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "TelegramChatRecapsOptions.created_at"`)}
}
@@ -218,6 +239,10 @@ func (tcroc *TelegramChatRecapsOptionsCreate) createSpec() (*TelegramChatRecapsO
_spec.SetField(telegramchatrecapsoptions.FieldManualRecapRatePerSeconds, field.TypeInt64, value)
_node.ManualRecapRatePerSeconds = value
}
+ if value, ok := tcroc.mutation.AutoRecapRatesPerDay(); ok {
+ _spec.SetField(telegramchatrecapsoptions.FieldAutoRecapRatesPerDay, field.TypeInt, value)
+ _node.AutoRecapRatesPerDay = value
+ }
if value, ok := tcroc.mutation.CreatedAt(); ok {
_spec.SetField(telegramchatrecapsoptions.FieldCreatedAt, field.TypeInt64, value)
_node.CreatedAt = value
diff --git a/ent/telegramchatrecapsoptions_update.go b/ent/telegramchatrecapsoptions_update.go
index a21e24f..9028ef3 100644
--- a/ent/telegramchatrecapsoptions_update.go
+++ b/ent/telegramchatrecapsoptions_update.go
@@ -83,6 +83,27 @@ func (tcrou *TelegramChatRecapsOptionsUpdate) AddManualRecapRatePerSeconds(i int
return tcrou
}
+// SetAutoRecapRatesPerDay sets the "auto_recap_rates_per_day" field.
+func (tcrou *TelegramChatRecapsOptionsUpdate) SetAutoRecapRatesPerDay(i int) *TelegramChatRecapsOptionsUpdate {
+ tcrou.mutation.ResetAutoRecapRatesPerDay()
+ tcrou.mutation.SetAutoRecapRatesPerDay(i)
+ return tcrou
+}
+
+// SetNillableAutoRecapRatesPerDay sets the "auto_recap_rates_per_day" field if the given value is not nil.
+func (tcrou *TelegramChatRecapsOptionsUpdate) SetNillableAutoRecapRatesPerDay(i *int) *TelegramChatRecapsOptionsUpdate {
+ if i != nil {
+ tcrou.SetAutoRecapRatesPerDay(*i)
+ }
+ return tcrou
+}
+
+// AddAutoRecapRatesPerDay adds i to the "auto_recap_rates_per_day" field.
+func (tcrou *TelegramChatRecapsOptionsUpdate) AddAutoRecapRatesPerDay(i int) *TelegramChatRecapsOptionsUpdate {
+ tcrou.mutation.AddAutoRecapRatesPerDay(i)
+ return tcrou
+}
+
// SetCreatedAt sets the "created_at" field.
func (tcrou *TelegramChatRecapsOptionsUpdate) SetCreatedAt(i int64) *TelegramChatRecapsOptionsUpdate {
tcrou.mutation.ResetCreatedAt()
@@ -184,6 +205,12 @@ func (tcrou *TelegramChatRecapsOptionsUpdate) sqlSave(ctx context.Context) (n in
if value, ok := tcrou.mutation.AddedManualRecapRatePerSeconds(); ok {
_spec.AddField(telegramchatrecapsoptions.FieldManualRecapRatePerSeconds, field.TypeInt64, value)
}
+ if value, ok := tcrou.mutation.AutoRecapRatesPerDay(); ok {
+ _spec.SetField(telegramchatrecapsoptions.FieldAutoRecapRatesPerDay, field.TypeInt, value)
+ }
+ if value, ok := tcrou.mutation.AddedAutoRecapRatesPerDay(); ok {
+ _spec.AddField(telegramchatrecapsoptions.FieldAutoRecapRatesPerDay, field.TypeInt, value)
+ }
if value, ok := tcrou.mutation.CreatedAt(); ok {
_spec.SetField(telegramchatrecapsoptions.FieldCreatedAt, field.TypeInt64, value)
}
@@ -273,6 +300,27 @@ func (tcrouo *TelegramChatRecapsOptionsUpdateOne) AddManualRecapRatePerSeconds(i
return tcrouo
}
+// SetAutoRecapRatesPerDay sets the "auto_recap_rates_per_day" field.
+func (tcrouo *TelegramChatRecapsOptionsUpdateOne) SetAutoRecapRatesPerDay(i int) *TelegramChatRecapsOptionsUpdateOne {
+ tcrouo.mutation.ResetAutoRecapRatesPerDay()
+ tcrouo.mutation.SetAutoRecapRatesPerDay(i)
+ return tcrouo
+}
+
+// SetNillableAutoRecapRatesPerDay sets the "auto_recap_rates_per_day" field if the given value is not nil.
+func (tcrouo *TelegramChatRecapsOptionsUpdateOne) SetNillableAutoRecapRatesPerDay(i *int) *TelegramChatRecapsOptionsUpdateOne {
+ if i != nil {
+ tcrouo.SetAutoRecapRatesPerDay(*i)
+ }
+ return tcrouo
+}
+
+// AddAutoRecapRatesPerDay adds i to the "auto_recap_rates_per_day" field.
+func (tcrouo *TelegramChatRecapsOptionsUpdateOne) AddAutoRecapRatesPerDay(i int) *TelegramChatRecapsOptionsUpdateOne {
+ tcrouo.mutation.AddAutoRecapRatesPerDay(i)
+ return tcrouo
+}
+
// SetCreatedAt sets the "created_at" field.
func (tcrouo *TelegramChatRecapsOptionsUpdateOne) SetCreatedAt(i int64) *TelegramChatRecapsOptionsUpdateOne {
tcrouo.mutation.ResetCreatedAt()
@@ -404,6 +452,12 @@ func (tcrouo *TelegramChatRecapsOptionsUpdateOne) sqlSave(ctx context.Context) (
if value, ok := tcrouo.mutation.AddedManualRecapRatePerSeconds(); ok {
_spec.AddField(telegramchatrecapsoptions.FieldManualRecapRatePerSeconds, field.TypeInt64, value)
}
+ if value, ok := tcrouo.mutation.AutoRecapRatesPerDay(); ok {
+ _spec.SetField(telegramchatrecapsoptions.FieldAutoRecapRatesPerDay, field.TypeInt, value)
+ }
+ if value, ok := tcrouo.mutation.AddedAutoRecapRatesPerDay(); ok {
+ _spec.AddField(telegramchatrecapsoptions.FieldAutoRecapRatesPerDay, field.TypeInt, value)
+ }
if value, ok := tcrouo.mutation.CreatedAt(); ok {
_spec.SetField(telegramchatrecapsoptions.FieldCreatedAt, field.TypeInt64, value)
}
diff --git a/go.mod b/go.mod
index ba087af..17c0604 100644
--- a/go.mod
+++ b/go.mod
@@ -3,107 +3,106 @@ module github.com/nekomeowww/insights-bot
go 1.21
require (
- entgo.io/ent v0.12.4
+ entgo.io/ent v0.12.5
github.com/PuerkitoBio/goquery v1.8.1
- github.com/alexliesenfeld/health v0.7.0
- github.com/disgoorg/disgo v0.16.9
+ github.com/alexliesenfeld/health v0.8.0
+ github.com/disgoorg/disgo v0.17.0
github.com/disgoorg/snowflake/v2 v2.0.1
github.com/gin-gonic/gin v1.9.1
- github.com/go-shiori/go-readability v0.0.0-20230421032831-c66949dfc0ad
+ github.com/go-shiori/go-readability v0.0.0-20231029095239-6b97d5aba789
github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1
- github.com/google/uuid v1.3.1
+ github.com/google/uuid v1.4.0
github.com/gookit/color v1.5.4
- github.com/imroc/req/v3 v3.42.0
+ github.com/imroc/req/v3 v3.42.2
github.com/joho/godotenv v1.5.1
github.com/lib/pq v1.10.9
github.com/maxbrunsfeld/counterfeiter/v6 v6.6.1
github.com/nekomeowww/fo v1.2.1
github.com/nekomeowww/go-pinecone v0.1.0
- github.com/nekomeowww/timecapsule/v2 v2.1.3
+ github.com/nekomeowww/timecapsule/v2 v2.2.0
github.com/nekomeowww/xo v1.2.0
github.com/pkoukk/tiktoken-go v0.1.6
- github.com/redis/rueidis v1.0.18
- github.com/samber/lo v1.38.1
- github.com/sashabaranov/go-openai v1.15.3
+ github.com/redis/rueidis v1.0.23
+ github.com/samber/lo v1.39.0
+ github.com/sashabaranov/go-openai v1.17.9
github.com/sirupsen/logrus v1.9.3
github.com/slack-go/slack v0.12.3
github.com/sourcegraph/conc v0.3.0
github.com/stretchr/testify v1.8.4
- go.uber.org/fx v1.20.0
+ go.uber.org/fx v1.20.1
go.uber.org/multierr v1.11.0
go.uber.org/ratelimit v0.3.0
go.uber.org/zap v1.26.0
)
require (
- ariga.io/atlas v0.14.1 // indirect
+ ariga.io/atlas v0.15.0 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
- github.com/andybalholm/brotli v1.0.5 // indirect
+ github.com/andybalholm/brotli v1.0.6 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
- github.com/bytedance/sonic v1.10.1 // indirect
+ github.com/bytedance/sonic v1.10.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
- github.com/chenzhuoyu/iasm v0.9.0 // indirect
- github.com/cloudflare/circl v1.3.3 // indirect
+ github.com/chenzhuoyu/iasm v0.9.1 // indirect
+ github.com/cloudflare/circl v1.3.6 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/disgoorg/json v1.1.0 // indirect
- github.com/disgoorg/log v1.2.1 // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
- github.com/gabriel-vasile/mimetype v1.4.2 // indirect
+ github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gaukas/godicttls v0.0.4 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
- github.com/go-playground/validator/v10 v10.15.4 // indirect
+ github.com/go-playground/validator/v10 v10.16.0 // indirect
github.com/go-shiori/dom v0.0.0-20230515143342-73569d674e1c // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f // indirect
- github.com/google/go-cmp v0.5.9 // indirect
- github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98 // indirect
- github.com/gorilla/websocket v1.5.0 // indirect
+ github.com/google/go-cmp v0.6.0 // indirect
+ github.com/google/pprof v0.0.0-20231205033806-a5a03c77bf08 // indirect
+ github.com/gorilla/websocket v1.5.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
- github.com/hashicorp/hcl/v2 v2.18.0 // indirect
+ github.com/hashicorp/hcl/v2 v2.19.1 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/klauspost/compress v1.17.0 // indirect
- github.com/klauspost/cpuid/v2 v2.2.5 // indirect
+ github.com/klauspost/compress v1.17.4 // indirect
+ github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
- github.com/mattn/go-isatty v0.0.19 // indirect
+ github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
- github.com/onsi/ginkgo/v2 v2.12.1 // indirect
+ github.com/onsi/ginkgo/v2 v2.13.2 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
- github.com/quic-go/qtls-go1-20 v0.3.4 // indirect
- github.com/quic-go/quic-go v0.39.0 // indirect
- github.com/redis/go-redis/v9 v9.2.0 // indirect
- github.com/refraction-networking/utls v1.5.3 // indirect
- github.com/samber/mo v1.10.0 // indirect
+ github.com/quic-go/qtls-go1-20 v0.4.1 // indirect
+ github.com/quic-go/quic-go v0.40.0 // indirect
+ github.com/redis/go-redis/v9 v9.3.0 // indirect
+ github.com/refraction-networking/utls v1.5.4 // indirect
+ github.com/samber/mo v1.11.0 // indirect
github.com/sasha-s/go-csync v0.0.0-20210812194225-61421b77c44b // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
- github.com/ugorji/go/codec v1.2.11 // indirect
+ github.com/ugorji/go/codec v1.2.12 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
- github.com/zclconf/go-cty v1.14.0 // indirect
+ github.com/zclconf/go-cty v1.14.1 // indirect
go.uber.org/atomic v1.11.0 // indirect
- go.uber.org/dig v1.17.0 // indirect
+ go.uber.org/dig v1.17.1 // indirect
go.uber.org/goleak v1.2.1 // indirect
go.uber.org/mock v0.3.0 // indirect
- golang.org/x/arch v0.5.0 // indirect
- golang.org/x/crypto v0.13.0 // indirect
- golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
- golang.org/x/mod v0.12.0 // indirect
- golang.org/x/net v0.15.0 // indirect
- golang.org/x/sys v0.12.0 // indirect
- golang.org/x/text v0.13.0 // indirect
- golang.org/x/tools v0.13.0 // indirect
+ golang.org/x/arch v0.6.0 // indirect
+ golang.org/x/crypto v0.16.0 // indirect
+ golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect
+ golang.org/x/mod v0.14.0 // indirect
+ golang.org/x/net v0.19.0 // indirect
+ golang.org/x/sys v0.15.0 // indirect
+ golang.org/x/text v0.14.0 // indirect
+ golang.org/x/tools v0.16.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/go.sum b/go.sum
index 606b712..6880d48 100644
--- a/go.sum
+++ b/go.sum
@@ -1,17 +1,17 @@
-ariga.io/atlas v0.14.1 h1:mun+I5QiFaKVJBfHNnlTqa0PCj6qCZsp/M3dxFC9WPg=
-ariga.io/atlas v0.14.1/go.mod h1:isZrlzJ5cpoCoKFoY9knZug7Lq4pP1cm8g3XciLZ0Pw=
-entgo.io/ent v0.12.4 h1:LddPnAyxls/O7DTXZvUGDj0NZIdGSu317+aoNLJWbD8=
-entgo.io/ent v0.12.4/go.mod h1:Y3JVAjtlIk8xVZYSn3t3mf8xlZIn5SAOXZQxD6kKI+Q=
+ariga.io/atlas v0.15.0 h1:9lwSVcO/D3WgaCzstSGqR1hEDtsGibu6JqUofEI/0sY=
+ariga.io/atlas v0.15.0/go.mod h1:isZrlzJ5cpoCoKFoY9knZug7Lq4pP1cm8g3XciLZ0Pw=
+entgo.io/ent v0.12.5 h1:KREM5E4CSoej4zeGa88Ou/gfturAnpUv0mzAjch1sj4=
+entgo.io/ent v0.12.5/go.mod h1:Y3JVAjtlIk8xVZYSn3t3mf8xlZIn5SAOXZQxD6kKI+Q=
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM=
github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ=
github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo=
github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
-github.com/alexliesenfeld/health v0.7.0 h1:U3mSZ3ussRbGx+/rXBjNVxjLX5cKaNh8Ly9Hx3q+yfY=
-github.com/alexliesenfeld/health v0.7.0/go.mod h1:6Nnjbu7vBYHoZqIuZeOnTpnW7OH14ulR+wIBE2QuJ8I=
-github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
-github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
+github.com/alexliesenfeld/health v0.8.0 h1:lCV0i+ZJPTbqP7LfKG7p3qZBl5VhelwUFCIVWl77fgk=
+github.com/alexliesenfeld/health v0.8.0/go.mod h1:TfNP0f+9WQVWMQRzvMUjlws4ceXKEL3WR+6Hp95HUFc=
+github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sxfOI=
+github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
@@ -25,43 +25,42 @@ github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM=
-github.com/bytedance/sonic v1.10.1 h1:7a1wuFXL1cMy7a3f7/VFcEtriuXQnUBhtoVfOZiaysc=
-github.com/bytedance/sonic v1.10.1/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4=
+github.com/bytedance/sonic v1.10.2 h1:GQebETVBxYB7JGWJtLBi07OVzWwt+8dWA00gEVW2ZFE=
+github.com/bytedance/sonic v1.10.2/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0=
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA=
-github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo=
github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog=
-github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs=
-github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
+github.com/chenzhuoyu/iasm v0.9.1 h1:tUHQJXo3NhBqw6s33wkGn9SP3bvrWLdlVIJ3hQBL7P0=
+github.com/chenzhuoyu/iasm v0.9.1/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog=
+github.com/cloudflare/circl v1.3.6 h1:/xbKIqSHbZXHwkhbrhrt2YOHIwYJlXH94E3tI/gDlUg=
+github.com/cloudflare/circl v1.3.6/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
-github.com/disgoorg/disgo v0.16.9 h1:QkdfM930SSi/p5TaJF2/BxjUKPQVcA3zu6sGtocSUhg=
-github.com/disgoorg/disgo v0.16.9/go.mod h1:QnvUII334g/LJzjOmhYGCJzbl38Og83iXCEe28DklVM=
+github.com/disgoorg/disgo v0.17.0 h1:/LcgXgPDhzHt3GkQ4cpjmIJBim1/VYfS31VhGYif3Ms=
+github.com/disgoorg/disgo v0.17.0/go.mod h1:AE2J/8oLR2PtYfqcARsk1mgBxQ5z3Z1OD6Lc2SA0gak=
github.com/disgoorg/json v1.1.0 h1:7xigHvomlVA9PQw9bMGO02PHGJJPqvX5AnwlYg/Tnys=
github.com/disgoorg/json v1.1.0/go.mod h1:BHDwdde0rpQFDVsRLKhma6Y7fTbQKub/zdGO5O9NqqA=
-github.com/disgoorg/log v1.2.1 h1:kZYAWkUBcGy4LbZcgYtgYu49xNVLy+xG5Uq3yz5VVQs=
-github.com/disgoorg/log v1.2.1/go.mod h1:hhQWYTFTnIGzAuFPZyXJEi11IBm9wq+/TVZt/FEwX0o=
github.com/disgoorg/snowflake/v2 v2.0.1 h1:CuUxGLwggUxEswZOmZ+mZ5i0xSumQdXW9tXW7uGqe+0=
github.com/disgoorg/snowflake/v2 v2.0.1/go.mod h1:SPU9c2CNn5DSyb86QcKtdZgix9osEtKrHLW4rMhfLCs=
github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
-github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=
-github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA=
+github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
+github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
github.com/gaukas/godicttls v0.0.4 h1:NlRaXb3J6hAnTmWdsEKb9bcSBD6BvcIjdGdeb0zfXbk=
github.com/gaukas/godicttls v0.0.4/go.mod h1:l6EenT4TLWgTdwslVb4sEMOCf7Bv0JAK67deKr9/NCI=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU=
-github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
-github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
+github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
+github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4=
github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
@@ -70,12 +69,12 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
-github.com/go-playground/validator/v10 v10.15.4 h1:zMXza4EpOdooxPel5xDqXEdXG5r+WggpvnAKMsalBjs=
-github.com/go-playground/validator/v10 v10.15.4/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
+github.com/go-playground/validator/v10 v10.16.0 h1:x+plE831WK4vaKHO/jpgUGsvLKIqRRkz6M78GuJAfGE=
+github.com/go-playground/validator/v10 v10.16.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
github.com/go-shiori/dom v0.0.0-20230515143342-73569d674e1c h1:wpkoddUomPfHiOziHZixGO5ZBS73cKqVzZipfrLmO1w=
github.com/go-shiori/dom v0.0.0-20230515143342-73569d674e1c/go.mod h1:oVDCh3qjJMLVUSILBRwrm+Bc6RNXGZYtoh9xdvf1ffM=
-github.com/go-shiori/go-readability v0.0.0-20230421032831-c66949dfc0ad h1:3VP5Q8Mh165h2DHmXWFT4LJlwwvgTRlEuoe2vnsVnJ4=
-github.com/go-shiori/go-readability v0.0.0-20230421032831-c66949dfc0ad/go.mod h1:2DpZlTJO/ycxp/vsc/C11oUyveStOgIXB88SYV1lncI=
+github.com/go-shiori/go-readability v0.0.0-20231029095239-6b97d5aba789 h1:G6wSuUyCoLB9jrUokipsmFuRi8aJozt3phw/g9Sl4Xs=
+github.com/go-shiori/go-readability v0.0.0-20231029095239-6b97d5aba789/go.mod h1:2DpZlTJO/ycxp/vsc/C11oUyveStOgIXB88SYV1lncI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1 h1:wG8n/XJQ07TmjbITcGiUaOtXxdrINDz1b0J1w0SzqDc=
@@ -91,36 +90,36 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
-github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
-github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98 h1:pUa4ghanp6q4IJHwE9RwLgmVFfReJN+KbQ8ExNEUUoQ=
-github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
-github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
-github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/google/pprof v0.0.0-20231205033806-a5a03c77bf08 h1:PxlBVtIFHR/mtWk2i0gTEdCz+jBnqiuHNSki0epDbVs=
+github.com/google/pprof v0.0.0-20231205033806-a5a03c77bf08/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
+github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
+github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0=
github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
-github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
-github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
+github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
+github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
-github.com/hashicorp/hcl/v2 v2.18.0 h1:wYnG7Lt31t2zYkcquwgKo6MWXzRUDIeIVU5naZwHLl8=
-github.com/hashicorp/hcl/v2 v2.18.0/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE=
-github.com/imroc/req/v3 v3.42.0 h1:g7wWva3aIJI02mrnqmXe0N5SVkXHQPsYN3Tmw2ZHn3U=
-github.com/imroc/req/v3 v3.42.0/go.mod h1:W7dOrfQORA9nFoj+CafIZ6P5iyk+rWdbp2sffOAvABU=
+github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI=
+github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE=
+github.com/imroc/req/v3 v3.42.2 h1:/BwrKXGR7X1/ptccaQAiziDCeZ7T6ye55g3ZhiLy1fc=
+github.com/imroc/req/v3 v3.42.2/go.mod h1:W7dOrfQORA9nFoj+CafIZ6P5iyk+rWdbp2sffOAvABU=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
-github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM=
-github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
+github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
+github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
-github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
-github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
+github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc=
+github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
@@ -132,10 +131,8 @@ github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
-github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
-github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
-github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
-github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
+github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
+github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=
github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
github.com/maxbrunsfeld/counterfeiter/v6 v6.6.1 h1:9XE5ykDiC8eNSqIPkxx0EsV3kMX1oe4kQWRZjIgytUA=
@@ -151,16 +148,14 @@ github.com/nekomeowww/fo v1.2.1 h1:7bb3x2Kz7NAoPVvYnvZf5wdpjsg9QvxgmGpcFMJd/9o=
github.com/nekomeowww/fo v1.2.1/go.mod h1:9avQL8Q+yJPkoy/UtHVm58Tk38cPQmbIoTf/Wtv6l1s=
github.com/nekomeowww/go-pinecone v0.1.0 h1:byYmyHQJ4velNUeECvNuCN6KbXGuyVjSFlvO9VV2zj8=
github.com/nekomeowww/go-pinecone v0.1.0/go.mod h1:p8I6F7G7fSrfaa9k3HpsWNxf2y+W1wqn8tw0jsV9e1s=
-github.com/nekomeowww/timecapsule/v2 v2.1.3 h1:KIg6jZSg4RkQG9qV2k5TMq9LUzM6cO3MiXvTyLnqZ9U=
-github.com/nekomeowww/timecapsule/v2 v2.1.3/go.mod h1:/DD0z43GI6mG6WmRxKwRPJNaYsy696wabZyyjKcL2/4=
+github.com/nekomeowww/timecapsule/v2 v2.2.0 h1:5hdcoq7uyIdQCs9ufIg1yuDnfhzsk1bb0dyP2Mmb+cI=
+github.com/nekomeowww/timecapsule/v2 v2.2.0/go.mod h1:1rr05h26cZmOaNUw/tSByKfPdomx0Fw9tWxlu+4HQlU=
github.com/nekomeowww/xo v1.2.0 h1:JNH2nM/nRBSTs0azX97O4NAcNhmP3EXSRh9lGlhR628=
github.com/nekomeowww/xo v1.2.0/go.mod h1:shuoU7EL5OliCEpgzF9I7xDSJMrqmr1B3pdrBaw+pDw=
-github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
-github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
-github.com/onsi/ginkgo/v2 v2.12.1 h1:uHNEO1RP2SpuZApSkel9nEh1/Mu+hmQe7Q+Pepg5OYA=
-github.com/onsi/ginkgo/v2 v2.12.1/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
-github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
-github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
+github.com/onsi/ginkgo/v2 v2.13.2 h1:Bi2gGVkfn6gQcjNjZJVO8Gf0FHzMPf2phUei9tejVMs=
+github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM=
+github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
+github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
github.com/pkoukk/tiktoken-go v0.1.6 h1:JF0TlJzhTbrI30wCvFuiw6FzP2+/bR+FIxUdgEAcUsw=
@@ -169,26 +164,26 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=
github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A=
-github.com/quic-go/qtls-go1-20 v0.3.4 h1:MfFAPULvst4yoMgY9QmtpYmfij/em7O8UUi+bNVm7Cg=
-github.com/quic-go/qtls-go1-20 v0.3.4/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k=
-github.com/quic-go/quic-go v0.39.0 h1:AgP40iThFMY0bj8jGxROhw3S0FMGa8ryqsmi9tBH3So=
-github.com/quic-go/quic-go v0.39.0/go.mod h1:T09QsDQWjLiQ74ZmacDfqZmhY/NLnw5BC40MANNNZ1Q=
-github.com/redis/go-redis/v9 v9.2.0 h1:zwMdX0A4eVzse46YN18QhuDiM4uf3JmkOB4VZrdt5uI=
-github.com/redis/go-redis/v9 v9.2.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
-github.com/redis/rueidis v1.0.18 h1:yfqQ22QCfIey+w1LHAp006dlJXwATePVUM+1w2ePrIo=
-github.com/redis/rueidis v1.0.18/go.mod h1:8B+r5wdnjwK3lTFml5VtxjzGOQAC+5UmujoD12pDrEo=
-github.com/refraction-networking/utls v1.5.3 h1:Ds5Ocg1+MC1ahNx5iBEcHe0jHeLaA/fLey61EENm7ro=
-github.com/refraction-networking/utls v1.5.3/go.mod h1:SPuDbBmgLGp8s+HLNc83FuavwZCFoMmExj+ltUHiHUw=
+github.com/quic-go/qtls-go1-20 v0.4.1 h1:D33340mCNDAIKBqXuAvexTNMUByrYmFYVfKfDN5nfFs=
+github.com/quic-go/qtls-go1-20 v0.4.1/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k=
+github.com/quic-go/quic-go v0.40.0 h1:GYd1iznlKm7dpHD7pOVpUvItgMPo/jrMgDWZhMCecqw=
+github.com/quic-go/quic-go v0.40.0/go.mod h1:PeN7kuVJ4xZbxSv/4OX6S1USOX8MJvydwpTx31vx60c=
+github.com/redis/go-redis/v9 v9.3.0 h1:RiVDjmig62jIWp7Kk4XVLs0hzV6pI3PyTnnL0cnn0u0=
+github.com/redis/go-redis/v9 v9.3.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
+github.com/redis/rueidis v1.0.23 h1:OVHv1u35anQgvXjXk0ehTSDGByS245eQBDDM9U6YF/w=
+github.com/redis/rueidis v1.0.23/go.mod h1:8EOzvsg3o5dUDitRj4vpsolUKkSIvFz88PeQnqwTVk0=
+github.com/refraction-networking/utls v1.5.4 h1:9k6EO2b8TaOGsQ7Pl7p9w6PUhx18/ZCeT0WNTZ7Uw4o=
+github.com/refraction-networking/utls v1.5.4/go.mod h1:SPuDbBmgLGp8s+HLNc83FuavwZCFoMmExj+ltUHiHUw=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
-github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
-github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
-github.com/samber/mo v1.10.0 h1:dxwUGzd5i2FyPQJZzTIdexUuQC6WhXlq7zUJ9o7XCqI=
-github.com/samber/mo v1.10.0/go.mod h1:BfkrCPuYzVG3ZljnZB783WIJIGk1mcZr9c9CPf8tAxs=
+github.com/samber/lo v1.39.0 h1:4gTz1wUhNYLhFSKl6O+8peW0v2F4BCY034GRpU9WnuA=
+github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
+github.com/samber/mo v1.11.0 h1:ZOiSkrGGpNhVv/1dxP02risztdMTIwE8KSW9OG4k5bY=
+github.com/samber/mo v1.11.0/go.mod h1:BfkrCPuYzVG3ZljnZB783WIJIGk1mcZr9c9CPf8tAxs=
github.com/sasha-s/go-csync v0.0.0-20210812194225-61421b77c44b h1:qYTY2tN72LhgDj2rtWG+LI6TXFl2ygFQQ4YezfVaGQE=
github.com/sasha-s/go-csync v0.0.0-20210812194225-61421b77c44b/go.mod h1:/pA7k3zsXKdjjAiUhB5CjuKib9KJGCaLvZwtxGC8U0s=
-github.com/sashabaranov/go-openai v1.15.3 h1:rzoNK9n+Cak+PM6OQ9puxDmFllxfnVea9StlmhglXqA=
-github.com/sashabaranov/go-openai v1.15.3/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
+github.com/sashabaranov/go-openai v1.17.9 h1:QEoBiGKWW68W79YIfXWEFZ7l5cEgZBV4/Ow3uy+5hNY=
+github.com/sashabaranov/go-openai v1.17.9/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
@@ -201,10 +196,6 @@ github.com/slack-go/slack v0.12.3 h1:92/dfFU8Q5XP6Wp5rr5/T5JHLM5c5Smtn53fhToAP88
github.com/slack-go/slack v0.12.3/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
-github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
-github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
-github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
-github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
@@ -221,19 +212,19 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
-github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
-github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
+github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE=
+github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
-github.com/zclconf/go-cty v1.14.0 h1:/Xrd39K7DXbHzlisFP9c4pHao4yyf+/Ug9LEz+Y/yhc=
-github.com/zclconf/go-cty v1.14.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
+github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA=
+github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
-go.uber.org/dig v1.17.0 h1:5Chju+tUvcC+N7N6EV08BJz41UZuO3BmHcN4A287ZLI=
-go.uber.org/dig v1.17.0/go.mod h1:rTxpf7l5I0eBTlE6/9RL+lDybC7WFwY2QH55ZSjy1mU=
-go.uber.org/fx v1.20.0 h1:ZMC/pnRvhsthOZh9MZjMq5U8Or3mA9zBSPaLnzs3ihQ=
-go.uber.org/fx v1.20.0/go.mod h1:qCUj0btiR3/JnanEr1TYEePfSw6o/4qYJscgvzQ5Ub0=
+go.uber.org/dig v1.17.1 h1:Tga8Lz8PcYNsWsyHMZ1Vm0OQOUaJNDyvPImgbAu9YSc=
+go.uber.org/dig v1.17.1/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE=
+go.uber.org/fx v1.20.1 h1:zVwVQGS8zYvhh9Xxcu4w1M6ESyeMzebzj2NbSayZ4Mk=
+go.uber.org/fx v1.20.1/go.mod h1:iSYNbHf2y55acNCwCXKx7LbWb5WG1Bnue5RDXz1OREg=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo=
@@ -245,18 +236,18 @@ go.uber.org/ratelimit v0.3.0/go.mod h1:So5LG7CV1zWpY1sHe+DXTJqQvOx+FFPFaAs2SnoyB
go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
-golang.org/x/arch v0.5.0 h1:jpGode6huXQxcskEIpOCvrU+tzo81b6+oFLUYXWtH/Y=
-golang.org/x/arch v0.5.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
+golang.org/x/arch v0.6.0 h1:S0JTfE48HbRj80+4tbvZDYsJ3tGv6BUU3XxyZ7CirAc=
+golang.org/x/arch v0.6.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
-golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
-golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
-golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
-golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
+golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
+golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
+golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8=
+golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
-golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
+golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
+golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
@@ -264,13 +255,13 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
-golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
-golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
+golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
+golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
-golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
+golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
+golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -281,8 +272,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
-golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
+golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
@@ -293,14 +284,14 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
-golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
-golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
+golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
-golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ=
-golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
+golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM=
+golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
diff --git a/internal/bots/telegram/handlers/recap/callback_query.go b/internal/bots/telegram/handlers/recap/callback_query.go
index dba6fad..306ffc8 100644
--- a/internal/bots/telegram/handlers/recap/callback_query.go
+++ b/internal/bots/telegram/handlers/recap/callback_query.go
@@ -3,13 +3,14 @@ package recap
import (
"errors"
"fmt"
+ "strconv"
+ "strings"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
"github.com/samber/lo"
"go.uber.org/fx"
"go.uber.org/zap"
- "github.com/nekomeowww/insights-bot/ent"
"github.com/nekomeowww/insights-bot/internal/models/chathistories"
"github.com/nekomeowww/insights-bot/internal/models/tgchats"
"github.com/nekomeowww/insights-bot/pkg/bots/tgbot"
@@ -44,7 +45,7 @@ func NewCallbackQueryHandler() func(NewCallbackQueryHandlerParams) *CallbackQuer
}
func shouldSkipCallbackQueryHandlingByCheckingActionData[
- D recap.ConfigureRecapToggleActionData | recap.ConfigureRecapAssignModeActionData | recap.ConfigureRecapCompleteActionData,
+ D recap.ConfigureRecapToggleActionData | recap.ConfigureRecapAssignModeActionData | recap.ConfigureRecapCompleteActionData | recap.ConfigureAutoRecapRatesPerDayActionData,
](c *tgbot.Context, actionData D, chatID, fromID int64) bool {
var actionDataChatID int64
var actionDataFromID int64
@@ -59,6 +60,9 @@ func shouldSkipCallbackQueryHandlingByCheckingActionData[
case recap.ConfigureRecapCompleteActionData:
actionDataChatID = val.ChatID
actionDataFromID = val.FromID
+ case recap.ConfigureAutoRecapRatesPerDayActionData:
+ actionDataChatID = val.ChatID
+ actionDataFromID = val.FromID
}
// same chat
@@ -148,9 +152,6 @@ func (h *CallbackQueryHandler) handleCallbackQueryToggle(c *tgbot.Context) (tgbo
WithEdit(c.Update.Message).
WithReplyMarkup(tgbotapi.NewInlineKeyboardMarkup(msg.ReplyMarkup.InlineKeyboard...))
}
- if options == nil {
- options = &ent.TelegramChatRecapsOptions{AutoRecapSendMode: int(tgchat.AutoRecapSendModePublicly)}
- }
if actionData.Status {
errMessage := configureRecapGeneralInstructionMessage + "\n\n" + "聊天记录回顾功能开启失败,请稍后再试!"
@@ -164,7 +165,7 @@ func (h *CallbackQueryHandler) handleCallbackQueryToggle(c *tgbot.Context) (tgbo
WithReplyMarkup(tgbotapi.NewInlineKeyboardMarkup(msg.ReplyMarkup.InlineKeyboard...))
}
- err = h.tgchats.QueueOneSendChatHistoriesRecapTaskForChatID(chatID)
+ err = h.tgchats.QueueOneSendChatHistoriesRecapTaskForChatID(chatID, options)
if err != nil {
return nil, tgbot.
NewExceptionError(err).
@@ -185,7 +186,14 @@ func (h *CallbackQueryHandler) handleCallbackQueryToggle(c *tgbot.Context) (tgbo
}
}
- markup, err := newRecapInlineKeyboardMarkup(c, chatID, fromID, actionData.Status, tgchat.AutoRecapSendMode(options.AutoRecapSendMode))
+ markup, err := newRecapInlineKeyboardMarkup(
+ c,
+ chatID,
+ fromID,
+ actionData.Status,
+ tgchat.AutoRecapSendMode(options.AutoRecapSendMode),
+ lo.Ternary(options.AutoRecapRatesPerDay == 0, 4, options.AutoRecapRatesPerDay),
+ )
if err != nil {
return nil, tgbot.
NewExceptionError(err).
@@ -277,7 +285,23 @@ func (h *CallbackQueryHandler) handleCallbackQueryAssignMode(c *tgbot.Context) (
WithReplyMarkup(tgbotapi.NewInlineKeyboardMarkup(msg.ReplyMarkup.InlineKeyboard...))
}
- markup, err := newRecapInlineKeyboardMarkup(c, chatID, fromID, has, actionData.Mode)
+ options, err := h.tgchats.FindOneRecapsOption(chatID)
+ if err != nil {
+ return nil, tgbot.
+ NewExceptionError(err).
+ WithMessage("暂时无法配置聊天记录回顾功能,请稍后再试!").
+ WithEdit(c.Update.Message).
+ WithReplyMarkup(tgbotapi.NewInlineKeyboardMarkup(msg.ReplyMarkup.InlineKeyboard...))
+ }
+
+ markup, err := newRecapInlineKeyboardMarkup(
+ c,
+ chatID,
+ fromID,
+ has,
+ actionData.Mode,
+ lo.Ternary(options.AutoRecapRatesPerDay == 0, 4, options.AutoRecapRatesPerDay),
+ )
if err != nil {
return nil, tgbot.
NewExceptionError(err).
@@ -384,3 +408,116 @@ func (h *CallbackQueryHandler) handleCallbackQueryUnsubscribe(c *tgbot.Context)
return c.NewMessage(fmt.Sprintf("已成功取消订阅群组 %s 的定时聊天回顾。", tgbot.EscapeHTMLSymbols(actionData.ChatTitle))).WithParseModeHTML(), nil
}
+
+func (h *CallbackQueryHandler) handleAutoRecapRatesPerDaySelect(c *tgbot.Context) (tgbot.Response, error) {
+ msg := c.Update.CallbackQuery.Message
+
+ generalErrorMessage := configureRecapGeneralInstructionMessage + "\n\n" + "应用聊天记录回顾功能的配置时出现了问题,请稍后再试!"
+
+ fromID := c.Update.CallbackQuery.From.ID
+ chatID := msg.Chat.ID
+ chatTitle := msg.Chat.Title
+ messageID := msg.MessageID
+
+ var actionData recap.ConfigureAutoRecapRatesPerDayActionData
+
+ err := c.BindFromCallbackQueryData(&actionData)
+ if err != nil {
+ return nil, tgbot.
+ NewExceptionError(err).
+ WithMessage(generalErrorMessage).
+ WithEdit(msg).
+ WithReplyMarkup(tgbotapi.NewInlineKeyboardMarkup(msg.ReplyMarkup.InlineKeyboard...))
+ }
+
+ shouldSkip := shouldSkipCallbackQueryHandlingByCheckingActionData(c, actionData, chatID, fromID)
+ if shouldSkip {
+ return nil, nil
+ }
+
+ // check whether the actor is admin or creator, and whether the bot is admin
+ err = checkAssignMode(c, chatID, c.Update.CallbackQuery.From)
+ if err != nil {
+ if errors.Is(err, errAdministratorPermissionRequired) {
+ h.logger.Debug("action skipped, callback query is not from an admin or creator",
+ zap.Int64("from_id", fromID),
+ zap.Int64("chat_id", chatID),
+ zap.String("permission_check_result", err.Error()),
+ )
+
+ return nil, nil
+ }
+ if errors.Is(err, errOperationCanNotBeDone) || errors.Is(err, errCreatorPermissionRequired) {
+ return nil, tgbot.
+ NewMessageError(configureRecapGeneralInstructionMessage + "\n\n" + err.Error()).
+ WithEdit(msg).
+ WithParseModeHTML().
+ WithReplyMarkup(tgbotapi.NewInlineKeyboardMarkup(msg.ReplyMarkup.InlineKeyboard...))
+ }
+
+ return nil, tgbot.
+ NewExceptionError(err).
+ WithMessage(generalErrorMessage).
+ WithEdit(msg).
+ WithReplyMarkup(tgbotapi.NewInlineKeyboardMarkup(msg.ReplyMarkup.InlineKeyboard...))
+ }
+
+ err = h.tgchats.SetAutoRecapRatesPerDay(chatID, actionData.Rates)
+ if err != nil {
+ return nil, tgbot.
+ NewExceptionError(err).
+ WithMessage(configureRecapGeneralInstructionMessage + "\n\n" + "每天自动创建回顾频率次数设定失败,请稍后再试!").
+ WithEdit(msg).
+ WithReplyMarkup(tgbotapi.NewInlineKeyboardMarkup(msg.ReplyMarkup.InlineKeyboard...))
+ }
+
+ options, err := h.tgchats.FindOneRecapsOption(chatID)
+ if err != nil {
+ return nil, tgbot.
+ NewExceptionError(err).
+ WithMessage(configureRecapGeneralInstructionMessage + "\n\n" + "每天自动创建回顾频率次数设定失败,请稍后再试!").
+ WithEdit(c.Update.Message).
+ WithReplyMarkup(tgbotapi.NewInlineKeyboardMarkup(msg.ReplyMarkup.InlineKeyboard...))
+ }
+
+ err = h.tgchats.QueueOneSendChatHistoriesRecapTaskForChatID(chatID, options)
+ if err != nil {
+ return nil, tgbot.
+ NewExceptionError(err).
+ WithMessage(configureRecapGeneralInstructionMessage + "\n\n" + "每天自动创建回顾频率次数设定失败,请稍后再试!").
+ WithEdit(msg).
+ WithReplyMarkup(tgbotapi.NewInlineKeyboardMarkup(msg.ReplyMarkup.InlineKeyboard...))
+ }
+
+ has, err := h.tgchats.HasChatHistoriesRecapEnabled(chatID, chatTitle)
+ if err != nil {
+ return nil, tgbot.
+ NewExceptionError(err).
+ WithMessage(configureRecapGeneralInstructionMessage + "\n\n" + "每天自动创建回顾频率次数设定失败,请稍后再试!").
+ WithEdit(msg).
+ WithReplyMarkup(tgbotapi.NewInlineKeyboardMarkup(msg.ReplyMarkup.InlineKeyboard...))
+ }
+
+ markup, err := newRecapInlineKeyboardMarkup(
+ c,
+ chatID,
+ fromID,
+ has,
+ tgchat.AutoRecapSendMode(options.AutoRecapSendMode),
+ actionData.Rates,
+ )
+ if err != nil {
+ return nil, tgbot.
+ NewExceptionError(err).
+ WithMessage(configureRecapGeneralInstructionMessage + "\n\n" + "每天自动创建回顾频率次数设定失败,请稍后再试!").
+ WithEdit(msg).
+ WithReplyMarkup(tgbotapi.NewInlineKeyboardMarkup(msg.ReplyMarkup.InlineKeyboard...))
+ }
+
+ return c.NewEditMessageTextAndReplyMarkup(messageID,
+ configureRecapGeneralInstructionMessage+"\n\n"+"每天自动创建聊天回顾的频率次数已设定为 "+strconv.FormatInt(int64(actionData.Rates), 10)+",将会自动收集群组中的聊天记录并在 "+strings.Join(lo.Map(tgchats.MapScheduleHours[actionData.Rates], func(item int64, _ int) string {
+ return fmt.Sprintf("%02d:00", item)
+ }), ",")+" 发送聊天回顾快报。",
+ markup,
+ ).WithParseModeHTML(), nil
+}
diff --git a/internal/bots/telegram/handlers/recap/configure_recap_command.go b/internal/bots/telegram/handlers/recap/configure_recap_command.go
index f750fd6..a0ee175 100644
--- a/internal/bots/telegram/handlers/recap/configure_recap_command.go
+++ b/internal/bots/telegram/handlers/recap/configure_recap_command.go
@@ -93,35 +93,104 @@ func checkAssignMode(ctx *tgbot.Context, chatID int64, user *tgbotapi.User) erro
return nil
}
-func newRecapInlineKeyboardMarkup(ctx *tgbot.Context, chatID int64, fromID int64, currentRecapStatus bool, currentRecapMode tgchat.AutoRecapSendMode) (tgbotapi.InlineKeyboardMarkup, error) {
- data, err := ctx.Bot.AssignOneCallbackQueryData("recap/configure/toggle", recap.ConfigureRecapToggleActionData{Status: !currentRecapStatus, ChatID: chatID, FromID: fromID})
+func newRecapInlineKeyboardMarkup(
+ c *tgbot.Context,
+ chatID int64,
+ fromID int64,
+ currentRecapStatusOn bool,
+ currentRecapMode tgchat.AutoRecapSendMode,
+ currentAutoRecapRatesPerDay int,
+) (tgbotapi.InlineKeyboardMarkup, error) {
+ nopData, err := c.Bot.AssignOneNopCallbackQueryData()
if err != nil {
return tgbotapi.InlineKeyboardMarkup{}, err
}
- publicData, err := ctx.Bot.AssignOneCallbackQueryData("recap/configure/assign_mode", recap.ConfigureRecapAssignModeActionData{Mode: tgchat.AutoRecapSendModePublicly, ChatID: chatID, FromID: fromID})
+ toggleOnData, err := c.Bot.AssignOneCallbackQueryData("recap/configure/toggle", recap.ConfigureRecapToggleActionData{Status: true, ChatID: chatID, FromID: fromID})
if err != nil {
return tgbotapi.InlineKeyboardMarkup{}, err
}
- privateData, err := ctx.Bot.AssignOneCallbackQueryData("recap/configure/assign_mode", recap.ConfigureRecapAssignModeActionData{Mode: tgchat.AutoRecapSendModeOnlyPrivateSubscriptions, ChatID: chatID, FromID: fromID})
+ toggleOffData, err := c.Bot.AssignOneCallbackQueryData("recap/configure/toggle", recap.ConfigureRecapToggleActionData{Status: false, ChatID: chatID, FromID: fromID})
if err != nil {
return tgbotapi.InlineKeyboardMarkup{}, err
}
- completeData, err := ctx.Bot.AssignOneCallbackQueryData("recap/configure/complete", recap.ConfigureRecapCompleteActionData{ChatID: chatID, FromID: fromID})
+ publicData, err := c.Bot.AssignOneCallbackQueryData("recap/configure/assign_mode", recap.ConfigureRecapAssignModeActionData{Mode: tgchat.AutoRecapSendModePublicly, ChatID: chatID, FromID: fromID})
+ if err != nil {
+ return tgbotapi.InlineKeyboardMarkup{}, err
+ }
+
+ privateData, err := c.Bot.AssignOneCallbackQueryData("recap/configure/assign_mode", recap.ConfigureRecapAssignModeActionData{Mode: tgchat.AutoRecapSendModeOnlyPrivateSubscriptions, ChatID: chatID, FromID: fromID})
+ if err != nil {
+ return tgbotapi.InlineKeyboardMarkup{}, err
+ }
+
+ completeData, err := c.Bot.AssignOneCallbackQueryData("recap/configure/complete", recap.ConfigureRecapCompleteActionData{ChatID: chatID, FromID: fromID})
+ if err != nil {
+ return tgbotapi.InlineKeyboardMarkup{}, err
+ }
+
+ if !currentRecapStatusOn {
+ return tgbotapi.NewInlineKeyboardMarkup(
+ tgbotapi.NewInlineKeyboardRow(
+ tgbotapi.NewInlineKeyboardButtonData("🔈 聊天记录回顾", nopData),
+ ),
+ tgbotapi.NewInlineKeyboardRow(
+ tgbotapi.NewInlineKeyboardButtonData(lo.Ternary(currentRecapStatusOn, "🔘 开启", "开启"), toggleOnData),
+ tgbotapi.NewInlineKeyboardButtonData(lo.Ternary(!currentRecapStatusOn, "🔘 关闭", "关闭"), toggleOffData),
+ ),
+ tgbotapi.NewInlineKeyboardRow(
+ tgbotapi.NewInlineKeyboardButtonData("📩 聊天记录回顾投递方式", nopData),
+ ),
+ tgbotapi.NewInlineKeyboardRow(
+ tgbotapi.NewInlineKeyboardButtonData(lo.Ternary(currentRecapMode == tgchat.AutoRecapSendModePublicly, "🔘 "+tgchat.AutoRecapSendModePublicly.String(), tgchat.AutoRecapSendModePublicly.String()), publicData),
+ tgbotapi.NewInlineKeyboardButtonData(lo.Ternary(currentRecapMode == tgchat.AutoRecapSendModeOnlyPrivateSubscriptions, "🔘 "+tgchat.AutoRecapSendModeOnlyPrivateSubscriptions.String(), tgchat.AutoRecapSendModeOnlyPrivateSubscriptions.String()), privateData),
+ ),
+ tgbotapi.NewInlineKeyboardRow(
+ tgbotapi.NewInlineKeyboardButtonData("✅ 完成", completeData),
+ ),
+ ), nil
+ }
+
+ twoTimePerDayData, err := c.Bot.AssignOneCallbackQueryData("recap/configure/auto_recap_rates_per_day", recap.ConfigureAutoRecapRatesPerDayActionData{Rates: 2, ChatID: chatID, FromID: fromID})
+ if err != nil {
+ return tgbotapi.InlineKeyboardMarkup{}, err
+ }
+
+ threeTimePerDayData, err := c.Bot.AssignOneCallbackQueryData("recap/configure/auto_recap_rates_per_day", recap.ConfigureAutoRecapRatesPerDayActionData{Rates: 3, ChatID: chatID, FromID: fromID})
+ if err != nil {
+ return tgbotapi.InlineKeyboardMarkup{}, err
+ }
+
+ fourTimePerDayData, err := c.Bot.AssignOneCallbackQueryData("recap/configure/auto_recap_rates_per_day", recap.ConfigureAutoRecapRatesPerDayActionData{Rates: 4, ChatID: chatID, FromID: fromID})
if err != nil {
return tgbotapi.InlineKeyboardMarkup{}, err
}
return tgbotapi.NewInlineKeyboardMarkup(
tgbotapi.NewInlineKeyboardRow(
- tgbotapi.NewInlineKeyboardButtonData(lo.Ternary(!currentRecapStatus, "🔈 开启聊天记录回顾", "🔇 关闭聊天记录回顾"), data),
+ tgbotapi.NewInlineKeyboardButtonData("🔈 聊天记录回顾", nopData),
+ ),
+ tgbotapi.NewInlineKeyboardRow(
+ tgbotapi.NewInlineKeyboardButtonData(lo.Ternary(currentRecapStatusOn, "🔘 开启", "开启"), toggleOnData),
+ tgbotapi.NewInlineKeyboardButtonData(lo.Ternary(!currentRecapStatusOn, "🔘 关闭", "关闭"), toggleOffData),
+ ),
+ tgbotapi.NewInlineKeyboardRow(
+ tgbotapi.NewInlineKeyboardButtonData("📩 聊天记录回顾投递方式", nopData),
),
tgbotapi.NewInlineKeyboardRow(
tgbotapi.NewInlineKeyboardButtonData(lo.Ternary(currentRecapMode == tgchat.AutoRecapSendModePublicly, "🔘 "+tgchat.AutoRecapSendModePublicly.String(), tgchat.AutoRecapSendModePublicly.String()), publicData),
tgbotapi.NewInlineKeyboardButtonData(lo.Ternary(currentRecapMode == tgchat.AutoRecapSendModeOnlyPrivateSubscriptions, "🔘 "+tgchat.AutoRecapSendModeOnlyPrivateSubscriptions.String(), tgchat.AutoRecapSendModeOnlyPrivateSubscriptions.String()), privateData),
),
+ tgbotapi.NewInlineKeyboardRow(
+ tgbotapi.NewInlineKeyboardButtonData("🛎️ 每天自动创建回顾次数", nopData),
+ ),
+ tgbotapi.NewInlineKeyboardRow(
+ tgbotapi.NewInlineKeyboardButtonData(lo.Ternary(currentAutoRecapRatesPerDay == 2, "🔘 2 次", "2 次"), twoTimePerDayData),
+ tgbotapi.NewInlineKeyboardButtonData(lo.Ternary(currentAutoRecapRatesPerDay == 3, "🔘 3 次", "3 次"), threeTimePerDayData),
+ tgbotapi.NewInlineKeyboardButtonData(lo.Ternary(currentAutoRecapRatesPerDay == 4, "🔘 4 次", "4 次"), fourTimePerDayData),
+ ),
tgbotapi.NewInlineKeyboardRow(
tgbotapi.NewInlineKeyboardButtonData("✅ 完成", completeData),
),
@@ -185,7 +254,14 @@ func (h *CommandHandler) handleConfigureRecapCommand(c *tgbot.Context) (tgbot.Re
options = &ent.TelegramChatRecapsOptions{AutoRecapSendMode: int(tgchat.AutoRecapSendModePublicly)}
}
- markup, err := newRecapInlineKeyboardMarkup(c, chatID, c.Update.Message.From.ID, has, tgchat.AutoRecapSendMode(options.AutoRecapSendMode))
+ markup, err := newRecapInlineKeyboardMarkup(
+ c,
+ chatID,
+ c.Update.Message.From.ID,
+ has,
+ tgchat.AutoRecapSendMode(options.AutoRecapSendMode),
+ lo.Ternary(options.AutoRecapRatesPerDay == 0, 4, options.AutoRecapRatesPerDay),
+ )
if err != nil {
return nil, tgbot.NewExceptionError(err).WithMessage("暂时无法配置聊天记录回顾功能,请稍后再试!").WithReply(c.Update.Message)
}
diff --git a/internal/bots/telegram/handlers/recap/recap.go b/internal/bots/telegram/handlers/recap/recap.go
index e15e5aa..790fffe 100644
--- a/internal/bots/telegram/handlers/recap/recap.go
+++ b/internal/bots/telegram/handlers/recap/recap.go
@@ -57,6 +57,7 @@ func (h *Handlers) Install(dispatcher *tgbot.Dispatcher) {
dispatcher.OnCallbackQuery("recap/configure/complete", tgbot.NewHandler(h.callbackQuery.handleCallbackQueryComplete))
dispatcher.OnCallbackQuery("recap/unsubscribe_recap", tgbot.NewHandler(h.callbackQuery.handleCallbackQueryUnsubscribe))
dispatcher.OnCallbackQuery("recap/recap/feedback/react", tgbot.NewHandler(h.callbackQuery.handleCallbackQueryReact))
+ dispatcher.OnCallbackQuery("recap/configure/auto_recap_rates_per_day", tgbot.NewHandler(h.callbackQuery.handleAutoRecapRatesPerDaySelect))
dispatcher.OnLeftChatMember(tgbot.NewHandler(h.command.handleChatMemberLeft))
}
diff --git a/internal/models/tgchats/feature_flags.go b/internal/models/tgchats/feature_flags.go
index 9281fe2..a54a7ec 100644
--- a/internal/models/tgchats/feature_flags.go
+++ b/internal/models/tgchats/feature_flags.go
@@ -164,16 +164,42 @@ func (m *Model) QueueSendChatHistoriesRecapTask() {
return
}
+ mChatOptions := make(map[int64]*ent.TelegramChatRecapsOptions)
+
for _, chat := range chats {
- err = m.QueueOneSendChatHistoriesRecapTaskForChatID(chat.ChatID)
+ options, err := m.FindOneOrCreateRecapsOption(chat.ChatID)
if err != nil {
- m.logger.Error("failed to queue send chat histories recap task", zap.Error(err))
+ m.logger.Error("failed to find one or create recaps option",
+ zap.Int64("chat_id", chat.ChatID),
+ zap.Error(err),
+ )
+
continue
}
+
+ mChatOptions[chat.ChatID] = options
}
+
+ for _, chat := range chats {
+ options, ok := mChatOptions[chat.ChatID]
+ if !ok {
+ continue
+ }
+
+ err := m.QueueOneSendChatHistoriesRecapTaskForChatID(chat.ChatID, options)
+ if err != nil {
+ continue
+ }
+ }
+}
+
+var MapScheduleHours = map[int][]int64{
+ 2: {8, 20}, // queue for 08:00, 20:00
+ 3: {0, 8, 16}, // queue for 00:00, 08:00, 16:00
+ 4: {2, 8, 14, 20}, // queue for 02:00, 08:00, 14:00, 20:00
}
-func (m *Model) QueueOneSendChatHistoriesRecapTaskForChatID(chatID int64) error {
+func (m *Model) newNextScheduleTimeForChatHistoriesRecapTasksForChatID(chatID int64, rate int) time.Time {
location := time.UTC
if m.config.TimezoneShiftSeconds != 0 {
location = time.FixedZone("Local", int(m.config.TimezoneShiftSeconds))
@@ -184,32 +210,72 @@ func (m *Model) QueueOneSendChatHistoriesRecapTaskForChatID(chatID int64) error
UTC(). // Resets to UTC.
In(location) // Align current timezone with the configured offset (if any) for later calculation.
- scheduleTargets := []int64{2, 8, 14, 20} // queue for 02:00, 08:00, 14:00, 20:00
- scheduleSets := make([]time.Time, 0, len(scheduleTargets))
+ scheduleTargets, ok := MapScheduleHours[rate]
+ if !ok {
+ scheduleTargets = MapScheduleHours[4]
+ }
+
+ var nextScheduleTimeSet bool
+ var nextScheduleTime time.Time
for _, target := range scheduleTargets {
if now.Hour() < int(target) {
- scheduleSets = append(scheduleSets, time.Date(now.Year(), now.Month(), now.Day(), int(target), 0, 0, 0, location))
+ nextScheduleTime = time.Date(now.Year(), now.Month(), now.Day(), int(target), 0, 0, 0, location)
+ nextScheduleTimeSet = true
break
}
}
- if len(scheduleSets) == 0 {
- scheduleSets = append(scheduleSets, time.Date(now.Year(), now.Month(), now.Day()+1, int(scheduleTargets[0]), 0, 0, 0, location))
+ if !nextScheduleTimeSet {
+ nextScheduleTime = time.Date(now.Year(), now.Month(), now.Day()+1, int(scheduleTargets[0]), 0, 0, 0, location)
+ nextScheduleTimeSet = true
}
- for _, schedule := range scheduleSets {
- m.logger.Info("scheduled one send chat histories recap task for chat", zap.Int64("chat_id", chatID), zap.Time("schedule", schedule))
+ return nextScheduleTime
+}
- ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
+func (m *Model) queueOneSendChatHistoriesRecapTaskForChatIDBasedOnScheduleSets(chatID int64, nextScheduleTime time.Time) error {
+ m.logger.Info("scheduled one send chat histories recap task for chat",
+ zap.Int64("chat_id", chatID),
+ zap.Time("schedule", nextScheduleTime),
+ )
- err := m.digger.BuryUtil(ctx, timecapsules.AutoRecapCapsule{
- ChatID: chatID,
- }, schedule.UnixMilli())
- if err != nil {
- m.logger.Error("failed to bury one send chat histories recap task for chat", zap.Int64("chat_id", chatID), zap.Error(err))
- }
+ ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
+ defer cancel()
+
+ err := m.digger.BuryUtil(ctx, timecapsules.AutoRecapCapsule{
+ ChatID: chatID,
+ }, nextScheduleTime.UnixMilli())
+ if err != nil {
+ m.logger.Error("failed to bury one send chat histories recap task for chat",
+ zap.Int64("chat_id", chatID),
+ zap.Time("schedule", nextScheduleTime),
+ zap.Error(err),
+ )
+ }
+
+ return nil
+}
+
+func (m *Model) QueueOneSendChatHistoriesRecapTaskForChatID(chatID int64, options *ent.TelegramChatRecapsOptions) error {
+ if !lo.Contains([]int{2, 3, 4}, options.AutoRecapRatesPerDay) {
+ m.logger.Error("invalid auto recap rates per day, fallbacks, to 4 times a day",
+ zap.Int64("chat_id", chatID),
+ zap.Int("auto_recap_rates", options.AutoRecapRatesPerDay),
+ )
+
+ options.AutoRecapRatesPerDay = 4
+ }
+
+ nextScheduleTime := m.newNextScheduleTimeForChatHistoriesRecapTasksForChatID(chatID, options.AutoRecapRatesPerDay)
- cancel()
+ err := m.queueOneSendChatHistoriesRecapTaskForChatIDBasedOnScheduleSets(chatID, nextScheduleTime)
+ if err != nil {
+ m.logger.Error("failed to queue send chat histories recap task",
+ zap.Int64("chat_id", chatID),
+ zap.Int("auto_recap_rates", options.AutoRecapRatesPerDay),
+ zap.Error(err),
+ )
+ return err
}
return nil
diff --git a/internal/models/tgchats/recap_options_test.go b/internal/models/tgchats/recap_options_test.go
new file mode 100644
index 0000000..fa8281e
--- /dev/null
+++ b/internal/models/tgchats/recap_options_test.go
@@ -0,0 +1,57 @@
+package tgchats
+
+import (
+ "testing"
+
+ "github.com/nekomeowww/xo"
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+)
+
+func TestFindOneOrCreateRecapsOption(t *testing.T) {
+ chatID := xo.RandomInt64()
+
+ option, err := model.FindOneOrCreateRecapsOption(chatID)
+ require.NoError(t, err)
+ require.NotNil(t, option)
+
+ assert.Equal(t, chatID, option.ChatID)
+ assert.Empty(t, option.AutoRecapSendMode)
+ assert.Zero(t, option.AutoRecapRatesPerDay)
+
+ option2, err := model.FindOneRecapsOption(chatID)
+ require.NoError(t, err)
+ require.NotNil(t, option2)
+
+ assert.Equal(t, option.ID, option2.ID)
+
+ option3, err := model.FindOneOrCreateRecapsOption(chatID)
+ require.NoError(t, err)
+ require.NotNil(t, option3)
+
+ assert.Equal(t, option.ID, option3.ID)
+}
+
+func TestSetAutoRecapRatesPerDay(t *testing.T) {
+ chatID := xo.RandomInt64()
+
+ err := model.SetAutoRecapRatesPerDay(chatID, 4)
+ require.NoError(t, err)
+
+ option, err := model.FindOneRecapsOption(chatID)
+ require.NoError(t, err)
+ require.NotNil(t, option)
+
+ assert.Equal(t, chatID, option.ChatID)
+ assert.Equal(t, 4, option.AutoRecapRatesPerDay)
+
+ err = model.SetAutoRecapRatesPerDay(chatID, 10)
+ require.NoError(t, err)
+
+ option2, err := model.FindOneRecapsOption(chatID)
+ require.NoError(t, err)
+ require.NotNil(t, option2)
+
+ assert.Equal(t, chatID, option2.ChatID)
+ assert.Equal(t, 10, option2.AutoRecapRatesPerDay)
+}
diff --git a/internal/models/tgchats/recaps_options.go b/internal/models/tgchats/recaps_options.go
index 15e557d..da87b2e 100644
--- a/internal/models/tgchats/recaps_options.go
+++ b/internal/models/tgchats/recaps_options.go
@@ -26,6 +26,28 @@ func (m *Model) FindOneRecapsOption(chatID int64) (*ent.TelegramChatRecapsOption
return option, nil
}
+func (m *Model) FindOneOrCreateRecapsOption(chatID int64) (*ent.TelegramChatRecapsOptions, error) {
+ option, err := m.FindOneRecapsOption(chatID)
+ if err != nil {
+ return nil, err
+ }
+ if option == nil {
+ option, err := m.ent.TelegramChatRecapsOptions.
+ Create().
+ SetChatID(chatID).
+ SetAutoRecapSendMode(int(tgchat.AutoRecapSendModePublicly)).
+ SetAutoRecapRatesPerDay(4).
+ Save(context.Background())
+ if err != nil {
+ return nil, err
+ }
+
+ return option, nil
+ }
+
+ return option, nil
+}
+
func (m *Model) SetRecapsRecapMode(chatID int64, recapMode tgchat.AutoRecapSendMode) error {
option, err := m.FindOneRecapsOption(chatID)
if err != nil {
@@ -62,6 +84,28 @@ func (m *Model) ManualRecapRatePerSeconds(option *ent.TelegramChatRecapsOptions)
return time.Duration(seconds) * time.Second
}
+func (m *Model) SetAutoRecapRatesPerDay(chatID int64, ratesPerDay int) error {
+ option, err := m.FindOneOrCreateRecapsOption(chatID)
+ if err != nil {
+ return err
+ }
+ if option == nil {
+ panic("option is nil")
+ }
+
+ err = m.ent.TelegramChatRecapsOptions.
+ Update().
+ SetAutoRecapRatesPerDay(ratesPerDay).
+ Where(telegramchatrecapsoptions.ID(option.ID)).
+ Where(telegramchatrecapsoptions.ChatIDEQ(chatID)).
+ Exec(context.Background())
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
func (m *Model) DeleteOneOptionByChatID(chatID int64) error {
_, err := m.ent.TelegramChatRecapsOptions.
Delete().
diff --git a/internal/services/autorecap/autorecap.go b/internal/services/autorecap/autorecap.go
index c6518b0..316f5b4 100644
--- a/internal/services/autorecap/autorecap.go
+++ b/internal/services/autorecap/autorecap.go
@@ -121,7 +121,7 @@ func (m *AutoRecapService) sendChatHistoriesRecapTimeCapsuleHandler(
may.HandleErrors(func(errs []error) {
// requeue if failed
- queueErr := m.tgchats.QueueOneSendChatHistoriesRecapTaskForChatID(capsule.Payload.ChatID)
+ queueErr := m.tgchats.QueueOneSendChatHistoriesRecapTaskForChatID(capsule.Payload.ChatID, options)
if queueErr != nil {
m.logger.Error("failed to queue one send chat histories recap task for chat", zap.Int64("chat_id", capsule.Payload.ChatID), zap.Error(queueErr))
}
@@ -135,7 +135,7 @@ func (m *AutoRecapService) sendChatHistoriesRecapTimeCapsuleHandler(
}
// always requeue
- err := m.tgchats.QueueOneSendChatHistoriesRecapTaskForChatID(capsule.Payload.ChatID)
+ err := m.tgchats.QueueOneSendChatHistoriesRecapTaskForChatID(capsule.Payload.ChatID, options)
if err != nil {
m.logger.Error("failed to queue one send chat histories recap task for chat", zap.Int64("chat_id", capsule.Payload.ChatID), zap.Error(err))
}
diff --git a/pkg/bots/tgbot/dispatcher.go b/pkg/bots/tgbot/dispatcher.go
index 01c9abf..5a3b1aa 100644
--- a/pkg/bots/tgbot/dispatcher.go
+++ b/pkg/bots/tgbot/dispatcher.go
@@ -58,6 +58,9 @@ func NewDispatcher() func(logger *logger.Logger) *Dispatcher {
{Command: d.cancelCommand.Command(), HelpMessage: d.cancelCommand.CommandHelp(), Handler: NewHandler(d.cancelCommand.handle)},
{Command: d.startCommandHandler.Command(), HelpMessage: d.startCommandHandler.CommandHelp(), Handler: NewHandler(d.startCommandHandler.handle)},
})
+ d.OnCallbackQuery("nop", NewHandler(func(ctx *Context) (Response, error) {
+ return nil, nil
+ }))
return d
}
@@ -172,7 +175,7 @@ func (d *Dispatcher) dispatchCallbackQuery(c *Context) {
strings.Join(identityStrings, " "),
color.FgYellow.Render(c.Update.CallbackQuery.From.ID),
c.Update.CallbackData(),
- color.FgRed.Render("无法调度 Callback Query,监测到缺少路由。"),
+ color.FgRed.Render("无法调度 Callback Query,检测到缺少路由。"),
color.FgRed.Render("Unable to dispatch Callback Query due to missing route DETECTED."),
color.FgRed.Render("大多数情况下,发生这种情况的原因是相应的处理程序没有通过 OnCallbackQuery(...) 方法正确注册,或者内部派发器未能与之匹配,请检查已注册的处理程序及其路由,然后再试一次。"),
color.FgRed.Render("For most of the time, this happens when the corresponding handler wasn't registered properly through OnCallbackQuery(...) method or internal dispatcher failed to match it, please check registered handlers and the route of them and then try again."),
diff --git a/pkg/bots/tgbot/tgbot.go b/pkg/bots/tgbot/tgbot.go
index 2b9514f..ca435b0 100644
--- a/pkg/bots/tgbot/tgbot.go
+++ b/pkg/bots/tgbot/tgbot.go
@@ -421,6 +421,10 @@ func (b *Bot) DeleteAllDeleteLaterMessages(forUserID int64) error {
return res.Error()
}
+func (b *Bot) AssignOneNopCallbackQueryData() (string, error) {
+ return b.AssignOneCallbackQueryData("nop", "")
+}
+
func (b *Bot) AssignOneCallbackQueryData(route string, data any) (string, error) {
jsonData, err := json.Marshal(data)
if err != nil {
diff --git a/pkg/types/bot/handlers/recap/configure_recap.go b/pkg/types/bot/handlers/recap/configure_recap.go
index 127fb97..3da83af 100644
--- a/pkg/types/bot/handlers/recap/configure_recap.go
+++ b/pkg/types/bot/handlers/recap/configure_recap.go
@@ -23,6 +23,12 @@ type ConfigureRecapCompleteActionData struct {
FromID int64 `json:"fromId"`
}
+type ConfigureAutoRecapRatesPerDayActionData struct {
+ Rates int `json:"rates"`
+ ChatID int64 `json:"chatId"`
+ FromID int64 `json:"fromId"`
+}
+
type FeedbackRecapReactionActionData struct {
ChatID int64 `json:"chatId"`
LogID string `json:"logId"`
diff --git a/pkg/types/tgchat/recap.go b/pkg/types/tgchat/recap.go
index f2ff076..5954d3f 100644
--- a/pkg/types/tgchat/recap.go
+++ b/pkg/types/tgchat/recap.go
@@ -10,10 +10,10 @@ const (
func (a AutoRecapSendMode) String() string {
switch a {
case AutoRecapSendModePublicly:
- return "公开模式"
+ return "公开"
case AutoRecapSendModeOnlyPrivateSubscriptions:
- return "私聊订阅模式"
+ return "私聊"
default:
- return "其他模式"
+ return "其他"
}
}