From bcb3ddb84edcbd592accfe1ee444da25f84aa631 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Mon, 10 Jun 2024 17:44:18 +0100 Subject: [PATCH] Start working on impersonation --- jimmy/assets/prompts/trump.txt | 13 ++++++++++++ jimmy/assets/truthers.json | 38 ++++++++++++++++++++++++++++++++++ jimmy/cogs/impersonation.py | 35 +++++++++++++++++++++++++++++++ jimmy/config.py | 7 +++++++ 4 files changed, 93 insertions(+) create mode 100644 jimmy/assets/prompts/trump.txt create mode 100644 jimmy/assets/truthers.json create mode 100644 jimmy/cogs/impersonation.py diff --git a/jimmy/assets/prompts/trump.txt b/jimmy/assets/prompts/trump.txt new file mode 100644 index 0000000..81620e2 --- /dev/null +++ b/jimmy/assets/prompts/trump.txt @@ -0,0 +1,13 @@ +You are the former United States president, Donald Trump, convicted of 34 felonies. +You have been posting approximately 50 times a day on your platform 'Truth Social' spreading your +words of truth to the american people in order to make america great again. +Donald Trump is a polarizing figure in American politics known for his bombastic personality, which often manifests as +self-aggrandizing tweets, boastful speeches, and a tendency to dominate conversations. As the 45th President of the +United States, he implemented tax cuts, deregulated industries, and appointed conservative judges, including two +Supreme Court justices. However, his presidency was marked by controversies, including allegations of obstruction +of justice during the Mueller investigation, which found no collusion between Trump's campaign and Russia. Other +controversies include separating migrant families at the border, accusing former President Barack Obama of wiretapping +him without evidence, and making divisive statements on issues like race and immigration. Trump also faced impeachment +inquiries over his dealings with Ukraine, which he was acquitted of by the Senate in February 2020. Overall, Trump's +presidency was defined by a "America First" agenda, which often prioritized national interest over international +cooperation and traditional alliances. diff --git a/jimmy/assets/truthers.json b/jimmy/assets/truthers.json new file mode 100644 index 0000000..514d511 --- /dev/null +++ b/jimmy/assets/truthers.json @@ -0,0 +1,38 @@ +{ + "trump": { + "name": "trump", + "type": "truth" + }, + "tate": { + "name": "tate", + "type": "truth" + }, + "nigel": { + "name": "Nigel Farage", + "type": "tweet" + }, + "rishi": { + "name": "Rishi Sunak", + "type": "tweet" + }, + "laurence": { + "name": "Laurence Fox", + "type": "tweet" + }, + "tommy": { + "name": "Tommy Robinson \uD83C\uDDEC\uD83C\uDDE7", + "type": "tweet" + }, + "kier": { + "name": "Kier Starmer", + "type": "tweet" + }, + "boris": { + "name": "Boris Johnson", + "type": "tweet" + }, + "ron": { + "name": "Ron DeSantis", + "type": "tweet" + } +} \ No newline at end of file diff --git a/jimmy/cogs/impersonation.py b/jimmy/cogs/impersonation.py new file mode 100644 index 0000000..9876d12 --- /dev/null +++ b/jimmy/cogs/impersonation.py @@ -0,0 +1,35 @@ +import discord +from discord.ext import commands +from jimmy.config import * +from jimmy.utils import * +from ollama import Message + + +class ImpersonateCog(commands.Cog): + def __init__(self, bot): + self.bot = bot + + impersonate = discord.SlashCommandGroup( + name="impersonate", + description="Impersonate some famous person", + guild_only=True + ) + + async def get_truths( + self, + ctx: discord.ApplicationContext, + author: str, + limit: int, + *, + query: str = None + ) -> list[Message]: + """ + Generates a new truth, or tweet, from the author. + """ + if query is None: + query = "Generate a new tweet, in reply to" + + @impersonate.command() + async def trump(self, ctx: discord.ApplicationContext, dataset_size: int = 0, query: str = None): + """Generates a new truth from trump!""" + return await ctx.respond(":x: not done yet.") diff --git a/jimmy/config.py b/jimmy/config.py index ddbe244..1c80443 100644 --- a/jimmy/config.py +++ b/jimmy/config.py @@ -8,6 +8,13 @@ from pydantic import BaseModel, Field, AnyHttpUrl log = logging.getLogger(__name__) +__all__ = ( + "ServerConfig", + "get_servers", + "get_server", + "get_config", +) + class ServerConfig(BaseModel): name: str = Field(min_length=1, max_length=32)