Skip to content

Commit

Permalink
add intents fixes #7
Browse files Browse the repository at this point in the history
In order for the bot to read message content
it needs the privileged intent called MESSAGE_CONTENT
https://discord.com/developers/docs/topics/gateway#privileged-intents
  • Loading branch information
abe-101 committed Oct 26, 2022
1 parent 806297f commit ebbae44
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@



bot = discord.Client()
intents = discord.Intents.default()
intents.message_content = True


bot = discord.Client(intents=intents)
baseUrl = f"https://api.telegram.org/bot{config.TELEGRAM_BOT_TOKEN}"


Expand Down Expand Up @@ -199,7 +203,7 @@ async def on_message(message):

#Run the bot using the user token
try:
bot.run(config.USER_DISCORD_TOKEN, bot=False)
bot.run(config.USER_DISCORD_TOKEN)
except RuntimeError:
print("\n\nPlease Wait ...\nShutting down the bot ... \n")
quit()
Expand Down

0 comments on commit ebbae44

Please sign in to comment.