mirror of
https://github.com/Nick80835/microbot
synced 2025-08-22 18:19:16 +00:00
Revert "add probably slow as hell stuff"
This reverts commit b78df6e82b6fda27cd92466e5f3bc5c8f0c3537f.
This commit is contained in:
parent
235b935b3f
commit
2bc8ced087
@ -8,4 +8,3 @@ nsfw_blacklist =
|
||||
blacklisted_users =
|
||||
sudo_users =
|
||||
bot_name = a name like jeff
|
||||
lydia_key = lydia API key
|
||||
|
@ -1,7 +1,6 @@
|
||||
aiodns
|
||||
aiohttp
|
||||
cchardet
|
||||
coffeehouse
|
||||
cryptg
|
||||
gTTS
|
||||
hachoir
|
||||
|
@ -25,7 +25,6 @@ moo_answers = [
|
||||
]
|
||||
|
||||
|
||||
if not ldr.settings.get_config("lydia_key"):
|
||||
@ldr.add(f"{bot_name}(,|) (are|am|is|will|should|can|have|was|were|does|did|may|do)", simple_pattern=True, hide_help=True)
|
||||
async def ask_bot(event):
|
||||
if event.args:
|
||||
|
@ -1,23 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
from functools import partial
|
||||
|
||||
from coffeehouse import LydiaAI
|
||||
|
||||
from ubot.micro_bot import ldr
|
||||
|
||||
bot_name = ldr.settings.get_config("bot_name") or "bot"
|
||||
|
||||
if ldr.settings.get_config("lydia_key"):
|
||||
lydia_ai = LydiaAI(ldr.settings.get_config("lydia_key"))
|
||||
session = lydia_ai.create_session("en")
|
||||
|
||||
@ldr.add(f"{bot_name}(,|)", simple_pattern=True, hide_help=True)
|
||||
async def talk_to_lydia(event):
|
||||
if event.args:
|
||||
thought_text = await event.client.loop.run_in_executor(ldr.thread_pool, partial(async_think, event.args))
|
||||
await event.reply(thought_text)
|
||||
|
||||
def async_think(text):
|
||||
return_text = session.think_thought(text)
|
||||
return return_text
|
Loading…
x
Reference in New Issue
Block a user