py-cord AttributeError :

I’m using Hybrid Commands to use Prefixed Commands and Application Commands simultaneously within one file.
Obviously, the code that worked well until a few months ago now does not work, but strangely, only the commands that contain Embed in Application Commands do not work.
Below is my code.
Since I’m Korean, there are lots of Korean in code. Please understand.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code># Load Libraries
import discord
from discord.ext import commands
from discord.commands import Option
import random
import asyncio
import time
import math
# Set Token token = '(token)'
# Setting Background Enviroment
intents = discord.Intents.all()
intents.message_content = True
bot = commands.Bot(command_prefix="시로야 ", intents=intents)
# If Bot is ready
#(Bot Ready Output)
#Prefixed Commands
#(No issue found in Prefixed Commands)
#Application Commands(Slash Commands)
#(There's a lot of Application Commands, but I just put a few commans that have issue)
@bot.slash_command(description="시로봇의 핑을 알려줘요!")
async def(ctx):
ping = round((bot.latency) * 1000, 2)
embed = discord.Embed(title=":ping_pong: 퐁!", description=f"지연시간: {ping}ms", color=0xFFFFFF)
embed.set_footer(text="ShiroBot by. AndyKim")
await ctx.respond(embed=embed)
</code>
<code># Load Libraries import discord from discord.ext import commands from discord.commands import Option import random import asyncio import time import math # Set Token token = '(token)' # Setting Background Enviroment intents = discord.Intents.all() intents.message_content = True bot = commands.Bot(command_prefix="시로야 ", intents=intents) # If Bot is ready #(Bot Ready Output) #Prefixed Commands #(No issue found in Prefixed Commands) #Application Commands(Slash Commands) #(There's a lot of Application Commands, but I just put a few commans that have issue) @bot.slash_command(description="시로봇의 핑을 알려줘요!") async def 핑(ctx): ping = round((bot.latency) * 1000, 2) embed = discord.Embed(title=":ping_pong: 퐁!", description=f"지연시간: {ping}ms", color=0xFFFFFF) embed.set_footer(text="ShiroBot by. AndyKim") await ctx.respond(embed=embed) </code>
# Load Libraries
import discord
from discord.ext import commands
from discord.commands import Option
import random
import asyncio
import time
import math
# Set Token token = '(token)'
# Setting Background Enviroment
intents = discord.Intents.all()
intents.message_content = True
bot = commands.Bot(command_prefix="시로야 ", intents=intents)
# If Bot is ready
#(Bot Ready Output)

#Prefixed Commands
#(No issue found in Prefixed Commands)

#Application Commands(Slash Commands)
#(There's a lot of Application Commands, but I just put a few commans that have issue)
@bot.slash_command(description="시로봇의 핑을 알려줘요!")
async def 핑(ctx):
    ping = round((bot.latency) * 1000, 2)
    embed = discord.Embed(title=":ping_pong: 퐁!", description=f"지연시간: {ping}ms", color=0xFFFFFF)
    embed.set_footer(text="ShiroBot by. AndyKim")
    await ctx.respond(embed=embed)

When I run the above code, the following error occurs;

Ignoring exception in command 핑
Traceback (most recent call last):
File “/home/user/diecord-bot-space/.venv/lib/python3.11/site-packages/discord/commands/core.py”, line 131, in wrapped
ret = await coro(arg)
^^^^^^^^^^^^^
File “/home/user/discord-bot-space/.venv/lib/python3.11/site-packages/discord/commands/core.py”, line 1013, in _ivoke
await self.callback(ctx, **kwargs)
File “/home/user/discord-bot-space/Shirobot.py”, line 234, in 핑
embed = discord.Embed(title=”:ping_pong: 퐁!”, description=f”지연시간 : {ping}ms, color=0xFFFFFF”)
^^^^^^^^^^^^
AttributeError: ‘Command’ objecthas no attribute ‘Embed’

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/home/user/discord-bot-space/.venv/lib/python3.11/site-packages/discord/bot.py”, line 1130, in invoke_application_command
await ctx.command.invokee(ctx)
File “/home/user/discord-bot-space/.venv/lib/python3.11/site-packages/dsicord/command/core.py”, line 376, in invoke
await injected(ctx)
File “/home/user/discord-bot-space/.venv/lib/python3.11/site-packages/discord/commands/core.py”, line 139, in wrapped
raise ApplicationCommandInvokeError(exc) from exc
discord,errors,ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: ‘Command’ object has no attribute ‘Embed’

This error has not occurred since I first wrote this code. This error has occurred recently. Have there been any recent Embed-related changes in Py-cord? I would like to know what is causing this error. Thank you in advance for your kind explanation!

  • The code environment I am currently using is Project IDX, an online coding platform developed by Google.
    I’m curious to know what’s causing the error, if there’s a workaround, and if I can still use this code!

If you need more information, please let me know!

New contributor

Andy Kim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật