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

Abierto
#491 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go, nodejs, python
Área
api, backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
HTML
Estrellas
174
Forks
129
Merge medio
1 d 15 h
PR fusionados (30 d)
11

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de appwrite/templates

Todos los issues de appwrite/templates

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.