Update main.py

This commit is contained in:
Showdown76 2023-04-12 19:09:27 +02:00 committed by GitHub
parent 1909da53f3
commit c15d4d7f52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 2 deletions

View File

@ -50,7 +50,6 @@ def num_tokens_from_string(string: str) -> int:
@app.event
async def on_message(message: discord.Message):
print('msg received')
if not isinstance(message.channel, discord.DMChannel): return
if message.author.id == app.user.id: return
try:
@ -85,7 +84,6 @@ async def on_message(message: discord.Message):
for arg in arguments.keys(): bprompt = bprompt.replace(f'|{arg}|', arguments[arg])
previous_tokens = 200+len(bprompt)+message_token_usage
print(bprompt)
# (message_id, user_id, content, token, role, timestamp)
# order by timestamp (most recent to least recent)
usable_messages = []