dolfies / discord.py-self

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

Unable to run disord.py-self library #642

Closed AloW0304 closed 6 months ago

AloW0304 commented 6 months ago

Summary

When running any code with the library discord.py-self I get an error: ImportError: cannot import name 'handle_message_parameters' from 'discord.http'

Reproduction Steps

Whenever I run code using the discord.py-self library I get the same error above.

Code

from discord.ext import commands
import discord

bot = commands.Bot(command_prefix=';', self_bot=True, help_command=None)
TARGET_CHANNEL_ID = channel id  
@bot.event
async def on_message(message):
    if message.channel.id == TARGET_CHANNEL_ID:
        # Checks the message
        if message.author != bot.user:
            print(f"Message Content: {message.content}")
            print(f"Message Author ID: {message.author.id}")
            print(f"Message Channel ID: {message.channel.id}")
            print(f"Message Guild ID: {message.guild.id if message.guild else None}")
            print(f"Message Timestamp: {message.created_at}")
            print("-----")

            if message.components:
                for action_row in message.components:
                    for component in action_row.children:
                        if isinstance(component, discord.Button):
                            if component.label is None and component.emoji is not None:
                                # Handle emoji buttons
                                print(f"Emoji: {component.emoji}")
                            else:

                                print(f"Button Label: {component.label}")
                            print(f"Button Style: {component.style}")
                            print(f"Button Custom ID: {component.custom_id}")
                            print(f"Button URL: {component.url}")
                            print("-----")

bot.run(my token)

Expected Results

I should get the expected output of information about the message that is sent in the channel

Actual Results

However I get the error message below:

Traceback (most recent call last): File "/Users//Downloads/main.py", line 3, in from discord.ext import commands File "/Users//.pyenv/versions/3.8.12/lib/python3.8/site-packages/discord/init.py", line 25, in from .client import Client File "/Users//.pyenv/versions/3.8.12/lib/python3.8/site-packages/discord/client.py", line 53, in from .webhook import Webhook File "/Users//.pyenv/versions/3.8.12/lib/python3.8/site-packages/discord/webhook/init.py", line 12, in from .async import * File "/Users/____/.pyenv/versions/3.8.12/lib/python3.8/site-packages/discord/webhook/async_.py", line 46, in from ..http import Route, handle_message_parameters, json_or_text, HTTPClient ImportError: cannot import name 'handle_messageparameters' from 'discord.http' (/Users/____/.pyenv/versions/3.8.12/lib/python3.8/site-packages/discord/http.py) @ PokeGrinder-1.2 % /Users//.pyenv/versions/3.8.12/bin/python "/Users//Desktop/Python Learning/ CptSKS grinding/Finding out message attributes.py" Traceback (most recent call last): File "/Users//Desktop/Python Learning/CptSKS grinding/Finding out message attributes.py", line 1, in from discord.ext import commands File "/Users//.pyenv/versions/3.8.12/lib/python3.8/site-packages/discord/init.py", line 25, in from .client import Client File "/Users//.pyenv/versions/3.8.12/lib/python3.8/site-packages/discord/client.py", line 53, in from .webhook import Webhook File "/Users//.pyenv/versions/3.8.12/lib/python3.8/site-packages/discord/webhook/init.py", line 12, in from .async import * File "/Users/____/.pyenv/versions/3.8.12/lib/python3.8/site-packages/discord/webhook/async_.py", line 46, in from ..http import Route, handle_message_parameters, json_or_text, HTTPClient ImportError: cannot import name 'handle_messageparameters' from 'discord.http' (/Users/____/.pyenv/versions/3.8.12/lib/python3.8/site-packages/discord/http.py)

System Information

Checklist

Additional Information

No response

AloW0304 commented 6 months ago

whoops, read previous threads I have solved the issue