interactions.py icon indicating copy to clipboard operation
interactions.py copied to clipboard

[FEAT] Add Onboarding API endpoints

Open david-why opened this issue 1 year ago • 3 comments

Problem Description

The Get Guild Onboarding and Modify Guild Onboarding endpoints seem to be unimplemented. Supporting these would allow bots to change the Onboarding questions, like choosing roles, channels, etc.

Proposed Solution

Add methods named like fetch_onboarding and edit_onboarding to the Guild class.

Alternatives Considered

No response

Additional Information

I'm trying to make a bot that automatically creates channels and updates the Onboarding questions to include the new channels.

Code of Conduct

  • [x] I agree to follow the contribution requirements.

david-why avatar Mar 29 '24 11:03 david-why

Now I've come to think more about this, I think a more interactions-py-nic way of doing this would be to have individual edit methods on Onboarding, OnboardingPrompt, etc. objects, rather than a catch-all edit_onboarding method.

david-why avatar Mar 29 '24 12:03 david-why

I would like to try and implement this. It's a little complicated because Onboarding has a bunch of OnboardingPrompts, which in turn have a bunch of OnboardingPromptOptions, each of which have ids.

I've come up with the following implementation plan, but I'm not sure if it's the best way to go:

  1. Guild objects have {fetch,get}_onboarding method which gets the onboarding for the guild. It returns an Onboarding object
  2. Onboarding objects have add_prompt and delete_prompt methods, which manages the prompts, and edit, which edits all other fields
  3. The prompts are OnboardingPrompt objects, which have edit method that edits themselves

Does anyone have better ideas? If not I'll try to implement it this way. (This is my first somewhat major contribution to an open source project, please point out any mistakes I make!)

david-why avatar Mar 29 '24 14:03 david-why

We welcome you to create your own pull request where we can attach the issue and keep track of proposed development. #1645 may serve as a formal issue tracker for discussing ideas and implementation details

eightween avatar Mar 29 '24 23:03 eightween