Falyrion / Loot-Bot

A discord bot to check for available content on Twitch Prime Gaming and posting it in the discord chat
MIT License
13 stars 4 forks source link

Missing Intents #2

Closed xTr07a closed 3 months ago

xTr07a commented 1 year ago

The Bot can't login because intents are missing.

Falyrion commented 1 year ago

Can you specify this further? I get no errors with the code.

AlexandrePereiraDaCosta commented 1 year ago

Think I have a similar error, when running "docker run -it twitch_prime_bot", the terminal display the following error:

Traceback (most recent call last): File "//discord_bot.py", line 55, in client = TwitchLootBot() TypeError: Client.init() missing 1 required keyword-only argument: 'intents'

Falyrion commented 1 year ago

I see the problem. Running the bot without docker works fine, but Intents are needed with docker. That's some change in the API that happened.

To solve some Intents have to be added to line 55 in /bot/discord_bot.py and also to the application settings of the bot on the discord developer website. It goes something like this:

client = TwitchLootBot(intents=discord.Intents().all())

I have not yet had the time to figure it out and fix the problem. The bot should also not need all intents, only read-chat and write-chat.

riggerbh commented 1 year ago

The file "discord_bot.py" in the Folder "Loot-Bot-Main/bot"

I changed this (start line 55 at the bottom):

client = TwitchLootBot()
client.run(TOKEN)

To this:

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

client = TwitchLootBot(intents=intents)

client.run(TOKEN)

It's running for me. I had to set the Privileged Gateway Intents to "ON" in the Discord applications for the bot before I ran this.

Falyrion commented 3 months ago

Maintenance of this project is currently on halt. Many web scraping methods might no longer work due to changes in the target websites. Furthermore, discord.py is no longer maintained by its developers, therefor a rewrite of this project using pycord would be necessary.