I recently started to learn python by making bots for Discord. I can't run 'from discord.ext import commands'. Can you guys help, please? I succeeded in importing discord.py from cmd, but I don't know how to import discord.ext. I don't know if I'm importing discord.ext
Here is the Code: (This code is not all of the code.)
import discord
from discord.ext.commands import Bot
from discord.ext import commands
import os
import random
import openpyxl
from openpyxl import load_workbook
import time
import sys
import asyncio
import datetime
TOKEN = os.environ['BOT_TOKEN']
@client.event
async def on_message(message):
if message.author.bot:
return None
if message.content.startswith("!명령어"):
command_list = ["!강화 !도박", "!순위 !내순위" ,"!내레벨", "!노래","!행운의숫자", "!개발자명령어"]
command_msg_list = ["강화를 진행합니다.", "강화 순위를 표시합니다.","내 강화 레벨을 표시합니다.", "★★★추천 노래를 표시합니다.★★★","1부터 99까지 숫자 중 행운의 숫자를 골라줍니다.","개발자를 위한 명령어들을 표시합니다."]
embed = discord.Embed(title="명령어",color=0x62c1cc)
for i in range(len(command_list)):
embed.add_field(name=command_list[i], value=command_msg_list[i], inline=False)
await message.channel.send(embed=embed)
if message.content.startswith("!개발자명령어"):
command_list = ["!디렉토리표시"]
command_msg_list = ["봇이 실행되고 있는 디렉토리를 표시합니다."]
embed = discord.Embed(title="개발자 명령어",color=0x62c1cc)
for i in range(len(command_list)):
embed.add_field(name=command_list[i], value=command_msg_list[i], inline=False)
await message.channel.send(embed=embed)
python -m discord -vand post the output. - Łukasz Kwiecińskidiscord.py:pip install --upgrade discord.py- idontknow