This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
1
I have message intents enabled in the portal but message.content still isn't working
Post Body
import discord
from random import choice
TOKEN = (Not including this)
intents = discord.Intents.default()
intents.members = True
client = discord.Client(intents=intents)
#Generates a random answer word
with open('answers.txt','r') as f:
word = choice(f.readlines())
#Prints when Bot is online
@client.event
async def on_ready():
print('Logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
username = str(message.author).split('#')[0]
user_message = str(message.content)
print(username,user_message)
#Skip if its the bot's own message
if message.author == client.user:
return
if message.content.startswith('hi'):
await message.channel.send(f'Hi {username}, you said {user_message}')
return
#Runs Bot
client.run(TOKEN)
Author
Account Strength
100%
Account Age
5 years
Verified Email
Yes
Verified Flair
No
Total Karma
16,804
Link Karma
2,561
Comment Karma
7,573
Profile updated: 2 days ago
Posts updated: 8 months ago
Subreddit
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/discordbot/...