Skip to content

Commit a5d3ebb

Browse files
authored
Merge pull request #37 from csp-community/tkp/more
add more fun
2 parents 1b82f9d + 14287b8 commit a5d3ebb

3 files changed

Lines changed: 262 additions & 0 deletions

File tree

csp_bot_commands/common.py

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515
"DRINKING_ESTABLISHMENTS",
1616
"COCKTAILS",
1717
"BEER",
18+
"WINE",
19+
"YOGI",
20+
"TOLKIEN",
21+
"FORTUNE",
22+
"PRATCHETT",
23+
"WILDE",
24+
"NIETZSCHE",
25+
"TWAIN",
26+
"ZEN",
1827
)
1928

2029

@@ -704,3 +713,183 @@ def a_or_an(next_word):
704713
"saison",
705714
"stout",
706715
)
716+
717+
WINE = (
718+
"Albariño",
719+
"Amarone della Valpolicella",
720+
"Barolo",
721+
"Barbaresco",
722+
"Barossa Valley Shiraz",
723+
"Bordeaux Cabernet Sauvignon",
724+
"Brunello di Montalcino",
725+
"Burgundy Pinot Noir",
726+
"Cava",
727+
"Chablis Premier Cru",
728+
"Champagne",
729+
"Châteauneuf-du-Pape",
730+
"Chianti Classico",
731+
"Côtes du Rhône",
732+
"Crémant d'Alsace",
733+
"Fiano di Avellino",
734+
"Greco di Tufo",
735+
"Grüner Veltliner",
736+
"Malbec",
737+
"Montepulciano d'Abruzzo",
738+
"Mourvèdre",
739+
"Napa Valley Cabernet",
740+
"Nero d'Avola",
741+
"Pouilly-Fumé",
742+
"Priorat",
743+
"Prosecco",
744+
"Ribera del Duero",
745+
"Rioja Reserva",
746+
"Sagrantino di Montefalco",
747+
"Sancerre",
748+
"Tempranillo",
749+
"Txakoli",
750+
"Vermentino",
751+
"Vinho Verde",
752+
"White Burgundy Chardonnay",
753+
"Willamette Valley Pinot Noir",
754+
)
755+
756+
YOGI = (
757+
"It ain't over till it's over.",
758+
"The future ain't what it used to be.",
759+
"You can observe a lot by just watching.",
760+
"When you come to a fork in the road, take it.",
761+
"Nobody goes there anymore. It's too crowded.",
762+
"If the world were perfect, it wouldn't be.",
763+
"Baseball is ninety percent mental and the other half is physical.",
764+
"We made too many wrong mistakes.",
765+
"It gets late early out here.",
766+
"If you don't know where you are going, you might wind up someplace else.",
767+
"I never said most of the things I said.",
768+
"Even Napoleon had his Watergate.",
769+
"A nickel ain't worth a dime anymore.",
770+
"Always go to other people's funerals, otherwise they won't come to yours.",
771+
"In theory there is no difference between theory and practice. In practice there is.",
772+
"Half the lies they tell about me aren't true.",
773+
"You wouldn't have won if we'd beaten you.",
774+
"I'm not going to buy my kids an encyclopedia. Let them walk to school like I did.",
775+
)
776+
777+
TOLKIEN = (
778+
"Not all those who wander are lost.",
779+
"Even the smallest person can change the course of the future.",
780+
"All we have to decide is what to do with the time that is given us.",
781+
"I will not say: do not weep; for not all tears are an evil.",
782+
"Faithless is he that says farewell when the road darkens.",
783+
"The world is indeed full of peril, and in it there are many dark places; but still there is much that is fair.",
784+
"It's a dangerous business, Frodo, going out your door.",
785+
"Deeds will not be less valiant because they are unpraised.",
786+
"The burned hand teaches best. After that, advice about fire goes to the heart.",
787+
"He that breaks a thing to find out what it is has left the path of wisdom.",
788+
"Short cuts make long delays.",
789+
"Go not to the Elves for counsel, for they will say both no and yes.",
790+
"The treacherous are ever distrustful.",
791+
"Many that live deserve death. And some that die deserve life. Can you give it to them?",
792+
)
793+
794+
FORTUNE = (
795+
"A beautiful, smart, and loving person will be coming into your life.",
796+
"You will be hungry again in one hour.",
797+
"Help! I am being held prisoner in a fortune cookie factory.",
798+
"An update to your life is now available.",
799+
"You will be rewarded for your patience, eventually.",
800+
"Ignore previous fortune. Attach this cookie to resumé.",
801+
"A surprise is waiting for you somewhere. It's this fortune.",
802+
"Be careful: you might find what you're looking for.",
803+
"This fortune intentionally left blank.",
804+
"The early bird gets the worm, but the second mouse gets the cheese.",
805+
"Someone is thinking of you. Probably about whether you responded to their message.",
806+
"Life is uncertain. Eat dessert first.",
807+
"Your code will compile on the first try. (Just kidding.)",
808+
"Change is coming. Have you backed up?",
809+
"A closed mouth gathers no feet.",
810+
)
811+
812+
PRATCHETT = (
813+
"It's not worth doing something unless someone, somewhere, would much rather you weren't doing it.",
814+
"In ancient times cats were worshipped as gods; they have not forgotten this.",
815+
"The truth may be out there, but the lies are inside your head.",
816+
"It is often said that before you die your life passes before your eyes. It is in fact true. It's called living.",
817+
"Five exclamation marks, the sure sign of an insane mind.",
818+
"The pen is mightier than the sword if the sword is very short, and the pen is very sharp.",
819+
"Real stupidity beats artificial intelligence every time.",
820+
"It's amazing what you can do if you don't know what you can't do.",
821+
"Always be wary of any helpful item that weighs less than its operating manual.",
822+
"Stories of imagination tend to upset those without one.",
823+
"If you trust in yourself, and believe in your dreams, and follow your star, you'll still get beaten by people who spent their time working hard and learning things and weren't so lazy.",
824+
"Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life.",
825+
"Sometimes it's better to light a flamethrower than curse the darkness.",
826+
)
827+
828+
WILDE = (
829+
"Be yourself; everyone else is already taken.",
830+
"Always forgive your enemies; nothing annoys them so much.",
831+
"I can resist everything except temptation.",
832+
"The truth is rarely pure and never simple.",
833+
"To live is the rarest thing in the world. Most people exist, that is all.",
834+
"There is only one thing worse than being talked about, and that is not being talked about.",
835+
"A cynic is a man who knows the price of everything, and the value of nothing.",
836+
"I am not young enough to know everything.",
837+
"The only way to get rid of a temptation is to yield to it.",
838+
"Experience is simply the name we give our mistakes.",
839+
"Fashion is a form of ugliness so intolerable that we have to alter it every six months.",
840+
"I have the simplest tastes. I am always satisfied with the best.",
841+
"Sarcasm is the lowest form of wit, but the highest form of intelligence.",
842+
"Work is the curse of the drinking classes.",
843+
"I can believe anything, provided that it is quite incredible.",
844+
)
845+
846+
NIETZSCHE = (
847+
"That which does not kill us makes us stronger.",
848+
"Without music, life would be a mistake.",
849+
"It is not a lack of love, but a lack of friendship that makes unhappy marriages.",
850+
"In individuals, insanity is rare; but in groups, parties, nations and epochs, it is the rule.",
851+
"The higher we soar, the smaller we appear to those who cannot fly.",
852+
"There is always some madness in love. But there is also always some reason in madness.",
853+
"We should consider every day lost on which we have not danced at least once.",
854+
"To live is to suffer, to survive is to find some meaning in the suffering.",
855+
"He who has a why to live can bear almost any how.",
856+
"God is dead. God remains dead. And we have killed him.",
857+
"You must have chaos within you to give birth to a dancing star.",
858+
"I'm not upset that you lied to me, I'm upset that from now on I can't believe you.",
859+
"All truly great thoughts are conceived while walking.",
860+
)
861+
862+
TWAIN = (
863+
"The reports of my death are greatly exaggerated.",
864+
"If you tell the truth, you don't have to remember anything.",
865+
"Golf is a good walk spoiled.",
866+
"It's easier to fool people than to convince them that they have been fooled.",
867+
"The secret of getting ahead is getting started.",
868+
"Never put off till tomorrow what may be done the day after tomorrow just as well.",
869+
"I have never let my schooling interfere with my education.",
870+
"Whenever you find yourself on the side of the majority, it is time to pause and reflect.",
871+
"It ain't what you don't know that gets you into trouble. It's what you know for sure that just ain't so.",
872+
"All you need in this life is ignorance and confidence, and then success is sure.",
873+
"Don't go around saying the world owes you a living. The world owes you nothing. It was here first.",
874+
"Courage is resistance to fear, mastery of fear—not absence of fear.",
875+
"Good friends, good books, and a sleepy conscience: this is the ideal life.",
876+
"Clothes make the man. Naked people have little or no influence on society.",
877+
"I am an old man and have known a great many troubles, but most of them never happened.",
878+
"Wrinkles should merely indicate where the smiles have been.",
879+
)
880+
881+
ZEN = (
882+
"Before enlightenment, chop wood, carry water. After enlightenment, chop wood, carry water.",
883+
"When you realize there is nothing lacking, the whole world belongs to you.",
884+
"The obstacle is the path.",
885+
"If you meet the Buddha on the road, kill him.",
886+
"What is the sound of one hand clapping?",
887+
"To study the self is to forget the self.",
888+
"You should sit in meditation for twenty minutes a day, unless you're too busy. Then you should sit for an hour.",
889+
"The finger pointing at the moon is not the moon.",
890+
"In the beginner's mind there are many possibilities; in the expert's mind there are few.",
891+
"Knock on the sky and listen to the sound.",
892+
"To a mind that is still, the whole universe surrenders.",
893+
"A good traveler has no fixed plans and is not intent on arriving.",
894+
"When hungry, eat your rice; when tired, close your eyes. Fools may laugh at me, but wise men will know what I mean.",
895+
)

csp_bot_commands/fun.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,20 @@
1010
COCKTAILS,
1111
DRINKING_ESTABLISHMENTS,
1212
DUNE,
13+
FORTUNE,
1314
GERMAN,
1415
ICELANDIC,
16+
NIETZSCHE,
17+
PRATCHETT,
18+
SHAKEPEREAN_MODIFIERS_ONE,
19+
SHAKEPEREAN_MODIFIERS_TWO,
20+
SHAKESPEREAN_NOUNS,
21+
TOLKIEN,
22+
TWAIN,
23+
WILDE,
24+
WINE,
25+
YOGI,
26+
ZEN,
1527
a_or_an,
1628
)
1729

@@ -56,6 +68,37 @@ def execute(self, command: BotCommand) -> Optional[Message]:
5668
elif "bush" in command.args:
5769
quote = choice(BUSH)
5870
message = f'{author} impresses {" ".join(target)} with a quote from George W. Bush: "{quote}"'
71+
elif "shakespeare" in command.args:
72+
insult = f"Thou {choice(SHAKEPEREAN_MODIFIERS_ONE)} {choice(SHAKEPEREAN_MODIFIERS_TWO)} {choice(SHAKESPEREAN_NOUNS)}!"
73+
message = f'{author} hurls a Shakespearean insult at {" ".join(target)}: "{insult}"'
74+
elif "yogi" in command.args:
75+
quote = choice(YOGI)
76+
message = f'{author} shares some Yogi Berra wisdom with {" ".join(target)}: "{quote}"'
77+
elif "tolkien" in command.args:
78+
quote = choice(TOLKIEN)
79+
message = f'{author} offers {" ".join(target)} wisdom from Middle-earth: "{quote}"'
80+
elif "fortune" in command.args:
81+
quote = choice(FORTUNE)
82+
message = f'{author} cracks open a fortune cookie for {" ".join(target)}: "{quote}"'
83+
elif "pratchett" in command.args:
84+
quote = choice(PRATCHETT)
85+
message = f'{author} enlightens {" ".join(target)} with Pratchett: "{quote}"'
86+
elif "wilde" in command.args:
87+
quote = choice(WILDE)
88+
message = f'{author} graces {" ".join(target)} with an Oscar Wilde quip: "{quote}"'
89+
elif "wine" in command.args:
90+
venue = choice(DRINKING_ESTABLISHMENTS)
91+
wine = choice(WINE)
92+
message = f'{author} calls {" ".join(target)} over to the {venue} for a glass of wine: "How about {a_or_an(wine)} {wine}?"'
93+
elif "nietzsche" in command.args:
94+
quote = choice(NIETZSCHE)
95+
message = f'{author} darkly enlightens {" ".join(target)} with Nietzsche: "{quote}"'
96+
elif "twain" in command.args:
97+
quote = choice(TWAIN)
98+
message = f'{author} shares a Mark Twain quip with {" ".join(target)}: "{quote}"'
99+
elif "zen" in command.args:
100+
quote = choice(ZEN)
101+
message = f'{author} offers {" ".join(target)} a moment of zen: "{quote}"'
59102
else:
60103
return None
61104
return Message(

csp_bot_commands/tests/test_fun.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ def test_statics(self):
2424
("beer",),
2525
("dune",),
2626
("bush",),
27+
("shakespeare",),
28+
("yogi",),
29+
("tolkien",),
30+
("fortune",),
31+
("pratchett",),
32+
("wilde",),
33+
("wine",),
34+
("nietzsche",),
35+
("twain",),
36+
("zen",),
2737
],
2838
)
2939
def test_execute(self, args):
@@ -54,5 +64,25 @@ def test_execute(self, args):
5464
assert msg.msg.startswith("<@123> scrapes wisdom for <@456> off the sands of Arrakis:")
5565
elif args[0] == "bush":
5666
assert msg.msg.startswith("<@123> impresses <@456> with a quote from George W. Bush:")
67+
elif args[0] == "shakespeare":
68+
assert msg.msg.startswith("<@123> hurls a Shakespearean insult at <@456>:")
69+
elif args[0] == "yogi":
70+
assert msg.msg.startswith("<@123> shares some Yogi Berra wisdom with <@456>:")
71+
elif args[0] == "tolkien":
72+
assert msg.msg.startswith("<@123> offers <@456> wisdom from Middle-earth:")
73+
elif args[0] == "fortune":
74+
assert msg.msg.startswith("<@123> cracks open a fortune cookie for <@456>:")
75+
elif args[0] == "pratchett":
76+
assert msg.msg.startswith("<@123> enlightens <@456> with Pratchett:")
77+
elif args[0] == "wilde":
78+
assert msg.msg.startswith("<@123> graces <@456> with an Oscar Wilde quip:")
79+
elif args[0] == "wine":
80+
assert msg.msg.startswith("<@123> calls <@456> over to the")
81+
elif args[0] == "nietzsche":
82+
assert msg.msg.startswith("<@123> darkly enlightens <@456> with Nietzsche:")
83+
elif args[0] == "twain":
84+
assert msg.msg.startswith("<@123> shares a Mark Twain quip with <@456>:")
85+
elif args[0] == "zen":
86+
assert msg.msg.startswith("<@123> offers <@456> a moment of zen:")
5787
else:
5888
assert False

0 commit comments

Comments
 (0)