import requests
import discord
from discord.ext import commands
On line 3 where I do import commands, it says 'Unresolved Reference Commands'
I am really confused and would appreciate some help :)
Thanks
Related
I am trying to run my bot currently and I keep running into the error “module 'discord' has no attribute 'bot'” and will not let me start my bot.
Here is my code:
import os
os.system("pip install py-cord")
import discord
import time
import requests
import datetime
from discord.ext import commands
from discord.utils import get from discord.ext import tasks
from discord.ext.commands import Bot
bot = discord.Bot()
#bot.event
async def on_ready():
print(f"WORKING AS {client.user}"
# commands were removed due to it not letting me post the question but the code shouldn’t be a issue with the bot. It is slash commands. I will leave the beginning of the code below.
#bot.slash_command(description="Unlock the chat.")
#commands.has_permissions(manage_channels = True)
# code was here
bot.run(mytoken)
I’ve already tried changing it from bot to client with no luck. I also already tried the specific version being 2b1. I want to use slash commands with the bot and client says there is no attribute slash commands.I do not think it’s something to do with the lower portion of the code, it’s something to do with the top of the code if you can help, please and thank you.
Your code looks perfectly fine.
However, this may be a library issue, and you're installing libraries in code (see below). If you accidentally installed discord.py, it may be causing this issue.
In the console do the following:
pip uninstall discord.py
This will uninstall discord.py
Then install the proper pycord version:
pip install -U py-cord==2.4.0
Why you want to do this manually
The reason you want to do this manually is that installing libraries in code is not supported by PIP. See more here.
I was making a linkedin clone following Clever programmer's video. In their video they Imported firebase using import firebase from "firebase"
But I can't import firebase from firebase. I can only import folders in firebase eg: auth, app
Also I have the Import cost extension installed. It detects firebase/auth, firebase/firestore
kind of imports but it doesn't detect import firebase from firebase
How can I solve this problem. Any help will be much appreciated. I'm stuck for 5 days now.
I am facing one app crash issue in ie11. App is working fine with all browsers but IE.
on some post I found to uncomment the following lines in polyfills.ts
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';
After un-commenting these lines application is working on IE 11.0.38 (KB203621).
But it is still crashing on IE 11.0.96 (KB4040685). Browser itself stops working while trying to load the app.
If anybody have faced this kind of issue before, please provide your valuable suggestions to resolve this issue.
Thanks & Regards,
Most ES6 features are not supported in IE 11.
take a look at this to get an idea https://kangax.github.io/compat-table/es6/
I have been trying to use the android web driver but the eclipse IDE can't find the class definitions for the following set of imports
import org.openqa.selenium.android;
import org.openqa.selenium.android;
i have already followed the procedure as specified in the following link
https://code.google.com/p/selenium/wiki/AndroidDriver
but still i cant import these two classes
so anyone with some suggestions please help me out, thanks in advance
Use
import org.openqa.selenium.android.*;
The classes are within package org.openqa.selenium.android
It looks like:
from BeautifulSoup.bs4 import BeautifulSoup
and file structure is /BeautifulSoup/bs4/(everything in this folder)
The "builder" and "dammit" files seem to import fine, but I keep getting an error message for element.py:
ImportError: No module named bs4.element
Could anyone shed some light upon this? Thanks!
UPDATE:
Got rid of the BeautifulSoup outer folder and then from bs4 import BeautifulSoup worked fine. Thanks for all the feedback :)