Updated intents

This commit is contained in:
Showdown76 2023-04-12 17:03:27 +00:00
parent b04a8e843a
commit 1909da53f3
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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')