🐛 Bug Report: discord-command-bot Python build fails in setup.py

未关闭
#491 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@sundeep8967 已经在做这个了。

开始于 2026年11月7日。

  • #494 来自 @sundeep8967 —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go, nodejs, python
领域
api, backend

调研方向

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 内容生成。

描述

bug python

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 in app/config/templates/function.php in appwrite/appwrite.
  • python/discord_command_bot/src/setup.py starts with from .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 be json={...}.
  • 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= in setup.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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

appwrite/templates 的其他 Issue

查看 appwrite/templates 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。