Skip to content

Commit

Permalink
docs: clarify intents in example (#1516)
Browse files Browse the repository at this point in the history
  • Loading branch information
i0bs authored Aug 7, 2023
1 parent 2184b71 commit 8da4f25
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/src/Guides/90 Example.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ logging.basicConfig()
cls_log = logging.getLogger("MyLogger")
cls_log.setLevel(logging.DEBUG)

bot = Client(intents=Intents.DEFAULT, sync_interactions=True, asyncio_debug=True, logger=cls_log)
bot = Client(
intents=Intents.DEFAULT | Intents.MESSAGE_CONTENT,
sync_interactions=True,
asyncio_debug=True,
logger=cls_log
)
prefixed_commands.setup(bot)


Expand All @@ -30,6 +35,8 @@ async def on_guild_create(event):
print(f"guild created : {event.guild.name}")


# Message content is a privileged intent.
# Ensure you have message content enabled in the Developer Portal for this to work.
@listen()
async def on_message_create(event):
print(f"message received: {event.message.content}")
Expand Down

0 comments on commit 8da4f25

Please sign in to comment.