aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorTaavi <[email protected]>2017-01-02 03:38:36 +0300
committerzeyla <[email protected]>2017-01-01 16:38:36 -0800
commit18cc152769a35cd1705f045b9815cc90446034ef (patch)
treeb33d18158b62ad5d89cd35f4f547aadb509369e2 /src/utils
parentFix command macro signatures (diff)
downloadserenity-18cc152769a35cd1705f045b9815cc90446034ef.tar.xz
serenity-18cc152769a35cd1705f045b9815cc90446034ef.zip
Implement context message queueing
Also the dreaded `ctx <<= "something"` which is actually a mistake.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/builder/search.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/utils/builder/search.rs b/src/utils/builder/search.rs
index 5b54157..cf61bed 100644
--- a/src/utils/builder/search.rs
+++ b/src/utils/builder/search.rs
@@ -108,7 +108,7 @@ impl SortingOrder {
/// limiting to 2 results, and only searching channels that have a name
/// prefixed with `"search-"`:
///
-/// ```rust,no_run
+/// ```rust,ignore
/// use serenity::client::{Client, Context};
/// use serenity::model::Message;
/// use serenity::utils::builder::{SortingMode, SortingOrder};
@@ -120,7 +120,7 @@ impl SortingOrder {
/// .configure(|c| c.prefix("~").on_mention(true))
/// .on("search", search));
///
-/// fn search(context: &Context, message: &Message, args: Vec<String>) -> Result<(), String> {
+/// command!(search(context, message, args) {
/// let query = args.join(" ");
///
/// if query.is_empty() {
@@ -131,7 +131,8 @@ impl SortingOrder {
///
/// let guild = message.guild().unwrap();
///
-/// let channel_ids = guild.channels
+/// let channel_ids = guild
+/// .channels
/// .values()
/// .filter(|c| c.name.starts_with("search-"))
/// .map(|c| c.id)
@@ -175,9 +176,7 @@ impl SortingOrder {
///
/// e
/// }));
-///
-/// Ok(())
-/// }
+/// });
/// ```
///
/// [`Channel`]: ../../model/enum.Channel.html