Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
makeding committed Jul 17, 2024
1 parent b4ff5ec commit f9c1475
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion db.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export async function update_setting(value, chat_id, flag) {
// throw 'e'
}
}
if (['tags', 'open', 'share', 'remove_keyboard', 'remove_caption', 'single_caption', 'album', 'album_one', 'album_equal', 'desc', 'overwrite', 'asfile', 'append_file', 'caption_extraction', 'caption_above'].includes(i)) {
if (['tags', 'open', 'share', 'remove_keyboard', 'remove_caption', 'single_caption', 'album', 'album_one', 'album_equal', 'desc', 'overwrite', 'asfile', 'append_file', 'caption_extraction', 'caption_above', 'show_id'].includes(i)) {
if (typeof value.default[i] === 'boolean') {
s.default[i] = value.default[i]
}
Expand Down
5 changes: 3 additions & 2 deletions handlers/telegram/pre_handle.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ export async function read_user_setting(bot, ctx) {
caption_above: us(d_f, ctx.text,'caption_above',['above']),
// can't use switch_inline_query in a channel chat, because a user will not be able to use the button without knowing bot's username
share: ctx.type === 'channel' ? false : us(d_f, ctx.text,'share'),
remove_keyboard: us(d_f, ctx.text,'remove_keyboard',['kb']),
remove_caption: us(d_f, ctx.text,'remove_caption',['cp']),
// dirty but work
remove_keyboard: us(d_f, ctx.text.replaceAll('+','\uff69').replaceAll('-','+').replaceAll('\uff69','-'),'remove_keyboard',['kb']),
remove_caption: us(d_f, ctx.text.replaceAll('+','\uff69').replaceAll('-','+').replaceAll('\uff69','-'),'remove_caption',['cp']),
// inline mode doesn't support mediagroup single_caption mode is useless
single_caption: ctx.inlineQuery ? false : us(d_f, ctx.text,'single_caption',['sc']),
show_id: us(d_f, ctx.text,'show_id',['id']),
Expand Down

0 comments on commit f9c1475

Please sign in to comment.