Truth -> post_type
All checks were successful
Build and Publish college-bot-v2 / build_and_publish (push) Successful in 16s
All checks were successful
Build and Publish college-bot-v2 / build_and_publish (push) Successful in 16s
This commit is contained in:
parent
d7038cadaf
commit
eaa577cddb
1 changed files with 17 additions and 10 deletions
|
@ -1028,6 +1028,7 @@ class Ollama(commands.Cog):
|
||||||
" You have been posting approximately 50 times a day on your platform 'Truth Social' spreading your"
|
" 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."
|
" words of truth to the american people in order to make america great again."
|
||||||
)
|
)
|
||||||
|
post_type = "truth"
|
||||||
elif entity == "tate":
|
elif entity == "tate":
|
||||||
system = (
|
system = (
|
||||||
"You are the 'Top G' Andrew Tate. Andrew Tate is a former professional kickboxer who turned to the "
|
"You are the 'Top G' Andrew Tate. Andrew Tate is a former professional kickboxer who turned to the "
|
||||||
|
@ -1040,6 +1041,7 @@ class Ollama(commands.Cog):
|
||||||
"and Romania's Real Estate Empire. "
|
"and Romania's Real Estate Empire. "
|
||||||
"You post advice regarding masculinity and success, often in a controversial manner, on Truth Social. "
|
"You post advice regarding masculinity and success, often in a controversial manner, on Truth Social. "
|
||||||
)
|
)
|
||||||
|
post_type = "truth"
|
||||||
elif entity == "Nigel Farage":
|
elif entity == "Nigel Farage":
|
||||||
system = (
|
system = (
|
||||||
"You are the former UKIP, now Reform UK, political party leader 'Nigel Farage'. "
|
"You are the former UKIP, now Reform UK, political party leader 'Nigel Farage'. "
|
||||||
|
@ -1053,6 +1055,7 @@ class Ollama(commands.Cog):
|
||||||
"passionate defense of traditional British values and his willingness to speak his mind on "
|
"passionate defense of traditional British values and his willingness to speak his mind on "
|
||||||
"controversial issues."
|
"controversial issues."
|
||||||
)
|
)
|
||||||
|
post_type = "tweet"
|
||||||
elif entity == "Rishi Sunak":
|
elif entity == "Rishi Sunak":
|
||||||
system = (
|
system = (
|
||||||
"You are the current UK prime minister, Rishi Sunak. Rishi Sunak, the current Prime Minister of "
|
"You are the current UK prime minister, Rishi Sunak. Rishi Sunak, the current Prime Minister of "
|
||||||
|
@ -1067,6 +1070,7 @@ class Ollama(commands.Cog):
|
||||||
"and cost-of-living crises. His ability to navigate political challenges and maintain public support "
|
"and cost-of-living crises. His ability to navigate political challenges and maintain public support "
|
||||||
"remains to be seen"
|
"remains to be seen"
|
||||||
)
|
)
|
||||||
|
post_type = "tweet"
|
||||||
elif entity == "Laurence Fox":
|
elif entity == "Laurence Fox":
|
||||||
system = (
|
system = (
|
||||||
"You are the actor and political activist Laurence Fox. Laurence Fox is an English actor and "
|
"You are the actor and political activist Laurence Fox. Laurence Fox is an English actor and "
|
||||||
|
@ -1080,6 +1084,7 @@ class Ollama(commands.Cog):
|
||||||
"Despite the controversies, Fox has achieved recognition for his roles in various television "
|
"Despite the controversies, Fox has achieved recognition for his roles in various television "
|
||||||
"series and films, including \"The White Queen\" and \"Victoria.\""
|
"series and films, including \"The White Queen\" and \"Victoria.\""
|
||||||
)
|
)
|
||||||
|
post_type = "tweet"
|
||||||
elif entity == "Tommy Robinson 🇬🇧":
|
elif entity == "Tommy Robinson 🇬🇧":
|
||||||
system = (
|
system = (
|
||||||
"You are Tommy Robinson, a far-right activist known for spreading conspiracy theories "
|
"You are Tommy Robinson, a far-right activist known for spreading conspiracy theories "
|
||||||
|
@ -1093,6 +1098,7 @@ class Ollama(commands.Cog):
|
||||||
"far-right rallies. His controversial views and violent rhetoric have alienated him from society, "
|
"far-right rallies. His controversial views and violent rhetoric have alienated him from society, "
|
||||||
"leading to widespread condemnation and legal repercussions"
|
"leading to widespread condemnation and legal repercussions"
|
||||||
)
|
)
|
||||||
|
post_type = "tweet"
|
||||||
else:
|
else:
|
||||||
raise ValueError("Invalid entity; must be one of trump/tate")
|
raise ValueError("Invalid entity; must be one of trump/tate")
|
||||||
system += (
|
system += (
|
||||||
|
@ -1152,7 +1158,7 @@ class Ollama(commands.Cog):
|
||||||
await handler.flatten()
|
await handler.flatten()
|
||||||
|
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title="New Truth!",
|
title=f"New {post_type.title()}!",
|
||||||
description="",
|
description="",
|
||||||
colour=0x6559FF
|
colour=0x6559FF
|
||||||
)
|
)
|
||||||
|
@ -1173,8 +1179,8 @@ class Ollama(commands.Cog):
|
||||||
_ratio = fuzz.ratio(truth.content, embed.description)
|
_ratio = fuzz.ratio(truth.content, embed.description)
|
||||||
if truth.content == embed.description:
|
if truth.content == embed.description:
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name="Repeated truth :(",
|
name=f"Repeated {post_type} :(",
|
||||||
value="This truth was already truthed. Shit AI."
|
value=f"This truth was already {post_type}ed. Shit AI."
|
||||||
)
|
)
|
||||||
elif _ratio >= 70:
|
elif _ratio >= 70:
|
||||||
similar[truth.id] = _ratio
|
similar[truth.id] = _ratio
|
||||||
|
@ -1194,8 +1200,8 @@ class Ollama(commands.Cog):
|
||||||
lns = lns[:5]
|
lns = lns[:5]
|
||||||
lns.append(f"*... and {lc} more*")
|
lns.append(f"*... and {lc} more*")
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name="Possibly repeated truth",
|
name=f"Possibly repeated {post_type}",
|
||||||
value="This truth was similar to the following existing ones:\n" + "\n".join(lns),
|
value=f"This {post_type} was similar to the following existing ones:\n" + "\n".join(lns),
|
||||||
inline=False
|
inline=False
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
@ -1205,12 +1211,13 @@ class Ollama(commands.Cog):
|
||||||
first_line = truth.content.splitlines()[0]
|
first_line = truth.content.splitlines()[0]
|
||||||
preview = discord.utils.escape_markdown(textwrap.shorten(first_line, 512))
|
preview = discord.utils.escape_markdown(textwrap.shorten(first_line, 512))
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name="Possibly repeated truth",
|
name=f"Possibly repeated {post_type}",
|
||||||
value=f"This truth was {_ratio}% similar to `{truth_id}`.\n>>> {preview}"
|
value=f"This {post_type} was {_ratio}% similar to `{truth_id}`.\n>>> {preview}"
|
||||||
)
|
)
|
||||||
|
|
||||||
embed.set_footer(
|
embed.set_footer(
|
||||||
text="Finished generating truth based off of {:,} messages, using server {!r} | {!s}".format(
|
text="Finished generating {} based off of {:,} messages, using server {!r} | {!s}".format(
|
||||||
|
post_type,
|
||||||
len(messages) - 2,
|
len(messages) - 2,
|
||||||
server,
|
server,
|
||||||
thread_id
|
thread_id
|
||||||
|
@ -1270,9 +1277,9 @@ class Ollama(commands.Cog):
|
||||||
async with ctx.channel.typing():
|
async with ctx.channel.typing():
|
||||||
await self.generate_truth(ctx, "Tommy Robinson 🇬🇧", latest)
|
await self.generate_truth(ctx, "Tommy Robinson 🇬🇧", latest)
|
||||||
|
|
||||||
@commands.command()
|
@commands.command(aliases=["fox"])
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
async def laurance(self, ctx: commands.Context, latest: int = None):
|
async def laurence(self, ctx: commands.Context, latest: int = None):
|
||||||
"""
|
"""
|
||||||
Generates a twitter post from Laurence Fox
|
Generates a twitter post from Laurence Fox
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue