Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
chatbot/handlers/joke.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
26 lines (20 sloc)
978 Bytes
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
""" JokeService and related. """ | |
import random | |
from .service import Service | |
class JokeService(Service): | |
""" Services that provides jokes and other comedic things. """ | |
_jokes = ( | |
"Why did the chicken cross the road?\nTo get to the other side.", | |
"Why do keyboards work 24/7?\nBecause they have two shifts.", | |
"What days do fish dislike the most?\nFry-Days!.", | |
"I don't know. You tell me.", | |
"What kind of music is a balloon scared of?\nPop music.", | |
"What do you call the security outside of a Samsung Store?\nGuardians of the Galaxy.", | |
"Want a bad joke?\nLook in the mirror.", | |
"What do you call a bee that was born is the United States?\nA USB.", | |
"What do you call a cow in an earthquake?\nA milkshake.", | |
"Where do animals go when their tails fall off?\nThe retail store.", | |
) | |
def random_joke(self): | |
""" Returns a random joke. """ | |
return random.choice(self._jokes) |