-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
3 changed files
with
106 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import random | ||
import datetime | ||
|
||
|
||
def is_prank_time(): | ||
# This function control the probability of bonus effects happening. | ||
# Default probability is 0.5%, or approximately 1/200 | ||
# Probability increases significantly on April 1st | ||
probability = 1 - 0.005 | ||
if is_april_fools(): | ||
probability = 0.5 | ||
if random.random() >= probability: | ||
return True | ||
return False | ||
|
||
|
||
def is_april_fools(): | ||
# Returns True if it is April Fool's Day | ||
today = datetime.date.today() | ||
if today.day == 1 and today.month == 4: | ||
return True | ||
else: | ||
return False | ||
|
||
|
||
def there_are_no_rules(): | ||
# Returns the URL for the 'There are no rules!' image. | ||
return "https://cdn.discordapp.com/attachments/853066187915395142/1118122019301638215/therearenorules.webp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters