aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Rohan <[email protected]>2019-02-12 13:18:58 +0530
committerGravatar Rohan <[email protected]>2019-02-12 13:18:58 +0530
commit5ebd48de26bce64b17dc011184c22b1e8a29eee0 (patch)
treeff2d2950be576170d088e351547c9ce2021f7ff2
parentMerge pull request #105 from RohanJnr/savethedate_iceman (diff)
im done working with the bemyvalentine command
-rw-r--r--bot/resources/valentines/bemyvalentine_valentines.json110
-rw-r--r--bot/seasons/valentines/be_my_valentine.py209
2 files changed, 319 insertions, 0 deletions
diff --git a/bot/resources/valentines/bemyvalentine_valentines.json b/bot/resources/valentines/bemyvalentine_valentines.json
new file mode 100644
index 00000000..45c3939d
--- /dev/null
+++ b/bot/resources/valentines/bemyvalentine_valentines.json
@@ -0,0 +1,110 @@
+{
+ "valentine_poems": [
+ {
+ "message" :"If you were my rose,\nthen I'd be your sun,painting you rainbows when the rains come.\nI'd change my orbit to banish the night,as to keep you in my nurturing light."
+
+ },
+ {
+ "message" :"If you were my world, then I'd be your moon,\nyour silent protector, a night-light in the gloom.\nOur fates intertwined, two bodies in motionthrough time and space,\n our dance of devotion."
+ },
+ {
+ "message" :"If you were my island, then I'd be your sea,\ncaressing your shores, soft and gentle I'd be.\nMy tidal embrace would leave gifts on your sands,\nbut by current and storm, I'd ward your gentle lands."
+ },
+ {
+ "message" :"If you were love's promise, then I would be time,\nyour constant companion till stars align.And though we are mere mortals,\n true love is divine,and my devotion eternal,\n to my one valentine."
+ },
+ {
+ "message" :"Have I told you, Valentine,That I’m all wrapped up in you?\nMy feelings for you bring to me A joy I never knew. \n \n You light up everything for me;In my heart you shine;\nIlluminating my whole life,My darling Valentine."
+ },
+ {
+ "message" :"My days are filled with yearning;\nMy nights are full of dreams.\nI’m always thinking of you;\nI’m in a trance, it seems.\n\n You’re all I ever wanted;\nI wish you could be mine;\nAnd so I have to ask you:Will you be my Valentine?"
+ },
+ {
+ "message" :"My Valentine, I love just you;\nMy devotion I declare.\nI’ll spend my life looking for ways To show you that I care. \n\nPlease say you feel the same for me;\nSay you’ll be forever mine;\nWe’ll share a life of happiness,\n My treasured Valentine."
+ },
+ {
+ "message" :"Every day with you is Valentine's Day, my love.\nEvery day is filled with romance, with love, with sharing and caring.\nEvery day I am reminded how blessed I am to have you as my \nValentine, my sweetheart, my lover, my friend, my playmate, my companion.\nNo Valentine card, no words at all could express how much I love You,\n how ecstatic I feel to know that you are mine.My Valentine, every day,\n I'll try to show you that every day I love you more."
+ },
+ {
+ "message" :"I lucked out when I met you, sweet thing.\nYou've brought richness to each day I exist.\nYou fill my days with the excitement of love,\n And you have since the moment we kissed.\nSo I celebrate Valentine's Day with you,\nWith a love that will always stay fresh and new."
+ },
+ {
+ "message" :"You are my everything, Valentine.\nAs a desert creature longs for water, my thirst for you can never be slaked.\nIn a ho-hum day dragging on, thoughts of you bring excitement, joy and pleasure.\nAs a child opens the birthday gift he most wanted, I see everything I want in you.\nYou are my everything, Valentine."
+ },
+ {
+ "message" :"My love for you is like the raging sea,\nSo powerful and deep it will forever be.\nThrough storm, wind, and heavy rain, It will withstand every pain.\nOur hearts are so pure and love so sweet.\nI love you more with every heartbeat!"
+ },
+ {
+ "message" :"A million stars up in the sky.\nOne shines brighter - I can't deny.\nA love so precious, a love so true, a love that comes from me to you.\nThe angels sing when you are near.\nWithin your arms I have nothing to fear.\nYou always know just what to say.\nJust talking to you makes my day.\nI love you, honey, with all of my heart.\nTogether forever and never to part."
+ },
+ {
+ "message" :"What do I do,\nWhen I'm still in love with you?You walked away, 'Cause you didn't want to stay.You broke my heart, you tore me apart.\nEvery day I wait for you, Telling myself our love was true.\nBut when you don't show, more tears start to flow.\nThat's when I knowI have to let go."
+ },
+ {
+ "message" :"When I say I love you, please believe it's true.\nWhen I say forever, know I'll never leave you.\nWhen I say goodbye, promise me you won't cry,\nBecause the day I'll be saying that will be the day I die."
+ },
+ {
+ "message" :"Beauty isn't seen by eyes.\nIt's felt by hearts,\nRecognized by souls, In the presence of love."
+ },
+ {
+ "message" :"L is for \"laughter\" we had along the way.\nO is for \"optimism\" you gave me every day.\nV is for \"value\" of being my best friend.\nE is for \"eternity,\" a love that has no end."
+ },
+ {
+ "message" :"If roses were red and violets could be blue,\nI'd take us away to a place just for two.\nYou'd see my true colors and all that I felt.\nI'd see that you could love me and nobody else.\nWe'd build ourselves a fortress where we'd run and play.\nYou'd be mine and I'd be yours 'til our dying day.\nThen I wake and realize you were never here.\nIt's all just my thoughts, my dreams, my hopes...But now it's only tears!"
+ }
+ ],
+ "valentine_compliments": [
+ {
+ "message": "To the love of my life. I’m the luckiest person on Earth because I have you! I adore you!You’ve taught me the best thing to hold onto in life is each other.You are my sweetheart, you are my life, you are my everything."
+ },
+ {
+ "message": "It was a million tiny little things that, when you added them all up, they meant we were supposed to be together."
+ },
+ {
+ "message": "when you smile, the whole world stops and stares for a while, cause you're amazing, just the way you ar"
+ },
+ {
+ "message": "Take love, multiply it by infinity and take it to the depths of forever... and you still have only a glimpse of how I feel for you."
+ },
+ {
+ "message": "When you kiss me, the world just melts away. When you hold me in your arms, I feel safe. Being in love with you has made me see how wonderful life can be. I love you. "
+ },
+ {
+ "message": "No matter how dark the days get, you still know how to make me smile and Even after all this time, you still take my breath away. "
+ },
+ {
+ "message": "I don't know what my future holds but I know I want you in it but I would travel to the moon and back just to see you smile."
+ },
+ {
+ "message": "I may not always say it but know that With every breath in my body and every beat of my heart I know I will always love you. "
+ },
+ {
+ "message": "And darling I will be loving you 'til we're 70. And baby my heart could still fall as hard at 23. And I'm thinking 'bout how people fall in love in mysterious ways. Maybe just the touch of a hand. Oh me, I fall in love with you every single day. And I just wanna tell you I am. So honey now. Take me into your loving arms. Kiss me under the light of a thousand stars. Place your head on my beating heart. I'm thinking out loud. Maybe we found love right where we are."
+ },
+ {
+ "message": "I love you. I knew it the minute I met you. I'm sorry it took so long for me to catch up. I just got stuck."
+ },
+ {
+ "message": "You are truly beautiful from within. I am serious! It's not just about how pretty you are (which you are, of course), but you have a beautiful heart."
+ },
+ {
+ "message": "If you could see yourself through my eyes, you would know how much I love you. You hold a very special place in my heart! I will love you forever!"
+ },
+ {
+ "message": "I don’t need a thousand reasons to feel special. All I need is you to live in this world. You are the sunshine of my life."
+ },
+ {
+ "message": "I wish to be everything that brings a smile on your face and happiness in your heart. I want to love you like no else ever did!"
+ },
+ {
+ "message": "Every morning of my life gives you a new reason to love you and to appreciate you for what you’ve given me. You are the one that holds the key to my heart!"
+ },
+ {
+ "message": "Each time I look at you, I just smile to myself and think, ‘I certainly could not have done better’. You are perfect the way you are. I love you honey."
+ },
+ {
+ "message": "Look at the computer keyboard, U and I were placed side by side. That’s how the alphabets should be arranged because my love will never cease to exist as long as it’s you and me."
+ }
+ ]
+
+} \ No newline at end of file
diff --git a/bot/seasons/valentines/be_my_valentine.py b/bot/seasons/valentines/be_my_valentine.py
new file mode 100644
index 00000000..35ced8d0
--- /dev/null
+++ b/bot/seasons/valentines/be_my_valentine.py
@@ -0,0 +1,209 @@
+import logging
+import random
+import typing
+from json import load
+from pathlib import Path
+
+
+import discord
+from discord.ext import commands
+from discord.ext.commands.cooldowns import BucketType
+
+from bot.constants import Colours, Lovefest
+
+log = logging.getLogger(__name__)
+
+HEART_EMOJIS = [":heart:", ":gift_heart:", ":revolving_hearts:", ":sparkling_heart:", ":two_hearts:"]
+EMOJI_1 = random.choice(HEART_EMOJIS)
+EMOJI_2 = random.choice(HEART_EMOJIS)
+
+
+class BeMyValentine:
+ """
+ A cog that sends valentines to other users !
+ """
+ id = Lovefest.role_id
+
+ def __init__(self, bot):
+ self.bot = bot
+
+ @commands.command(name="lovefest")
+ async def add_role(self, ctx):
+ """
+ This command adds people to the lovefest role
+ """
+ user = ctx.author
+ role = discord.utils.get(ctx.guild.roles, id=Lovefest.role_id)
+ if id not in [role.id for role in ctx.message.author.roles]:
+ await user.add_roles(role)
+ await ctx.send("The Lovefest role has been added !")
+ else:
+ await ctx.send("You already have the role !")
+
+ @commands.cooldown(1, 1800, BucketType.user)
+ @commands.group(
+ name='bemyvalentine',
+ invoke_without_command=True
+ )
+ async def send_valentine(self, ctx, user: typing.Optional[discord.Member] = None, *, valentine_type=None):
+ """
+ This command sends valentine to user if specified or a random user having lovefest role.
+
+
+ syntax: .bemyvalentine [user](optional) [p/poem/c/compliment/or you can type your own valentine message]
+ (optional)
+
+ example: .bemyvalentine (sends valentine as a poem or a compliment to a random user)
+
+ example: .bemyvalentine @Iceman#6508 p (sends a poem to Iceman)
+
+ example: .bemyvalentine @Iceman#6508 Hey I love you, wanna hang around ? (sends the custom message to Iceman)
+ """
+ channel = self.bot.get_channel(Lovefest.channel_id)
+ random_user = []
+
+ if user == ctx.author:
+ await ctx.send('Come on dude, you cant send a valentine to yourself :expressionless:')
+
+ elif user is None:
+ for member in ctx.guild.members:
+ for role in member.roles:
+ if role.id == Lovefest.role_id:
+ random_user.append(member)
+ user = random.choice(random_user)
+
+ if valentine_type is None:
+ # grabs a random valentine -can be a poem or a good message
+ valentine, title = self.random_valentine()
+ embed = discord.Embed(
+ title=f"{EMOJI_1} {title} {user.display_name}{EMOJI_2}",
+ color=Colours.pink
+ )
+
+ elif valentine_type in ['p', 'poem']:
+ valentine = self.valentine_poem()
+ embed = discord.Embed(
+ title=f"{EMOJI_1} A poem dedicated to {user.display_name}{EMOJI_2}",
+ color=Colours.pink
+ )
+
+ elif valentine_type in ['c', 'compliment']:
+ valentine = self.valentine_compliment()
+ embed = discord.Embed(
+ title=f"{EMOJI_1} A compliment for {user.display_name}{EMOJI_2}",
+ color=Colours.pink
+ )
+ else:
+ # in this case, the user decides to type his own valentine.
+ valentine = valentine_type
+ embed = discord.Embed(
+ title=f'{EMOJI_1}A message for {user.display_name}{EMOJI_2}',
+ color=Colours.pink
+ )
+
+ embed.description = f'{valentine} \n **{EMOJI_2}From {ctx.author}{EMOJI_1}**'
+ await channel.send(user.mention, embed=embed)
+
+ @commands.cooldown(1, 1800, BucketType.user)
+ @send_valentine.command(name='dm')
+ async def anonymous(self, ctx, user: typing.Optional[discord.Member] = None, *, valentine_type=None):
+ """
+ - This command DMs a valentine to be given anonymous to a user if specified or a random user having lovefest role.
+
+
+ **This command should be DMed to the bot.**
+
+
+ syntax : .bemyvalentine dm [user](optional) [p/poem/c/compliment/or you can type your own valentine message]
+ (optional)
+
+ example : .bemyvalentine dm (sends valentine as a poem or a compliment to a random user in DM making you anonymous)
+
+ example : .bemyvalentine dm Iceman#6508 p (sends a poem to Iceman in DM making you anonymous)
+
+ example : .bemyvalentine dm Iceman#6508 Hey I love you, wanna hang around ? (sends the custom message to Iceman in
+ DM making you anonymous)
+ """
+ random_user = []
+
+ if user == ctx.author:
+ await ctx.send('Come on dude, you cant send a valentine to yourself :expressionless:')
+
+ elif user is None:
+ for member in ctx.guild.members:
+ for role in member.roles:
+ if role.id == Lovefest.role_id:
+ random_user.append(member)
+ user = random.choice(random_user)
+
+ if valentine_type is None:
+ valentine, title = self.random_valentine()
+ embed = discord.Embed(
+ title=f"{EMOJI_1} {title} {user.display_name}{EMOJI_2}",
+ color=Colours.pink
+ )
+
+ elif valentine_type in ['p', 'poem']:
+ valentine = self.valentine_poem()
+ embed = discord.Embed(
+ title=f"{EMOJI_1} A poem dedicated to {user.display_name}{EMOJI_2}",
+ color=Colours.pink
+ )
+
+ elif valentine_type in ['c', 'compliment']:
+ valentine = self.valentine_compliment()
+ embed = discord.Embed(
+ title=f"{EMOJI_1} A compliment for {user.display_name}{EMOJI_1}",
+ color=Colours.pink
+ )
+ else:
+ # in this case, the user decides to type his own valentine.
+ valentine = valentine_type
+ embed = discord.Embed(
+ title=f'{EMOJI_1}A message for {user.display_name}{EMOJI_2}',
+ color=Colours.pink
+ )
+
+ embed.description = f'{valentine} \n **{EMOJI_2}From anonymous{EMOJI_1}**'
+ await user.send(embed=embed)
+
+ @staticmethod
+ def random_valentine():
+ """
+ grabs a random poem or a compliment (any message)
+ """
+ with open(Path('bot', 'resources', 'valentines', 'bemyvalentine_valentines.json'), 'r', encoding="utf8") as f:
+ valentines = load(f)
+ valentine_poem = random.choice(valentines['valentine_poems'])
+ valentine_compliment = random.choice(valentines['valentine_compliments'])
+ random_valentine = random.choice([valentine_compliment, valentine_poem])
+ if random_valentine == valentine_poem:
+ message_type = 'A poem dedicated to'
+ else:
+ message_type = 'A compliment for '
+ return random_valentine['message'], message_type
+
+ @staticmethod
+ def valentine_poem():
+ """
+ grabs a random poem
+ """
+ with open(Path('bot', 'resources', 'valentines', 'bemyvalentine_valentines.json'), 'r', encoding="utf8") as f:
+ valentines = load(f)
+ valentine_poem = random.choice(valentines['valentine_poems'])
+ return valentine_poem['message']
+
+ @staticmethod
+ def valentine_compliment():
+ """
+ grabs a random compliment
+ """
+ with open(Path('bot', 'resources', 'valentines', 'bemyvalentine_valentines.json'), 'r', encoding="utf8") as f:
+ valentines = load(f)
+ valentine_compliment = random.choice(valentines['valentine_compliments'])
+ return valentine_compliment['message']
+
+
+def setup(bot):
+ bot.add_cog(BeMyValentine(bot))
+ log.debug("Be My Valentine cog loaded")