turdbot/py/cogs/repost.py
ionburger 95af75a5c2 yed
2023-12-14 18:47:29 -07:00

23 lines
712 B
Python

from discord.ext import bridge, commands
import discord
from bin.storage import storage
#import opencv
#from bin.imagematcher import imagematcher
class Repost(commands.Cog):
def __init__(self, bot):
self.bot = bot
@bridge.bridge_command()
async def repost(self, ctx):
st = storage("test", self.bot.db)
#referenceimgurl = ctx.channel.fetch_message(ctx.message.reference.message_id).attachments[0].url
msgs = await ctx.channel.history(limit=100).flatten()
l = {}
for msg in msgs:
for attachment in msg.attachments:
l[msg.id] = attachment.url
st.db("test", "test", l)
def setup(bot):
bot.add_cog(Repost(bot))