mirror of
https://github.com/Nick80835/microbot
synced 2025-08-23 10:38:51 +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 =
|
blacklisted_users =
|
||||||
sudo_users =
|
sudo_users =
|
||||||
bot_name = a name like jeff
|
bot_name = a name like jeff
|
||||||
lydia_key = lydia API key
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
aiodns
|
aiodns
|
||||||
aiohttp
|
aiohttp
|
||||||
cchardet
|
cchardet
|
||||||
coffeehouse
|
|
||||||
cryptg
|
cryptg
|
||||||
gTTS
|
gTTS
|
||||||
hachoir
|
hachoir
|
||||||
|
@ -25,41 +25,40 @@ 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)
|
||||||
@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):
|
||||||
async def ask_bot(event):
|
if event.args:
|
||||||
if event.args:
|
await event.reply(choice(yesno_answers))
|
||||||
await event.reply(choice(yesno_answers))
|
|
||||||
|
|
||||||
|
|
||||||
@ldr.add(f"{bot_name}(,|) say", simple_pattern=True, hide_help=True)
|
@ldr.add(f"{bot_name}(,|) say", simple_pattern=True, hide_help=True)
|
||||||
async def say_something(event):
|
async def say_something(event):
|
||||||
if event.args:
|
if event.args:
|
||||||
if event.is_reply:
|
if event.is_reply:
|
||||||
reply = await event.get_reply_message()
|
reply = await event.get_reply_message()
|
||||||
await reply.reply(event.args)
|
await reply.reply(event.args)
|
||||||
else:
|
else:
|
||||||
await event.client.send_message(event.chat, event.args)
|
await event.client.send_message(event.chat, event.args)
|
||||||
|
|
||||||
|
try:
|
||||||
|
await event.delete()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@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()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
await reply.edit(event.args)
|
||||||
await event.delete()
|
await event.delete()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@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()
|
|
||||||
|
|
||||||
try:
|
|
||||||
await reply.edit(event.args)
|
|
||||||
await event.delete()
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
@ldr.add(f"let the bodies hit the", simple_pattern=True, hide_help=True)
|
@ldr.add(f"let the bodies hit the", simple_pattern=True, hide_help=True)
|
||||||
async def floor(event):
|
async def floor(event):
|
||||||
if not event.args:
|
if not 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