container23 / caml

A simple service and Discord Bot for performing a wallet, address and name check against the US FINCEN AML list
https://caml.container23.com/
Creative Commons Attribution 4.0 International
1 stars 2 forks source link

Add endpoint to register commands to custom Discord server #6

Closed ysfdev2 closed 1 year ago

ysfdev2 commented 1 year ago

Currently the bot only support registering commands into a single Guild server ID (loaded from environment config). We should add an endpoint to register commands into a custom Discord Server (guildID)

Endpoint: POST /api/v1/commands/register Input Payload:

{
   "guild_id": "{Discord server Id}",
   "commands": ["test", "check"] //optional, if not provided all commands supported by bot should be registered
}

Response

{
  "msg": "commands successfully registered",
  "commands": ["cmdA", "..."] // commands registered
}
ysfdev2 commented 1 year ago

Fix on #11 , we won't need a separate API, as the bot will auto register commands globally on server start