File tree Expand file tree Collapse file tree 3 files changed +52
-2
lines changed Expand file tree Collapse file tree 3 files changed +52
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : Release binary in github release
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+ - " v*.*.*"
7
+
8
+ env :
9
+ PROJECT_NAME : hacksquad-bot
10
+
11
+ jobs :
12
+ build :
13
+ name : Build and publish the binary
14
+ runs-on : ubuntu-latest
15
+ steps :
16
+ - name : Checkout
17
+ uses : actions/checkout@v2
18
+
19
+ - name : Install latest rust toolchain
20
+ uses : actions-rs/toolchain@v1
21
+ with :
22
+ toolchain : stable
23
+ default : true
24
+ override : true
25
+
26
+ - name : Build the binary
27
+ run : |
28
+ cargo build --all --release
29
+ strip target/release/${{ env.PROJECT_NAME }}
30
+ mkdir publish/
31
+ mv target/release/${{ env.PROJECT_NAME }} publish/${{ env.PROJECT_NAME }}_linux_amd64
32
+
33
+ - name : Release the binary
34
+ uses : ncipollo/release-action@v1
35
+ with :
36
+ artifacts : " publish/*"
37
+ token : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: Docker
2
2
3
3
on :
4
4
push :
5
- branches : [ main ]
5
+ branches : [main]
6
6
workflow_dispatch :
7
7
8
8
env :
Original file line number Diff line number Diff line change @@ -20,7 +20,20 @@ impl EventHandler for Handler {
20
20
"hero" => commands:: hero:: hero ( ctx, command. to_owned ( ) ) . await ,
21
21
"randomhero" => commands:: hero:: random_hero ( ctx, command. to_owned ( ) ) . await ,
22
22
"info" => commands:: info:: run ( ctx, command. to_owned ( ) ) . await ,
23
- other_commands => println ! ( "Unknown command {}" , other_commands) ,
23
+ other_commands => {
24
+ if let Err ( err) = command
25
+ . create_interaction_response ( ctx. http , |response| {
26
+ response. interaction_response_data ( |message| {
27
+ message. content ( "Unknown Command" ) . ephemeral ( true )
28
+ } )
29
+ } )
30
+ . await
31
+ {
32
+ println ! ( "Error sending unknown command response: {:?}" , err) ;
33
+ }
34
+
35
+ println ! ( "Unknown command {}" , other_commands)
36
+ }
24
37
} ,
25
38
Interaction :: MessageComponent ( ref component) => match component. message . interaction {
26
39
Some ( ref message_interaction) => match message_interaction. name . as_str ( ) {
You can’t perform that action at this time.
0 commit comments