Phase 1: quick flow fixes
- One message per job: the status message is deleted once the file is
sent, or shortened to "Sent." when Telegram keeps it.
- No reply quotes in private chats; groups keep them.
- Queue status only mentions the position when the wait is above
QUEUE_NOTICE_THRESHOLD_SECONDS or somebody is ahead. Status edits are
throttled to one per 2.5 s per message; a state that arrives too soon
is shown later instead of dropped. The wait estimate is 0 with a free
slot.
- Caption with title (uploader and date when generic), uploader,
duration, a short source link without tracking parameters and an
optional "via @bot" line (CAPTION_ATTRIBUTION). Uploaded videos get a
320 px JPEG thumbnail; merged MP4s are written with faststart.
- Buttons under the result: Audio (MP3), Other quality, Thumbnail,
Delete. Requester only in groups.
- Language resolved once per update and passed in the context. A
fallback to English is logged as a bug; a test walks every screen in
Spanish and Dutch. Language picker on the first /start.
- Sizes without a zero decimal ("50 MB").
- First link of a new user shows the card once and sets the default to
"best that fits my limit".
- Errors offer the next step (Try again, Smaller quality, Upgrade, Open
app); passing lookup failures are retried once.
- Up to MULTI_LINK_MAX links per message; a link sent a moment ago gets
"already sent" with a Send again button.
- Mini App menu button, labelled per private chat in the user's
language.
- Personal /settings in private chats with an "Add me to a group"
button.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3c153af97f
commit
6843053582
+12
-4
@@ -215,18 +215,26 @@ func (b *Bot) cmdReferral(ctx context.Context, m *telego.Message, act actor) {
|
||||
if !b.privateOnly(ctx, m, act) {
|
||||
return
|
||||
}
|
||||
n, err := b.store.CountReferrals(ctx, act.user.ID)
|
||||
text, err := b.referralText(ctx, act)
|
||||
if err != nil {
|
||||
b.internalError(ctx, m.Chat.ID, act, err)
|
||||
return
|
||||
}
|
||||
_, _ = b.send(ctx, m.Chat.ID, 0, text, nil)
|
||||
}
|
||||
|
||||
// referralText explains the referral program with the user's own link.
|
||||
func (b *Bot) referralText(ctx context.Context, act actor) (string, error) {
|
||||
n, err := b.store.CountReferrals(ctx, act.user.ID)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
link := "https://t.me/" + b.username + "?start=ref_" + strconv.FormatInt(act.user.ID, 10)
|
||||
text := b.tr.HTML(act.lang, "referral.text", i18n.Args{
|
||||
return b.tr.HTML(act.lang, "referral.text", i18n.Args{
|
||||
"Link": link,
|
||||
"Reward": b.tr.Sats(act.lang, b.cfg.Prices.ReferralReward),
|
||||
"Count": n,
|
||||
})
|
||||
_, _ = b.send(ctx, m.Chat.ID, 0, text, nil)
|
||||
}), nil
|
||||
}
|
||||
|
||||
func (b *Bot) cmdRedeem(ctx context.Context, m *telego.Message, act actor, arg string) {
|
||||
|
||||
Reference in New Issue
Block a user