Files
juniteevee-cogs/reactquote/reactquote.py
2022-04-11 09:33:54 -04:00

35 lines
1.1 KiB
Python

from redbot.core import commands
import discord
from datetime import datetime
class ReactQuote(commands.Cog):
"""Cog to store quotes by reacting with speech bubble"""
def __init__(self, bot):
self.bot = bot
def _wrapQuote(self, msg):
return msg
def _buildQuote(self):
embed = discord.Embed()
embed.add_field(name="#1", value="Quoted text will be here", inline=False)
time = datetime.now()
embed.set_footer(text=time.ctime())
return embed
@commands.command()
async def quote(self, ctx: commands.Context):
"""Recall Random Quote"""
# Your code will go here
await ctx.send(embed=self._buildQuote())
@commands.Cog.listener()
async def on_raw_reaction_add(self, payload:discord.RawReactionActionEvent):
"""On React"""
if str(payload.emoji) == '💬':
message: discord.Message = await self.bot.get_channel(payload.channel_id).fetch_message(payload.message_id)
user = payload.member
channel: discord.TextChannel = message.channel
await channel.send("I'd quote that if I could...")