async fn prop(&self, context: Context, msg: &Message, args: String) {
        // Users cannot propose while voting
        if self.in_vote_period(msg).await {
            msg.author
                .dm(&context, |m| {
                    m.content("Candidates cannot be proposed while the vote is ongoing!")
                })
                .await
                .expect("discord API error");

            return;
        }

        if let Some(g) = msg.guild(&context).await {
            if self
                .upcoming_topics
                .get(&g.id)
                .unwrap()
                .read()
                .await
                .contains(args.as_str())
            {
                // Alert the user if their proposal already exists
                msg.author
                    .dm(&context, |m| {
                        m.content(format!(
                            "Your proposal {} already exists! Not adding.",
                            args
                        ))
                    })
                    .await
                    .expect("discord API error");
            }

            // Register the new candidate
            self.upcoming_topics
                .get(&g.id)
                .unwrap()
                .write()
                .await
                .insert(args.trim_end().to_owned());
            self.poll_suggestions(&context, &g.id).await;
            announce!(&context, msg, format!("New candidate proposed: {}", args));
        }
    }
/// !prop <topic>: Adds a topic to the upcoming election
prop : Adds a topic to the upcoming election
prop : Adds a topic to the upcoming election
async fn prop(&self, context: Context, msg: &Message, args: String) {
        // Users cannot propose while voting
        if self.in_vote_period(msg).await {
            msg.author
                .dm(&context, |m| {
                    m.content("Candidates cannot be proposed while the vote is ongoing!")
                })
                .await
                .expect("discord API error");
            return;
        }
        if let Some(g) = msg.guild(&context).await {
            if self
                .upcoming_topics
                .get(&g.id)
                .unwrap()
                .read()
                .await
                .contains(args.as_str())
            {
                // Alert the user if their proposal already exists
                msg.author
                    .dm(&context, |m| {
                        m.content(format!(
                            "Your proposal {} already exists! Not adding.",
                            args
                        ))
                    })
                    .await
                    .expect("discord API error");
            }
            // Register the new candidate
            self.upcoming_topics
                .get(&g.id)
                .unwrap()
                .write()
                .await
                .insert(args.trim_end().to_owned());
            self.poll_suggestions(&context, &g.id).await;
            announce!(&context, msg, format!("New candidate proposed: {}", args));
        }
    }
async fn prop ( & self , context : Context , msg : & Message , args : String ) { // Users cannot propose while voting if self . in_vote_period ( msg ) . await { msg . author . dm ( & context , | m | { m . content ( " " ) } ) . await . expect ( " " ) ; return ; } if let Some ( g ) = msg . guild ( & context ) . await { if self . upcoming_topics . get ( & g . id ) . unwrap ( ) . read ( ) . await . contains ( args . as_str ( ) ) { // Alert the user if their proposal already exists msg . author . dm ( & context , | m | { m . content ( format ! ( " " args ) ) } ) . await . expect ( " " ) ; } // Register the new candidate self . upcoming_topics . get ( & g . id ) . unwrap ( ) . write ( ) . await . insert ( args . trim_end ( ) . to_owned ( ) ) ; self . poll_suggestions ( & context , & g . id ) . await ; announce ! ( context msg format ( " " args ) ) ; } }
prop <topic>: Adds a topic to the upcoming election
prop <topic > : Adds a topic to the upcoming election
&self
context
Context
msg
&Message
args
String
&self
context
Context
msg
&Message
args
String