dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
680 stars 161 forks source link

TypeError: __init__() missing 1 required keyword-only argument: 'intents' #411

Closed kxi0 closed 1 year ago

kxi0 commented 1 year ago

Summary

Gives intents error

Reproduction Steps

Grabbing msgs and sending them to a webhook

Code

import requests
import discord

token = ""
whitelisted_guilds_ids = []

class ppclient(discord.Client):
    async def on_message(message):
        if len(whitelisted_guilds_ids) > 0:
            if message.guild.id not in whitelisted_guilds_ids: return
            requests.post("", 
            json={
                "content": f"{message.guild.name} \n{message.author.name}#{message.author.discriminator}: {message.content} \n-----------",
                "username": "logger",
                })

client = ppclient()
client.run(token)

Expected Results

Send the message to the webhook

Actual Results

File "c:\Users\x2\Downloads\webhook.py", line 17, in client = ppclient() TypeError: init() missing 1 required keyword-only argument: 'intents'

System Information

Checklist

Additional Information

No response

sebkozlo commented 1 year ago

You forgot add self parameter to on_message method.

dolfies commented 1 year ago

This library does not have intents. Therefore, you are not using this library. Chances are you have multiple libraries that use the same namespace installed, or you are not using your venv(s) properly.

Also want to mention that you cannot use requests with discord.py-self as it is blocking.