디스코드 봇으로 공지/규칙용 임베드를 생성하는 슬래시 명령을 만들다가 터미널에 'ERROR: unknown command "imstall"' 오류가 발생했습니다.
원인은 pip 설치 명령 오타(imstall → install)이며, 'pip install <패키지>'로 수정해 재실행하면 해결되고, 봇 권한·intents 및 app_commands(슬래시 명령) 동기화도 함께 확인하세요.
디스코드 봇으로 공지/규칙용 임베드를 생성하는 슬래시 명령을 만들다가 터미널에 'ERROR: unknown command "imstall"' 오류가 발생했습니다.
원인은 pip 설치 명령 오타(imstall → install)이며, 'pip install <패키지>'로 수정해 재실행하면 해결되고, 봇 권한·intents 및 app_commands(슬래시 명령) 동기화도 함께 확인하세요.
import discord from discord.ext import commands from discord import app_commands
TOKEN = "봇토큰"
intents = discord.Intents.default()
bot = commands.Bot(command_prefix="!", intents=intents)
@bot.event async def on_ready(): try: synced = await bot.tree.sync() print(f"슬래시 명령어 {len(synced)}개 동기화 완료") except Exception as e: print(e)
print(f"{bot.user} 로그인 완료")
@bot.tree.command(name="임베드생성", description="임베드를 생성합니다.") @app_commands.describe( 채널="보낼 채널", 제목="임베드 제목", 내용="임베드 내용", 색상="red, blue, green, gold, purple", 이미지="이미지 URL (선택)", 버튼이름="버튼 이름 (선택)", 버튼링크="버튼 링크 (선택)" ) async def 임베드생성( interaction: discord.Interaction, 채널: discord.TextChannel, 제목: str, 내용: str, 색상: str, 이미지: str = None, 버튼이름: str = None, 버튼링크: str = None ):
색상목록 = {
"red": discord.Color.red(),
"blue": discord.Color.blue(),
"green": discord.Color.green(),
"gold": discord.Color.gold(),
"purple": discord.Color.purple()
}
embed = discord.Embed(
title=제목,
description=내용,
color=색상목록.get(색상.lower(), discord.Color.blurple())
)
if 이미지:
embed.set_image(url=이미지)
view = None
if 버튼이름 and 버튼링크:
view = discord.ui.View()
button = discord.ui.Button(
label=버튼이름,
url=버튼링크
)
view.add_item(button)
await 채널.send(embed=embed, view=view)
await interaction.response.send_message(
f"✅ {채널.mention} 채널에 임베드를 전송했습니다.",
ephemeral=True
)
bot.run(TOKEN)
이 코드로 했어요
에러 메세지 주세요
ERROR: unknown command "imstall" - maybe you meant "install"
이거 맞나요?
터미널 뭐에서 해봤는데 이거떠서
pip install을 imstall로 오타치신것 같네요
아 그렇군요 넵 감사합니다 ㅜㅜ