Skip to content

Commit

Permalink
Update bot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ilynivin authored Jun 1, 2023
1 parent 67414c1 commit dbf97f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
bot = commands.Bot(command_prefix='!', intents=intents);


openai.api_key = os.getenv('apikey')
openai.api_key = os.getenv('apikey') # Change api key in env



@bot.event
async def on_ready():
await bot.change_presence(activity=discord.Streaming(name='OpenApi', url='https://www.twitch.tv/hoodie4546'))
await bot.change_presence(activity=discord.Streaming(name='OpenApi', url='yourtwitchchannel')) # If you dont want this you can remove it
print(f'Bot Status is Spiced up ! {bot.user.name}')
print(f"{bot.user.name} is Ready For Ai Chating!")
print(f"{bot.user.name} is connected to Open Ai Api!")
Expand All @@ -28,7 +28,7 @@ async def on_ready():

@bot.event
async def on_message(message):
if message.channel.id == 1113365746219749477 and not message.author.bot:
if message.channel.id == 'Your Discord Channel id' and not message.author.bot:
response = openai.Completion.create(
engine='text-davinci-003',
prompt=message.content,
Expand All @@ -38,4 +38,4 @@ async def on_message(message):
await message.channel.send(response.choices[0].text)


bot.run(os.getenv('Token'))
bot.run(os.getenv('Token'))

0 comments on commit dbf97f3

Please sign in to comment.