~phate/rsPhate

364573b69ce4452cbdd4881f29926f429a9adcac — Ash 1 year, 3 months ago 490221b
support sourcehut in git command and add Cargo.lock to .gitignore
2 files changed, 8 insertions(+), 2 deletions(-)

M .gitignore
M src/commands/git.rs
M .gitignore => .gitignore +2 -1
@@ 1,1 1,2 @@
/target
/Cargo.lock
/target
\ No newline at end of file

M src/commands/git.rs => src/commands/git.rs +6 -1
@@ 11,7 11,8 @@ use serenity::{
#[usage = "site,user/repo"]
#[example = "github,rsfetch/rsfetch"]
#[example = "gitlab,ArcticTheRogue/asgl"]
#[example = "codeberg,Phate6660/rsPhate"]
#[example = "codeberg,Phate6660/musinfo"]
#[example = "sourcehut,phate/rsPhate"]
#[num_args(2)]
fn git(ctx: &mut Context, msg: &Message, mut args: Args) -> CommandResult {
    let site = args.single::<String>()?;


@@ 35,6 36,10 @@ fn git(ctx: &mut Context, msg: &Message, mut args: Args) -> CommandResult {
            .push("https://codeberg.org/")
            .push(repo)
            .build(),
        "sourcehut" => MessageBuilder::new()
            .push("https://sr.ht/~")
            .push(repo)
            .build(),
        _ => "Could not generate a full link, please try again.".to_string(),
    };