DiscordSRV

Tdb (토론 | 기여)님의 2025년 7월 23일 (수) 02:09 판 (문자열 찾아 바꾸기 - "분류:마인크래프트" 문자열을 "분류:마인크래프트/플러그인" 문자열로)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

DiscordSRV마인크래프트 서버와 디스코드 서버를 연동하는 플러그인이다. 게임 내 채팅과 디스코드 채널을 실시간으로 동기화하고, 다양한 서버 이벤트를 디스코드로 전송할 수 있다.

주요 기능

채팅 연동

  • 양방향 채팅 동기화
  • 다중 채널 지원
  • 채팅 포맷 커스터마이징
  • 멘션 및 이모지 지원

계정 연동

  • 마인크래프트-디스코드 계정 연결
  • 역할 동기화
  • 권한 그룹 연동
  • 닉네임 동기화

알림 시스템

  • 서버 시작/종료 알림
  • 플레이어 입장/퇴장 메시지
  • 업적 달성 알림
  • 죽음 메시지

콘솔 연동

  • 디스코드에서 콘솔 명령어 실행
  • 콘솔 로그 실시간 전송
  • 원격 서버 관리

명령어

명령어 설명 권한
/discord link 계정 연동 코드 생성 discordsrv.link
/discord unlink 계정 연동 해제 discordsrv.unlink
/discord linked 연동된 계정 확인 discordsrv.linked
/discord reload 설정 리로드 discordsrv.reload
/discord debug 디버그 모드 토글 discordsrv.debug
/discord broadcast <메시지> 디스코드로 방송 discordsrv.broadcast

봇 설정

디스코드 봇 생성

# Discord Developer Portal에서 봇 생성 후
# config.yml에 토큰 입력

BotToken: "YOUR_BOT_TOKEN_HERE"

# 필요한 봇 권한:
# - 메시지 읽기/쓰기
# - 멤버 목록 보기
# - 역할 관리
# - 웹훅 관리
# - 이모지 사용

채널 설정

# 채널 ID 설정
Channels: {"global": "000000000000000000"}

# 다중 채널 설정
Channels: {
  "global": "111111111111111111",
  "admin": "222222222222222222",
  "trade": "333333333333333333"
}

# 콘솔 채널
DiscordConsoleChannelId: "444444444444444444"

메시지 포맷

게임 → 디스코드

# Minecraft -> 디스코드 메시지 포맷
DiscordChatChannelPrefixRequiredToProcessMessage: ""
DiscordChatChannelFormat: "**%primarygroup%** %displayname% » %message%"

# 플레이어 입장/퇴장
DiscordChatChannelJoinMessage: ":arrow_right: **%displayname%** 님이 서버에 접속했습니다"
DiscordChatChannelLeaveMessage: ":arrow_left: **%displayname%** 님이 서버를 떠났습니다"

# 업적 메시지
DiscordChatChannelAchievementMessage: ":medal: **%displayname%** 님이 **%achievement%** 업적을 달성했습니다!"

디스코드 → 게임

# 디스코드 -> Minecraft 메시지 포맷
MinecraftChatChannelFormat: "&7[Discord] &f%toprole% %username% &7» &f%message%"

# 역할별 색상
DiscordChatChannelRoleAliases: {
  "Admin": "&c[관리자]",
  "Moderator": "&9[스태프]",
  "VIP": "&6[VIP]"
}

계정 연동 시스템

연동 설정

# 계정 연동 설정
MinecraftDiscordAccountLinkingEnabled: true

# 연동 시 역할 부여
MinecraftDiscordAccountLinkedRoleNameToAddUserTo: "Verified"

# 연동 필수 여부
MinecraftDiscordAccountLinkingRequiredToJoin: false
MinecraftDiscordAccountLinkingKickMessage: "&c계정 연동이 필요합니다. /discord link"

권한 동기화

# 그룹-역할 동기화
GroupRoleSynchronizationEnabled: true

