From 0fef7c899ca93733a8aebb23c91c9ef08c4e3c04 Mon Sep 17 00:00:00 2001 From: bobloy Date: Mon, 3 Aug 2020 15:18:56 -0400 Subject: [PATCH] Use socialscan until sherlock works --- sherlock/sherlock.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/sherlock/sherlock.py b/sherlock/sherlock.py index c76d894..79ec7db 100644 --- a/sherlock/sherlock.py +++ b/sherlock/sherlock.py @@ -1,5 +1,7 @@ +import discord from redbot.core import Config, commands from redbot.core.bot import Red +from socialscan.util import Platforms, execute_queries, sync_execute_queries class Sherlock(commands.Cog): @@ -9,15 +11,37 @@ class Sherlock(commands.Cog): Less important information about the cog """ + platforms = [ + Platforms.GITHUB, + Platforms.GITLAB, + Platforms.INSTAGRAM, + Platforms.REDDIT, + Platforms.SNAPCHAT, + Platforms.SPOTIFY, + Platforms.PINTEREST, + Platforms.TUMBLR, + Platforms.TWITTER, + Platforms.LASTFM, + ] + def __init__(self, bot: Red): super().__init__() self.bot = bot - self.config = Config.get_conf(self, identifier=0, force_registration=True) # TODO: Identifier + self.config = Config.get_conf( + self, identifier=0, force_registration=True + ) # TODO: Identifier default_guild = {} self.config.register_guild(**default_guild) @commands.command() - async def sherlock(self, ctx: commands.Context): + async def sherlock(self, ctx: commands.Context, member: discord.abc.User): + queries = {member.display_name} + if isinstance(member, discord.Member): + queries.add(member.nick) + queries = list(queries) + + results = await execute_queries(queries=queries, platforms=self.platforms) + await ctx.send("Hello world")