-
# Python函数的参数
##### 1. 默认参数
比如两个参数的函数:
```
def power(x, n = 2):
```
当以上函数被调用时,如果只传入x的值,则n的值默认为2.若n和x的值都被传入,则使用传入的值.默认参数的数量是无限制的.
可以不按照顺序提供默认参数,但是必须将变量的名字写上.
```
def enroll(name, gen…
-
I'm running my bot from an alpine docker image, and when I run the line
```rust
let handler = manager.join(guild_id, channel_id).await.0;
```
The container crashes and I get this output:
``…
-
Following the docs, I got this far:
```rust
let child = Command::new("ffmpeg")
.args(...)
.args(&["-f", "opus", "-"])
.output().unwrap();
let reader = Reader::Vec(Cursor::new(child.s…
-
**Songbird version:** songbird = { version = "0.3.2", features = ["driver"] }
**Rust version (`rustc -V`):** rustc 1.72.0 (5680fa18f 2023-08-23)
**Serenity/Twilight version:** custom client
*…
-
**Songbird version:** 0.2.0
**Rust version:** rustc 1.55.0 (c8dfcfe04 2021-09-06)
**Serenity version:** 0.10.9
**Description:**
When using `Restartable::ytdl()` with `lazy = true`, attempt…
-
**Songbird version:** 0.3.1
**Rust version (`rustc -V`):** rustc 1.67.0 (fc594f156 2023-01-24)
**Serenity/Twilight version:** serenity 0.11.5 (default features enabled)
**Output of `ffmpeg -v…
-
**Songbird version:** `0.3.0`
**Rust version (`rustc -V`):** `rustc 1.66.0-nightly (4b8f43199 2022-10-19)`
**Serenity/Twilight version:** `serenity 0.11.5`
**Output of `ffmpeg -version`, `yt-…
-
When using the play command with youtube link or song name, the bot joins my voice channel and then crashes.
```
2023-09-17T19:25:21.423610Z INFO mimicri::database::sqlite_plugin: [sqlite] sqlite p…
-
```
Running `/home/lothrop/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc --crate-name crack_config --edition=2021 crack-config/src/lib.rs --error-format=json --json=diagnostic-r…
-
**Songbird version:**
`next`(4fe23788e859a44a3f29987bff26c2612e74dcc5)
**Rust version (`rustc -V`):**
rustc 1.70.0 (90c541806 2023-05-31)
**Serenity/Twilight version:**
`next`(serenity-rs/ser…