Skip to content

Commit

Permalink
Luna user identification
Browse files Browse the repository at this point in the history
  • Loading branch information
TheHamkerCat committed May 16, 2021
1 parent 9af128a commit ef4cba4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions luna.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
mode = None


async def getresp(query):
luna = await arq.luna(query)
async def getresp(query: str, user_id: int):
luna = await arq.luna(query, user_id)
response = luna.result
return response

Expand Down Expand Up @@ -63,7 +63,7 @@ async def chat(_, message):
if len(query) > 50:
return
try:
res = await getresp(query)
res = await getresp(query, message.from_user.id if message.from_user else 0)
await asyncio.sleep(1)
except Exception as e:
res = str(e)
Expand All @@ -77,7 +77,7 @@ async def chat(_, message):
if re.search("[.|\n]{0,}[l|L][u|U][n|N][a|A][.|\n]{0,}", query):
await luna.send_chat_action(message.chat.id, "typing")
try:
res = await getresp(query)
res = await getresp(query, message.from_user.id if message.from_user else 0)
await asyncio.sleep(1)
except Exception as e:
res = str(e)
Expand All @@ -99,7 +99,7 @@ async def chatpm(_, message):
if len(query) > 50:
return
try:
res = await getresp(query)
res = await getresp(query, message.from_user.id if message.from_user else 0)
await asyncio.sleep(1)
except Exception as e:
res = str(e)
Expand Down

0 comments on commit ef4cba4

Please sign in to comment.