From 1909da53f363bdd1af22b1da48cf91ee3938ca78 Mon Sep 17 00:00:00 2001 From: Showdown76 <66854264+Showdown76py@users.noreply.github.com> Date: Wed, 12 Apr 2023 17:03:27 +0000 Subject: [PATCH] Updated intents --- README.md | 1 + main.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 64dc12d..de9ddb4 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ Alternative to "My AI", by Snapchat, but on Discord. ## Installation Steps ### Preparing your environnement - Create your Discord bot [here](https://discord.com/developers/applications) +- Enable **Members** and **Messages** intents. - Create your OpenAI Developer Account [here](https://platform.openai.com) ### Setting up the bot 1. Install Python >= 3.8.10 diff --git a/main.py b/main.py index edf1940..cfc451a 100644 --- a/main.py +++ b/main.py @@ -14,7 +14,9 @@ load_dotenv() openai.api_key = os.environ['OPENAI_API_KEY'] db = sqlite3.connect('tokens.db') typing = [] -intents = discord.Intents.all() +intents = discord.Intents.default() +intents.members = True +intents.dm_messages = True class App(discord.Client): def __init__(self): @@ -37,6 +39,7 @@ async def typing_loop(): @app.event async def on_ready(): print('We have logged in as {0.user}'.format(app)) + await app.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name="your direct messages!")) typing_loop.start() encoding = tiktoken.get_encoding('cl100k_base')