Discord 채널 설정
OpenClaw와 Discord를 연동하여 서버에서 AI 어시스턴트를 사용하는 방법을 안내합니다.
개요
Discord 채널은 다음을 지원합니다:
- 슬래시 커맨드 (
/ask,/help) - 멘션으로 봇 호출 (
@BotName) - 역할 기반 접근 제어
- 스레드 대화
- 음성 채널 텍스트 지원
1단계: Discord 애플리케이션 생성
- Discord Developer Portal 접속
- New Application 클릭
- 앱 이름 입력 후 Create
- Bot 탭 → Add Bot 클릭
- Token 복사 (한 번만 표시됨!)
봇 권한 설정
Bot 탭에서 다음 권한 활성화:
Send MessagesRead Message HistoryUse Slash CommandsEmbed Links
2단계: 서버에 봇 초대
OAuth2 탭 → URL Generator:
- Scopes:
bot,applications.commands - Bot Permissions: 필요한 권한 선택
생성된 URL로 봇을 서버에 초대합니다.
3단계: OpenClaw 설정
{
"channels": {
"discord": {
"enabled": true,
"botToken": "MTI234567890ABCDEFGHIJKLMNO",
"guildId": "1234567890123456789",
"commandPrefix": "/",
"adminRoleIds": ["12345678901234567890"]
}
}
}
# CLI로 설정
openclaw config set channels.discord.enabled true
openclaw config set channels.discord.botToken "YOUR_BOT_TOKEN"
openclaw config set channels.discord.guildId "YOUR_SERVER_ID"
4단계: 슬래시 커맨드 등록
# 커맨드 등록
openclaw discord register-commands
# 특정 서버에만 등록 (개발용, 즉시 반영)
openclaw discord register-commands --guild YOUR_GUILD_ID
고급 설정
채널 제한
특정 채널에서만 봇 응답:
{
"channels": {
"discord": {
"allowedChannelIds": ["111222333444555666", "777888999000111222"],
"ignoredChannelIds": ["999888777666555444"]
}
}
}
역할 기반 접근 제어
{
"channels": {
"discord": {
"accessControl": {
"allowedRoleIds": ["ADMIN_ROLE_ID", "MOD_ROLE_ID"],
"deniedRoleIds": ["MUTED_ROLE_ID"]
}
}
}
}
응답 형식 설정
{
"channels": {
"discord": {
"responseFormat": {
"useEmbeds": true,
"embedColor": "#5865F2",
"showTimestamp": true
}
}
}
}
트러블슈팅
"401 Unauthorized" 오류
봇 토큰을 재발급하고 업데이트:
- Developer Portal → Bot → Reset Token
openclaw config set channels.discord.botToken "NEW_TOKEN"openclaw gateway restart
슬래시 커맨드가 보이지 않음
# 커맨드 재등록
openclaw discord register-commands --force
반영까지 최대 1시간 소요될 수 있습니다 (글로벌 등록의 경우).
참고: