dolfies / discord.py-self

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

[BUG] Library crashes trying to import .Account #88

Closed Mehul343 closed 3 years ago

Mehul343 commented 3 years ago

Summary

When I run my bot on heroku I get an error.

Reproduction Steps

I installed discord.py-self and then when I run my bot it gives an error.

Code

Relevant code that shows the bug.
# 
import discord
import asyncio
import time
from time import sleep

print("Start date & time " + time.strftime("%c"))
username=("")
channelid=
ball="ub"
myGlobal=0

class MyClient(discord.Client):
    async def on_message(self, message):        

     if message.author == self.user:
            return

     if (message.channel.id == channelid):
      embeds = message.embeds
      for embed in embeds:
        footer=str(embed.footer)
        rarity=(footer.find)
        description=str(embed.description)
        name=(description.find)

        if (name("**"+ username + "** found a wild") == -1):
            return

        else:

         if (rarity('Common') != -1):
          await message.channel.send("pb")

         if (rarity('Uncommon') != -1):
          await message.channel.send("pb")

         if (rarity('Rare (27') != -1):
          await message.channel.send("gb")

         if (rarity('Super Rare') != -1):
          await message.channel.send("ub")

         if (rarity('Legendary') != -1):
            if (name('Articuno') != -1):
                await message.channel.send(ball)
            elif (name('Moltres') != -1):
                await message.channel.send(ball)
            elif (name('Zapdos') != -1):
                await message.channel.send(ball)
            elif (name('Raikou') != -1):
                await message.channel.send(ball)
            elif (name('Entie') != -1):
                await message.channel.send(ball)
            elif (name('Suicune') != -1):
                await message.channel.send(ball)
            elif (name('Lugia') != -1):
                await message.channel.send(ball)
            elif (name('Ho-oh') != -1):
                await message.channel.send(ball)
            elif (name('Regirock') != -1):
                await message.channel.send(ball)
            elif (name('Regice') != -1):
                await message.channel.send(ball)
            elif (name('Registeel') != -1):
                await message.channel.send(ball)
            elif (name('Kyogre') != -1):
                await message.channel.send(ball)
            elif (name('Groudon') != -1):
                await message.channel.send(ball)
            elif (name('Latias') != -1):
                await message.channel.send(ball)
            elif (name('Latios') != -1):
                await message.channel.send(ball)
            elif (name('Deoxys') != -1):
                await message.channel.send(ball)
            elif (name('Uxie') != -1):
                await message.channel.send(ball)
            elif (name('Mesprit') != -1):
                await message.channel.send(ball)
            elif (name('Azelf') != -1):
                await message.channel.send(ball)
            elif (name('Palkia') != -1):
                await message.channel.send(ball)
            elif (name('Heatran') != -1):
                await message.channel.send(ball)
            elif (name('Regigigas') != -1):
                await message.channel.send(ball)
            elif (name('Cresselia') != -1):
                await message.channel.send(ball)
            elif (name('Cobalion') != -1):
                await message.channel.send(ball)
            elif (name('Terrakion') != -1):
                await message.channel.send(ball)
            elif (name('Virizion') != -1):
                await message.channel.send(ball)
            elif (name('Tornadus') != -1):
                await message.channel.send(ball)
            elif (name('Thundurus') != -1):
                await message.channel.send(ball)
            elif (name('Reshiram') != -1):
                await message.channel.send(ball)
            elif (name('Landorus') != -1):
                await message.channel.send(ball)
            elif (name('Xerneas') != -1):
                await message.channel.send(ball)
            elif (name('Yveltal') != -1):
                await message.channel.send(ball)
            elif (name('Celebi') != -1):
                await message.channel.send(ball)
            elif (name('Zygarde') != -1):
                await message.channel.send(ball)
            else:
                await message.channel.send("mb")

        if (rarity('Shiny (Full-odds') != -1):
         await message.channel.send("mb")

        if (rarity('Shiny') != -1):
         await message.channel.send("mb")

        global myGlobal
        myGlobal += 1
        print (("Current date & time |" + time.strftime("%c")) + "| Encounters : " + (str(myGlobal)))

        sleep(8.25)
        await message.channel.send(";p")

client = MyClient()
client.run('')```

## Expected Results
##### My bot should run properly

## Actual Results
##### it is giving an error

## System Info
##### Run `python -m discord --version` and paste the information below.

Paste here


Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.9/runpy.py", line 188, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/app/.heroku/python/lib/python3.9/runpy.py", line 147, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/app/.heroku/python/lib/python3.9/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/app/.heroku/python/lib/python3.9/site-packages/discord/__init__.py", line 61, in <module>
    from .accounts import Account
ModuleNotFoundError: No module named 'discord.accounts'

## Checklist
##### Let's make sure this issue is valid!
<!--- To check something, put an x in the box, like this: [x] -->
- [x ] I am using the latest released version of the library.
- [ x] I am using a user token.
- [x ] I have shown the entire traceback and exception information.
- [ x] I've removed my token from any code.

## Additional Information
##### Put any extra context, weird configurations, or other important info here.
dolfies commented 3 years ago

You haven't filled out version info. What version are you using? This could only possibly happen on the development branch, which is, well, for development.

Mehul343 commented 3 years ago

You haven't filled out version info. What version are you using? This could only possibly happen on the development branch, which is, well, for development.

I was using the default branch which is development. I just tried the master branch and it is giving out a whole different error.

dolfies commented 3 years ago

The README very specifically says to not use the master branch.

Please use the v1.x branch or install with pip.