File tree Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: Context ;
2
2
3
- mod ping;
4
- mod pomelo;
5
- mod presence;
6
- mod say;
7
- mod self_timeout;
8
- mod shiggy;
9
- mod translate;
3
+ pub mod ping;
4
+ pub mod pomelo;
5
+ pub mod presence;
6
+ pub mod say;
7
+ pub mod self_timeout;
8
+ pub mod shiggy;
9
+ pub mod translate;
10
10
11
- pub fn vec ( ) -> Vec <
11
+ pub fn to_vec ( ) -> Vec <
12
12
:: poise:: Command <
13
13
<Context < ' static > as poise:: _GetGenerics >:: U ,
14
14
<Context < ' static > as poise:: _GetGenerics >:: E ,
@@ -24,5 +24,3 @@ pub fn vec() -> Vec<
24
24
translate:: translate( ) ,
25
25
]
26
26
}
27
-
28
- pub use presence:: restore_presence;
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ pub async fn presence(
105
105
Ok ( ( ) )
106
106
}
107
107
108
- pub async fn restore_presence ( ctx : & serenity:: Context , redis_client : & redis:: Client ) -> Result < ( ) > {
108
+ pub async fn restore ( ctx : & serenity:: Context , redis_client : & redis:: Client ) -> Result < ( ) > {
109
109
let mut conn = redis_client. get_async_connection ( ) . await ?;
110
110
let data: Option < String > = conn. get ( "presence-v1" ) . await ?;
111
111
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ async fn main() -> Result<()> {
27
27
let mut client = Client :: builder ( std:: env:: var ( "DISCORD_TOKEN" ) ?, GatewayIntents :: all ( ) )
28
28
. framework ( Framework :: new (
29
29
FrameworkOptions {
30
- commands : commands:: vec ( ) ,
30
+ commands : commands:: to_vec ( ) ,
31
31
event_handler : |ev, _, _| {
32
32
Box :: pin ( async move {
33
33
match ev {
@@ -79,7 +79,7 @@ async fn main() -> Result<()> {
79
79
if let Ok ( redis_url) = std:: env:: var ( "REDIS_URL" ) {
80
80
let client = redis:: Client :: open ( redis_url) ?;
81
81
82
- if let Err ( err) = commands:: restore_presence ( & ctx, & client) . await {
82
+ if let Err ( err) = commands:: presence :: restore ( & ctx, & client) . await {
83
83
eprintln ! ( "{}" , err) ;
84
84
} ;
85
85
You can’t perform that action at this time.
0 commit comments