Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 1.6 KB

ask.md

File metadata and controls

35 lines (26 loc) · 1.6 KB

About $ask (Modified in project 3)

This command lets users ask a question in the #q-and-a channel. The questions are automatically numbered and can be asked anonymously or display the author.

Changes

This command was introduced by SE21-Team2.

Changes made by CSC510-Group-25:

  • Users can now use anon instead of anonymous (though anonymous still works)
  • Users cannot ask empty/blank/whitespace only questions

Location of Code

The code that implements the above mentioned functionality is located in cogs/qanda.py.

Code Description

Functions

askQuestion(self, ctx, qs: str, anonymous=''):
This function takes as arguments the values provided by the constructor through self, context in which the command was called, the question string, and the anonymous option.

How to run it? (Small Example)

You are in the server that has the Classmate Bot active and online. You go to the #q-and-a channel, enter the command ask and type the question in quotes. If you want the question to be displayed anonymously, you can add the option anonymous to the end of the command.

$ask "QUESTION" anonymous_<optional>_
$ask "When is the exam?" anonymous
$ask "When is the project due?"

Successful execution of this command will delete the user's original message and the bot will send a new message with the question.

image