-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.py
75 lines (54 loc) · 1.55 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
## credit moezilla
from pyrogram.types import (
Message,
)
from pyrogram import filters, Client
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
import requests
import os
import re
API_ID = os.environ.get("API_ID", None)
API_HASH = os.environ.get("API_HASH", None)
TOKEN = os.environ.get("TOKEN", None)
BOT_ID = os.environ.get("BOT_ID", None)
kuki = Client(
"KukiBot",
api_id=API_ID,
api_hash=API_HASH,
bot_token=TOKEN,
)
@kuki.on_message(
filters.text
& filters.reply
& ~filters.bot
& ~filters.edited,
group=2,
)
async def kukiai(client: Client, message: Message):
msg = message.text
chat_id = message.chat.id
Kuki = requests.get(f"https://kuki-api.tk/api/botname/ownername/message={msg}").json()
Kuki = requests.get(f"https://kuki-api.tk/api/message={msg}").json()
idz = f"{Kuki['reply']}"
await client.send_chat_action(message.chat.id, "typing")
await message.reply_text(idz)
messageprivate = '''
Hi, I'm Spike AI ChatBot
Im bot can talk with you
hit the button for repo
'''
messagegroup = '''
⚡️
'''
@kuki.on_message(filters.command("start"))
async def start(_, message):
self = await kuki.get_me()
busername = self.username
if message.chat.type != "private":
await message.reply_text(messagegroup)
return
else:
buttons = [[InlineKeyboardButton("Support", url="https://t.me/idzeroidsupport"),
]]
await message.reply_text(messageprivate, reply_markup=InlineKeyboardMarkup(buttons))
kuki.run()