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 162 forks source link

renamed version or Selfcord 'no module named discord' #190

Closed Salt69 closed 2 years ago

Salt69 commented 2 years ago

Summary

It is not detecting discord as a module

Reproduction Steps

I'm using repl.it I downloaded the package via the shell using 'pip install git+https://github.com/dolfies/discord.py-self.git@renamed'

Code

import time
import selfcord as discord
import requests
from funcs import findKakera,findTitle, LogClaim
import asyncio

client = commands.Bot(command_prefix='>', self_bot = True)
msg = None

@tasks.loop(count = 1)
async def wait_until_ready():
    await client.wait_until_ready()
    print(f"Logged in as {client.user.name}")
    RollChannel = client.get_channel(817971536623042563)

    while True:
        def check(m):
            return (m.channel.id == RollChannel.id and m.author.id == 432610292342587392)
        await RollChannel.send("$wa") # This claim is repeated everytime the loop is redone
        msg = await client.wait_for("message", check=check)

        if check(msg):
            if msg.content.startswith((f"**{client.user.name}**, the roulette")) and msg.author.id == 432610292342587392:
                counter = 0
                timer = ""
                for i in range(len(msg.content)):
                    if msg.content[i].isdigit():
                        counter += 1
                        if counter >= 3:
                            timer += msg.content[i]
                            minutestogo = int(timer)
                print('Finished All Commands Until Cooldown')
                print(f'Waiting {minutestogo} minutes or {(minutestogo + 1) * 60} seconds until next send')
                time.sleep((minutestogo + 1) * 60)
            elif msg.embeds:
                def check(m):
                    return m.content.startswith(f"💖 **{client.user.name}")

                Kakera = findKakera(msg.embeds[0].description)
                if Kakera > 500:
                    await msg.add_reaction('✔')
                    try:
                        msg = await client.wait_for('message', timeout=10.0, check=check)
                    except asyncio.TimeoutError:
                        pass
                    else:
                        await LogClaim(client, 
                            f'<@707433256886206365> Claimed A Waifu\n *Waifu Name*: **{msg.embeds[0].author.name}**\n*Waifu Anime*: **{findTitle(msg.embeds[0].description)}**\n *Kakera*: **{Kakera}**')
                        await asyncio.sleep(3)
                elif msg.content.startswith('⚠️ You can only roll with slash commands: type / to see the list (example: type /wa instead of $wa) ⚠️'):
                    time.sleep(31 * 60)
wait_until_ready.start()
client.run("my token was here")

Expected Results

It's supposed to import discord as selfcord

Actual Results

error message

System Information

Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 185, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "/usr/lib/python3.8/runpy.py", line 144, in _get_module_details return _get_module_details(pkg_main_name, error) File "/usr/lib/python3.8/runpy.py", line 111, in _get_module_details import(pkg_name) File "/opt/virtualenvs/python3/lib/python3.8/site-packages/selfcord/init.py", line 25, in from .client import Client File "/opt/virtualenvs/python3/lib/python3.8/site-packages/selfcord/client.py", line 35, in from .user import User, Profile, Note File "/opt/virtualenvs/python3/lib/python3.8/site-packages/selfcord/user.py", line 27, in import discord.abc ModuleNotFoundError: No module named 'discord'

Checklist

Additional Information

I don't see selfcord in the 'packages' tab I only see flask as the sole package

BridgeSenseDev commented 2 years ago

Uninstalling it then doing pip install discord.py-self worked for me

dolfies commented 2 years ago

Should be fixed.