Add /browse command to AnthropicTelegramInferenceBot
This commit is contained in:
@@ -4,6 +4,7 @@ import logging
|
|||||||
from anthropic import Anthropic
|
from anthropic import Anthropic
|
||||||
from base_telegram_inference_bot import BaseTelegramInferenceBot
|
from base_telegram_inference_bot import BaseTelegramInferenceBot
|
||||||
from telegram_helper import TelegramHelper
|
from telegram_helper import TelegramHelper
|
||||||
|
from browse_command import browse_command, button_callback
|
||||||
|
|
||||||
class AnthropicTelegramInferenceBot(BaseTelegramInferenceBot):
|
class AnthropicTelegramInferenceBot(BaseTelegramInferenceBot):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -101,9 +102,19 @@ class AnthropicTelegramInferenceBot(BaseTelegramInferenceBot):
|
|||||||
else:
|
else:
|
||||||
return "No active processing to abort."
|
return "No active processing to abort."
|
||||||
|
|
||||||
|
async def browse(self, update, context):
|
||||||
|
await browse_command(update, context)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
bot = AnthropicTelegramInferenceBot()
|
bot = AnthropicTelegramInferenceBot()
|
||||||
telegram_helper = TelegramHelper(bot)
|
telegram_helper = TelegramHelper(bot)
|
||||||
|
|
||||||
|
# Add the /browse command handler
|
||||||
|
telegram_helper.add_command_handler('browse', bot.browse)
|
||||||
|
|
||||||
|
# Add the button callback handler
|
||||||
|
telegram_helper.add_callback_query_handler(button_callback)
|
||||||
|
|
||||||
telegram_helper.run()
|
telegram_helper.run()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user