Allow Spaces in ALAN! prefix
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
use serenity::framework::standard::StandardFramework;
|
use serenity::framework::standard::{StandardFramework, WithWhiteSpace};
|
||||||
use serenity::prelude::*;
|
use serenity::prelude::*;
|
||||||
|
|
||||||
// This trait adds the `register_songbird` and `register_songbird_with` methods
|
// This trait adds the `register_songbird` and `register_songbird_with` methods
|
||||||
@@ -35,7 +35,15 @@ async fn main() {
|
|||||||
| GatewayIntents::GUILD_VOICE_STATES;
|
| GatewayIntents::GUILD_VOICE_STATES;
|
||||||
|
|
||||||
let framework = StandardFramework::new()
|
let framework = StandardFramework::new()
|
||||||
.configure(|c| c.prefix("ALAN! "))
|
.configure(|c| {
|
||||||
|
c.prefix("ALAN! ");
|
||||||
|
c.with_whitespace(WithWhiteSpace {
|
||||||
|
commands: true,
|
||||||
|
groups: true,
|
||||||
|
prefixes: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
)
|
||||||
.group(&GENERAL_GROUP);
|
.group(&GENERAL_GROUP);
|
||||||
|
|
||||||
let songbird_config = Config::default()
|
let songbird_config = Config::default()
|
||||||
|
|||||||
@@ -60,22 +60,22 @@ impl EventHandler for Receiver {
|
|||||||
// An event which fires for every received audio packet,
|
// An event which fires for every received audio packet,
|
||||||
// containing the decoded data.
|
// containing the decoded data.
|
||||||
if let Some(audio) = data.audio {
|
if let Some(audio) = data.audio {
|
||||||
println!("Audio packet's first 5 samples: {:?}", audio.get(..5.min(audio.len())));
|
// println!("Audio packet's first 5 samples: {:?}", audio.get(..5.min(audio.len())));
|
||||||
println!(
|
// println!(
|
||||||
"Audio packet sequence {:05} has {:04} bytes (decompressed from {}), SSRC {}",
|
// "Audio packet sequence {:05} has {:04} bytes (decompressed from {}), SSRC {}",
|
||||||
data.packet.sequence.0,
|
// data.packet.sequence.0,
|
||||||
audio.len() * std::mem::size_of::<i16>(),
|
// audio.len() * std::mem::size_of::<i16>(),
|
||||||
data.packet.payload.len(),
|
// data.packet.payload.len(),
|
||||||
data.packet.ssrc,
|
// data.packet.ssrc,
|
||||||
);
|
// );
|
||||||
} else {
|
} else {
|
||||||
println!("RTP packet, but no audio. Driver may not be configured to decode.");
|
// println!("RTP packet, but no audio. Driver may not be configured to decode.");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Ctx::RtcpPacket(data) => {
|
Ctx::RtcpPacket(data) => {
|
||||||
// An event which fires for every received rtcp packet,
|
// An event which fires for every received rtcp packet,
|
||||||
// containing the call statistics and reporting information.
|
// containing the call statistics and reporting information.
|
||||||
println!("RTCP packet received: {:?}", data.packet);
|
// println!("RTCP packet received: {:?}", data.packet);
|
||||||
},
|
},
|
||||||
Ctx::ClientDisconnect(
|
Ctx::ClientDisconnect(
|
||||||
ClientDisconnect {user_id, ..}
|
ClientDisconnect {user_id, ..}
|
||||||
@@ -90,6 +90,7 @@ impl EventHandler for Receiver {
|
|||||||
Ctx::DriverConnect(
|
Ctx::DriverConnect(
|
||||||
ConnectData { channel_id, ..}
|
ConnectData { channel_id, ..}
|
||||||
) => {
|
) => {
|
||||||
|
println!("VoiceDriver is connected.");
|
||||||
match channel_id {
|
match channel_id {
|
||||||
Some(chan) => {
|
Some(chan) => {
|
||||||
let ding_src =
|
let ding_src =
|
||||||
|
|||||||
Reference in New Issue
Block a user