Last active
March 30, 2024 12:26
-
-
Save tuna2134/8b933793e2883270e1f1e8c43b526315 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct {}; | |
#[view] | |
impl NewView { | |
#[button(name = "hello", style = ButtonStyle.green)] | |
async fn hello(&self, interaction: Interaction, button: Button) -> anyhow::Result<()> { | |
interaction.response.send_message("hello").await?; | |
Ok(()) | |
} | |
} | |
#[tokio::main] | |
async fn main() -> anyhow::Result<()> { | |
let client = Client::new("token"); | |
let view = NewView {}; | |
client.create_message(Id::new(1234)).components(view.to_components()).await?; | |
Ok(())) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment