Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 24, 2024
1 parent 63f3dd0 commit 3605d4e
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 147 deletions.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ pyrogram==1.4.16
requests
requests_html
tgcrypto
tgcrypto
wget
20 changes: 10 additions & 10 deletions shizuka/ShizukaChatBot/VoiceChatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,36 @@ async def fetch(url):


async def ai_shizuka(url):
ai_name = "Shizuka.mp3"
ai_name = 'Shizuka.mp3'
async with aiohttp.ClientSession() as session, session.get(url) as resp:
if resp.status == 200:
f = await aiofiles.open(ai_name, mode="wb")
f = await aiofiles.open(ai_name, mode='wb')
await f.write(await resp.read())
await f.close()
return ai_name


@SHIZUKA.on_message(filters.command("shizuka"))
@SHIZUKA.on_message(filters.command('shizuka'))
async def shizuka(_, message):
if len(message.command) < 2:
await message.reply_text("Shizuka AI Voice Chatbot")
await message.reply_text('Shizuka AI Voice Chatbot')
return
text = message.text.split(None, 1)[1]
shizuka = text.replace(" ", "%20")
m = await message.reply_text("Shizuka is the best...")
shizuka = text.replace(' ', '%20')
m = await message.reply_text('Shizuka is the best...')
try:
L = await fetch(
f"https://api.affiliateplus.xyz/api/chatbot?message={shizuka}&botname=Shizuka&ownername=Chankit&user=1",
)
chatbot = L["message"]
chatbot = L['message']
VoiceAi = f"https://lyciavoice.herokuapp.com/shizuka?text={chatbot}&lang=en"
name = "shizuka"
name = 'shizuka'
except Exception as e:
await m.edit(str(e))
return
await m.edit("Made By @NeuroticAssociation")
await m.edit('Made By @NeuroticAssociation')
ShizukaVoice = await ai_shizuka(VoiceAi)
await m.edit("Replying...")
await m.edit('Replying...')
await message.reply_audio(audio=ShizukaVoice, title=chatbot, performer=name)
os.remove(ShizukaVoice)
await m.delete()
Loading

0 comments on commit 3605d4e

Please sign in to comment.