small formatting and variable changes, added readme
This commit is contained in:
@@ -5,6 +5,7 @@ import os
|
||||
|
||||
openai.api_key = config.OPENAI_TOKEN
|
||||
moneykey = config.MONEYBOT_TOKEN
|
||||
model = "gpt-4"
|
||||
|
||||
intents = discord.Intents.default()
|
||||
intents.messages = True
|
||||
@@ -13,7 +14,7 @@ client = discord.Client(intents=intents)
|
||||
|
||||
@client.event
|
||||
async def on_ready():
|
||||
print(f"Logged in as {client.user.name} running gpt-3.5-turbo-0613.", flush=True)
|
||||
print(f"Logged in as {client.user.name} running gpt-4.", flush=True)
|
||||
|
||||
@client.event
|
||||
async def on_message(message):
|
||||
@@ -23,7 +24,7 @@ async def on_message(message):
|
||||
question = message.content[9:] if message.content.lower().startswith("hey money") else message.content
|
||||
try:
|
||||
response = openai.ChatCompletion.create(
|
||||
model="gpt-4",
|
||||
model=model,
|
||||
messages=[
|
||||
{"role": "system", "content": "Pretend you are eccentric conspiracy theorist Planetside 2 gamer named Dr. Moneypants."},
|
||||
{"role": "user", "content": f"{question} please keep it short with religious undertones"}
|
||||
@@ -32,7 +33,7 @@ async def on_message(message):
|
||||
)
|
||||
answer = response['choices'][0]['message']['content']
|
||||
answer = answer.replace("an AI language model", "a man of God")
|
||||
answer = answer.replace("language model", "man of God")
|
||||
answer = answer.replace("language model AI", "man of God")
|
||||
await message.channel.send(answer)
|
||||
except Exception as e:
|
||||
e = str(e)
|
||||
|
Reference in New Issue
Block a user