python3 -m pip install discord.py
- copy the script into a file (e.g. initialize.py)
- run
python3 initialize.py
- quit once you see "We have logged in as <user#1234>"
Last active
April 4, 2024 08:49
-
-
Save judge2020/4a996a26058562bb4bf38b5c679528d2 to your computer and use it in GitHub Desktop.
Initialize Discord bot in Python 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
import getpass | |
intents = discord.Intents.default() | |
intents.message_content = True | |
client = discord.Client(intents=intents) | |
@client.event | |
async def on_ready(): | |
print("We have logged in as {0.user}".format(client)) | |
client.run(getpass.getpass(prompt='Discord Bot Token: ', stream=None)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment