MCPcopy Index your code
hub / github.com/XiaoMengXinX/Music163bot-Go

github.com/XiaoMengXinX/Music163bot-Go @v2.4.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.4.2 ↗ · + Follow
54 symbols 156 edges 13 files 15 documented · 28%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Music163bot

一个用来下载/分享/搜索网易云歌曲的telegram bot

演示bot:https://t.me/Music163bot

<a href="https://goreportcard.com/report/github.com/XiaoMengXinX/Music163bot-Go/v2">
  <img src="https://img.shields.io/badge/go%20report-A+-brightgreen.svg?style=flat">
</a>
<a href="https://github.com/XiaoMengXinX/Music163bot-Go/releases">
<img src="https://img.shields.io/github/v/release/XiaoMengXinX/Music163bot-Go?include_prereleases&style=flat-square">

✨ 特性

  • 分享链接嗅探
  • inlinebot
  • 歌曲搜索
  • 为歌曲文件添加163key
  • 歌曲快速分享
  • 下载无损flac音频 (需设置网易云VIP账号的MUSIC_U)
  • 动态更新(使用 traefik/yaegi 作为动态扩展框架)

⚙️ 构建

构建前请确保拥有 Go 1.17或更高版本

克隆代码

git clone https://github.com/XiaoMengXinX/Music163bot-Go

使用脚本自动编译 ( 支持 windows 的 bash 环境,例如 git bash )

cd Music163bot-Go
bash build.sh 

# 也可以加入环境变量以交叉编译,如
GOOS=windows GOARCH=amd64 bash build.sh

🛠️ 部署

修改配置文件

打开项目根目录下的 config_example.ini

# 以下为必填项
# 你的 Bot Token
BOT_TOKEN = YOUR_BOT_TOKEN

# 你的网易云 cookie (用于下载无损歌曲)
MUSIC_U = YOUR_MUSIC_U


# 以下为可选项
# 自定义 telegram bot API 地址
BotAPI = https://api.telegram.org

# 设置 bot 管理员 ID, 用 “," 分隔
BotAdmin = 1234,3456

# 是否开启 bot 的 debug 功能
BotDebug = false

# 自定义 sqlite3 数据库文件 (默认为 cache.db)
Database = cache.db

# 设置日志等级 [panic|fatal|error|warn|info|debug|trace] (默认为 info)
LogLevel = info

# 是否开启自动更新 (默认开启), 若设置为 false 相当于 -no-update 参数
AutoUpdate = true

# 下载文件损坏是否自动重新下载 (默认为 true)
AutoRetry = true

# 最大自动重试次数 (默认为 3)
MaxRetryTimes = 3

# 下载超时时长 (单位秒, 默认为 60)
DownloadTimeout = 60

# 是否校验更新文件 md5 (默认开启), 若设置为 false 相当于 -no-md5-check 参数
CheckMD5 = true

# 自定义源码路径
SrcPath = ./src

# 自定义 bot 函数入口 (默认为 bot.Start)
BotEntry = bot.Start

※ 修改配置后,将 config_example.ini 重命名为 config.ini

启动 Music163-bot

$ ./Music163bot-Go
2021/10/30 13:05:40 [INFO] Music163bot-Go v2.0.0(20000) (main.go:122)
2021/10/30 13:05:40 [INFO] 正在检查更新中 (main.go:155)
2021/10/30 13:05:40 [INFO] v2.0.0(20000) 已是最新版本 (main.go:361)
2021/10/30 13:05:40 [INFO] 正在校验文件MD5 (main.go:164)
2021/10/30 13:05:40 [INFO] MD5校验成功 (main.go:169)
2021/10/30 13:05:40 [INFO] 加载版本 v2.0.0(20000) 中 (main.go:195)
2021/10/30 13:05:41 [INFO] Music163bot 验证成功 (value.go:543)

🤖 命令

  • /musicid/netease + 音乐ID —— 从 MusicID 获取歌曲
  • /search + 关键词 —— 搜索歌曲
  • /about —— 关于本 bot

Extension points exported contracts — how you extend this code

LogInterface (Interface)
(no doc) [1 implementers]
bot/logger.go

Core symbols most depended-on inside this repo

processMusic
called by 8
bot/processMusic.go
sendMusic
called by 3
bot/processMusic.go
parseMusicID
called by 3
bot/tools.go
getProgramRealID
called by 3
bot/tools.go
readConfig
called by 2
main.go
initConfig
called by 2
main.go
parseArtist
called by 2
bot/tools.go
parseProgramID
called by 2
bot/tools.go

Shape

Function 36
Method 12
Struct 5
Interface 1

Languages

Go100%

Modules by API surface

bot/logger.go16 symbols
bot/tools.go11 symbols
main.go7 symbols
bot/modules.go5 symbols
bot/processInline.go4 symbols
bot/musicRecognize.go3 symbols
bot/processMusic.go2 symbols
bot/db.go2 symbols
bot/processSearch.go1 symbols
bot/processLyric.go1 symbols
bot/pic.go1 symbols
bot/bot.go1 symbols

For agents

$ claude mcp add Music163bot-Go \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page