2
0
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:
Nick80835 2020-06-29 13:55:02 -04:00
parent 235b935b3f
commit 2bc8ced087
4 changed files with 25 additions and 51 deletions

View File

@ -8,4 +8,3 @@ nsfw_blacklist =
blacklisted_users =
sudo_users =
bot_name = a name like jeff
lydia_key = lydia API key

View File

@ -1,7 +1,6 @@
aiodns
aiohttp
cchardet
coffeehouse
cryptg
gTTS
hachoir

View File

@ -25,15 +25,14 @@ 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):
@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:
await event.reply(choice(yesno_answers))
@ldr.add(f"{bot_name}(,|) say", simple_pattern=True, hide_help=True)
async def say_something(event):
@ldr.add(f"{bot_name}(,|) say", simple_pattern=True, hide_help=True)
async def say_something(event):
if event.args:
if event.is_reply:
reply = await event.get_reply_message()
@ -47,8 +46,8 @@ if not ldr.settings.get_config("lydia_key"):
pass
@ldr.add(f"{bot_name}(,|) edit to", simple_pattern=True, hide_help=True, sudo=True)
async def edit_message(event):
@ldr.add(f"{bot_name}(,|) edit to", simple_pattern=True, hide_help=True, sudo=True)
async def edit_message(event):
if event.args:
if event.is_reply:
reply = await event.get_reply_message()

View File

@ -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