note.rs 948 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. use crate::{
  2. config::NoteConfig,
  3. github::{self, Event, Selection},
  4. handlers::Context,
  5. interactions::EditIssueBody,
  6. };
  7. use anyhow::Context as _;
  8. use parser::command::note::NoteCommand;
  9. use tracing as log;
  10. #[derive(Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
  11. struct NoteData {
  12. title: Option<String>,
  13. summary: Option<String>,
  14. }
  15. pub(super) async fn handle_command(
  16. ctx: &Context,
  17. _config: &NoteConfig,
  18. event: &Event,
  19. cmd: NoteCommand,
  20. ) -> anyhow::Result<()> {
  21. log::debug!("Handling Note Command");
  22. // TODO: edit the original post to include:
  23. //
  24. // ```md
  25. // <!-- start rustbot summary-->
  26. // - [title](LINK_TO_SUMMARY_COMMENT)
  27. // <!-- end rustbot summary-->
  28. // ```
  29. let issue = event.issue().unwrap();
  30. if issue.is_pr() {
  31. let NoteCommand::Summary { title, summary } = &cmd;
  32. log::debug!("Note: {}, {}", title, summary);
  33. }
  34. Ok(())
  35. }