# 그룹 매핑
GroupRoleSynchronizationRoleMapping: {
  "Admin": "000000000000000000",
  "Moderator": "111111111111111111",
  "VIP": "222222222222222222",
  "Member": "333333333333333333"
}

# 단방향/양방향 동기화
GroupRoleSynchronizationOneWay: false

고급 기능

웹훅 설정

# 웹훅을 통한 메시지 전송
DiscordChatChannelWebhookEnabled: true

# 플레이어 머리 아바타 사용
DiscordChatChannelAvatarEnabled: true
DiscordChatChannelAvatarUrl: "https://mc-heads.net/avatar/{player}/{size}.png"

음성 채널 연동

# 음성 채널 모듈
VoiceEnabled: true

# 근접 음성 채팅
VoiceProximityEnabled: true
VoiceProximityRadius: 50

# 음성 채널 자동 이동
VoiceMoveToAfk: true
VoiceAfkChannelId: "555555555555555555"

플레이스홀더 지원

# PlaceholderAPI 변수 사용
DiscordChatChannelFormat: "**%vault_prefix%** %displayname% » %message%"

# 상태 메시지에 사용
DiscordGameStatus: "온라인: %playercount%/%maxplayers%"

# 토픽 업데이트
ChannelTopicUpdaterChannelTopicsFormat: {
  "global": "마인크래프트 채팅 | 온라인: %playercount%/%maxplayers% | TPS: %tps%"
}

보안 설정

# 콘솔 명령어 제한
DiscordConsoleChannelBlacklistedCommands: [
  "op",
  "deop", 
  "stop",
  "restart"
]

# 역할별 콘솔 접근
DiscordConsoleChannelRequiredRoleIds: ["999999999999999999"]

# 메시지 필터링
DiscordChatChannelBlockedWords: ["욕설1", "욕설2"]

이벤트 전송

서버 이벤트

# 서버 시작/종료
DiscordChatChannelServerStartupMessage: ":white_check_mark: **서버가 시작되었습니다!**"
DiscordChatChannelServerShutdownMessage: ":octagonal_sign: **서버가 종료되었습니다!**"

# 플레이어 이벤트
PlayerDeathMessages: true
PlayerAdvancementMessages: true
PlayerFirstJoinMessages: true

커스텀 이벤트

# alerts.yml
Alerts:
  - Trigger: "PlayerDeath"
    Channel: "alerts"
    Message: ":skull: **%player%** 님이 사망했습니다: %deathmessage%"
    
  - Trigger: "PlayerCommand"
    Channel: "admin-log"
    Message: ":keyboard: **%player%** 실행: `%command%`"

임베드 메시지

# 임베드 메시지 설정
DiscordChatChannelEmbedEnabled: true

# 임베드 설정
Embed:
  Enabled: true
  Color: "#00FF00"
  Author:
    Name: "%displayname%"
    Url: ""
    ImageUrl: "https://mc-heads.net/avatar/{player}/100.png"
  ThumbnailUrl: ""
  Title:
    Text: ""
    Url: ""
  Description: "%message%"
  Fields: []
  Footer:
    Text: "서버 시간: %time%"
    IconUrl: ""

문제 해결

  • 봇이 오프라인: 토큰 확인, 인터넷 연결 확인
  • 메시지가 전송되지 않음: 채널 ID 확인, 봇 권한 확인
  • 연동이 안 됨: 방화벽 설정, 플러그인 버전 확인
  • 한글 깨짐: UTF-8 인코딩 설정

성능 최적화

# 성능 관련 설정
ChannelTopicUpdaterRateInMinutes: 5  # 토픽 업데이트 주기
DiscordChatChannelTranslateMentions: false  # 멘션 변환 비활성화
CachePoolSize: 10  # 캐시 풀 크기

활용 예시

  • 커뮤니티 관리: 게임과 디스코드 통합 관리
  • 이벤트 공지: 중요 공지사항 양방향 전달
  • 스태프 관리: 콘솔 원격 접속, 로그 모니터링
  • 거래 채널: 거래 전용 채팅 채널 운영
  • 신고 시스템: 디스코드를 통한 신고 접수