make yeehaw arguments width and height optional and with an unbound maximum
This commit is contained in:
14
src/main.rs
14
src/main.rs
@@ -98,14 +98,12 @@ async fn dox(
|
|||||||
/// Pardner
|
/// Pardner
|
||||||
#[poise::command(slash_command, prefix_command)]
|
#[poise::command(slash_command, prefix_command)]
|
||||||
async fn yeehaw(ctx: Context<'_>,
|
async fn yeehaw(ctx: Context<'_>,
|
||||||
#[min = 1]
|
#[min = 1]
|
||||||
#[max = 64]
|
width: Option<usize>,
|
||||||
width: usize,
|
#[min = 1]
|
||||||
#[min = 1]
|
height: Option<usize>) -> Result<(), Error> {
|
||||||
#[max = 100]
|
ctx.reply(iter::repeat("\u{1F920}".to_string().repeat(width.unwrap_or(1)))
|
||||||
height: usize) -> Result<(), Error> {
|
.take(height.unwrap_or(1))
|
||||||
ctx.reply(iter::repeat("\u{1F920}".to_string().repeat(width))
|
|
||||||
.take(height)
|
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.join("\n")).await?;
|
.join("\n")).await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user