mirror of
https://github.com/Nick80835/microbot
synced 2025-08-22 01:58:17 +00:00
add ability to disable link preview for inline articles
This commit is contained in:
parent
561361811e
commit
9448539c73
@ -48,6 +48,7 @@ class InlineArticleCommand:
|
||||
self.pattern_extra = args.get("pattern_extra", "")
|
||||
self.default = args.get("default", None)
|
||||
self.extra = args.get("extra", None)
|
||||
self.link_preview = args.get("link_preview", True)
|
||||
|
||||
|
||||
class CallbackQueryCommand:
|
||||
|
@ -137,6 +137,7 @@ class CommandHandler():
|
||||
event.command = pattern_match.groups()[0]
|
||||
event.extra = command.extra
|
||||
event.object = command
|
||||
event.link_preview = command.link_preview
|
||||
|
||||
result_list = await command.function(event)
|
||||
|
||||
@ -147,7 +148,7 @@ class CommandHandler():
|
||||
|
||||
for result in result_list:
|
||||
try:
|
||||
articles += [await builder.article(title=result["title"], description=result["description"], text=result["text"])]
|
||||
articles += [await builder.article(title=result["title"], description=result["description"], text=result["text"], link_preview=event.link_preview)]
|
||||
except:
|
||||
print_exc()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user