🐛 Bug Report: discord-command-bot Python build fails in setup.py
维护者通常 1 天内回复
评估
调研方向
Start with python/discord_command_bot/src/setup.py and compare the Go and Node.js template build steps; the issue identifies the failing relative import and the request body content type. Check how the build invokes setup.py and how Node.js registers its command. Done means the Python build completes and sends JSON, and the Go command is registered during build or its manual registration requirement is documented.
由索引模型根据 Issue 内容生成。
描述
Summary
The Python variant of discord-command-bot fails to build, so it never registers its slash command.
Details
- Appwrite builds this variant with
pip install -r requirements.txt && python src/setup.py. The config is inapp/config/templates/function.phpin appwrite/appwrite. python/discord_command_bot/src/setup.pystarts withfrom .utils import throw_if_missing. A relative import fails when the file runs as a script (ImportError: attempted relative import with no known parent package), so the build fails.- With the import fixed, the request still sends form data under a JSON content type:
requests.post(..., data={...}, headers={"Content-Type": "application/json"}). Discord expects a JSON body, so this should bejson={...}. - The Go variant's build command is empty, so it doesn't register the command during the build the way the Node.js variant does (
npm run setup).
Suggested fix
- Use an absolute import (or run the script as a module) and
json=insetup.py. - Add a registration step for Go, or document that the command must be registered manually.
Notes
This turned up while adding templates to the appwrite.io integrations catalog. The catalog page points readers to the Node.js runtime for now.
cc @adityaoberai
- 主要语言
- HTML
- 星标
- 174
- 派生
- 129
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 11
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
appwrite/templates 的其他 Issue
-
🐛 Bug Report: query-redis-labs hardcodes Redis port 14714可能已有人在做 @sundeep8967 于 1 天前认领。 未关闭bug javascript
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 20/100
维护者通常 1 天内回复
-
Enhancement: Add TypeScript definitions (IntelliSense) to Node.js starter可能已有人在做 @Ram3ez 于 328 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 55/100
维护者通常 1 天内回复
-
enhancement
难度 3/5 1-2 天 新手友好度 45/100
维护者通常 1 天内回复
查看 appwrite/templates 的全部 Issue
相似的 Issue
-
govulncheck reports 7 reachable vulnerabilities in dependencies可能已有人在做 @dwisiswant0 今天认领。 未关闭Type: Bug
难度 2/5 1-3 小时 新手友好度 76/100
projectdiscovery/rawhttp#558 ·
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
MasterJ93/ATProtoKit#344 ·
-
backend bug frontend good first issue p1
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
go perft exits when EvalFile is unavailable可能已有人在做 @Muawiya-contact 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
official-stockfish/Stockfish#7292 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
huggingface/accelerate#4511 ·
维护者通常 1 天内回复