mirror of
https://github.com/Nick80835/microbot
synced 2025-08-31 14:38:04 +00:00
remove igen and tgen
This commit is contained in:
@@ -8,4 +8,3 @@ nsfw_blacklist =
|
||||
blacklisted_users =
|
||||
sudo_users =
|
||||
bot_name = a name like jeff
|
||||
deep_ai_key = API key to deepai
|
||||
|
@@ -38,34 +38,6 @@ async def randomfact(event):
|
||||
await event.reply(random_fact)
|
||||
|
||||
|
||||
@ldr.add("tgen")
|
||||
async def text_generator(event):
|
||||
if not event.args or not ldr.settings.get_config("deep_ai_key"):
|
||||
return
|
||||
|
||||
async with ldr.aioclient.post("https://api.deepai.org/api/text-generator", data={"text": event.args}, headers={"api-key": ldr.settings.get_config("deep_ai_key")}) as response:
|
||||
if response.status == 200:
|
||||
generated_text = (await response.json())["output"].split("<|endoftext|>")[0]
|
||||
await event.reply(generated_text)
|
||||
else:
|
||||
await event.reply(f"An error occurred: **{response.status}**")
|
||||
return
|
||||
|
||||
|
||||
@ldr.add("igen")
|
||||
async def image_generator(event):
|
||||
if not event.args or not ldr.settings.get_config("deep_ai_key"):
|
||||
return
|
||||
|
||||
async with ldr.aioclient.post("https://api.deepai.org/api/text2img", data={"text": event.args}, headers={"api-key": ldr.settings.get_config("deep_ai_key")}) as response:
|
||||
if response.status == 200:
|
||||
image_url = (await response.json())["output_url"]
|
||||
await event.reply(file=image_url)
|
||||
else:
|
||||
await event.reply(f"An error occurred: **{response.status}**")
|
||||
return
|
||||
|
||||
|
||||
@ldr.add("pokemon", pattern_extra="(s|)")
|
||||
async def pokemon_image(event):
|
||||
if not event.args:
|
||||
|
Reference in New Issue
Block a user