Huge update, making dale-bot commands usable as an app instead of just in my server
All checks were successful
Build and push / changes (push) Successful in 3s
Build and push / Lint-Python (push) Successful in 2s
Build and push / Build-and-Push-Docker (push) Successful in 2m51s
Build and push / sync-argocd-app (push) Successful in 2s
Build and push / post-status-to-discord (push) Successful in 2s

This commit is contained in:
Luke R 2025-03-04 08:14:22 -08:00
parent 4658bcd85b
commit 2e7377d3c1
15 changed files with 650 additions and 156 deletions

View File

@ -14,6 +14,15 @@ class ActualUtils(commands.Cog):
guild_ids=None, guild_ids=None,
name="translate", name="translate",
description="Translate a string", description="Translate a string",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
@option( @option(
"query", "query",
@ -35,6 +44,15 @@ class ActualUtils(commands.Cog):
guild_ids=None, guild_ids=None,
name="youtube", name="youtube",
description="Search youtube for the passed in query", description="Search youtube for the passed in query",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
@option( @option(
"query", "query",
@ -59,6 +77,15 @@ class ActualUtils(commands.Cog):
guild_ids=None, guild_ids=None,
name="define", name="define",
description="Grabs the highest rated definition from urban dictionary", description="Grabs the highest rated definition from urban dictionary",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
@option( @option(
name="word", name="word",
@ -71,21 +98,35 @@ class ActualUtils(commands.Cog):
await ctx.defer() await ctx.defer()
await ctx.send_followup(embed=define_word.get_definition(word)) await ctx.send_followup(embed=define_word.get_definition(word))
@commands.command(name="tts") @commands.slash_command(
async def tts(self, ctx: commands.Context): name="tts",
description="Use google's text-to-speech to make an mp3",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
)
@option(
name="input",
description="The text to turn into an mp3",
required=True,
)
async def tts(self, ctx: discord.ApplicationContext, input: str):
import tts import tts
if ctx.message.content.split()[1] == "langs": file_path = tts.text_to_speech(input)
await ctx.send("Ok {}, check your DMs".format(ctx.message.author.mention)) await ctx.defer()
return await ctx.message.author.send(tts.get_all_langs()) await ctx.send_followup(
file_path = tts.text_to_speech(ctx.message.content)
await ctx.send(
file=discord.File( file=discord.File(
file_path, file_path,
filename="A Message From {}.mp3".format(ctx.message.author.name), filename="A Message From {}.mp3".format(ctx.author.name),
) )
) )
await ctx.message.delete()
os.remove(file_path) os.remove(file_path)
@commands.slash_command( @commands.slash_command(
@ -113,6 +154,15 @@ class ActualUtils(commands.Cog):
guild_ids=None, guild_ids=None,
name="weather", name="weather",
description="Get current weather for a location", description="Get current weather for a location",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
@option( @option(
name="location", name="location",
@ -204,6 +254,15 @@ class ActualUtils(commands.Cog):
guild_ids=None, guild_ids=None,
name="wifiqr", name="wifiqr",
description="Generate a qr code for your wifi network", description="Generate a qr code for your wifi network",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
@option( @option(
name="network_name", name="network_name",
@ -236,6 +295,15 @@ class ActualUtils(commands.Cog):
guld_ids=None, guld_ids=None,
name="stock", name="stock",
description="Enter one or many stock tickers to get info about them", description="Enter one or many stock tickers to get info about them",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
@option( @option(
name="symbols", description="Stocks to look up the price for", required=True name="symbols", description="Stocks to look up the price for", required=True

View File

@ -10,42 +10,43 @@ class AnimalFunctions(commands.Cog):
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="redpanda", description="Posts a photo of a redpanda" guild_ids=None, name="redpanda", description="Posts a photo of a redpanda"
) )
async def redpanda(self, ctx: commands.Context): async def redpanda(self, ctx: discord.ApplicationContext):
await ctx.respond(animals.get_red_panda()) await ctx.respond(animals.get_red_panda())
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="dog", description="Posts a photo of a Dog" guild_ids=None, name="dog", description="Posts a photo of a Dog"
) )
async def dog(self, ctx: commands.Context): async def dog(self, ctx: discord.ApplicationContext):
await ctx.respond(animals.get_dog()) await ctx.respond(animals.get_dog())
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="sheeb", description="Posts a photo of a Sheeb" guild_ids=None, name="sheeb", description="Posts a photo of a Sheeb"
) )
async def sheeb(self, ctx: commands.Context): async def sheeb(self, ctx: discord.ApplicationContext):
await ctx.defer() await ctx.defer()
await ctx.send_followup(animals.random_sheeb()) await ctx.send_followup(animals.random_sheeb())
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="cowboy", description="Posts a photo of a bad dog" guild_ids=None, name="cowboy", description="Posts a photo of a bad dog"
) )
async def cowboy(self, ctx: commands.Context): async def cowboy(self, ctx: discord.ApplicationContext):
await ctx.respond(animals.cowboy()) await ctx.respond(animals.cowboy())
@commands.slash_command( @commands.slash_command(
guild_ids=None, guild_ids=None,
name="dale", name="dale",
description="Posts a photo of the goodest boy. Rest in power king", description="Posts a photo of the goodest boy. Rest in power king",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def dale_slash(self, ctx: commands.Context): async def dale_slash(self, ctx: discord.ApplicationContext):
await ctx.defer()
await ctx.send_followup(file=discord.File(animals.dale()))
@commands.user_command(
guild_ids=None,
name="dale",
)
async def dale_user(self, ctx: commands.Context, user: discord.Member):
await ctx.defer() await ctx.defer()
await ctx.send_followup(file=discord.File(animals.dale())) await ctx.send_followup(file=discord.File(animals.dale()))

View File

@ -1,3 +1,4 @@
import discord
from discord import option from discord import option
from discord.ext import commands from discord.ext import commands
import core_utils import core_utils
@ -8,9 +9,20 @@ class AnimeGirls(commands.Cog):
self.bot: commands.Bot = bot self.bot: commands.Bot = bot
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="yeet", description="Posts a gif of an anime girl yeeting" guild_ids=None,
name="yeet",
description="Posts a gif of an anime girl yeeting",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def yeet(self, ctx: commands.Context): async def yeet(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="yeet") embed_url=core_utils.waifu_pics(endpoint="yeet")
@ -21,8 +33,17 @@ class AnimeGirls(commands.Cog):
guild_ids=None, guild_ids=None,
name="cuddle", name="cuddle",
description="Posts a gif of an anime girl cuddleing", description="Posts a gif of an anime girl cuddleing",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def cuddle(self, ctx: commands.Context): async def cuddle(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="cuddle") embed_url=core_utils.waifu_pics(endpoint="cuddle")
@ -30,9 +51,20 @@ class AnimeGirls(commands.Cog):
) )
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="awoo", description="Posts a gif of a dog/anime girl" guild_ids=None,
name="awoo",
description="Posts a gif of a dog/anime girl",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def awoo(self, ctx: commands.Context): async def awoo(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="awoo") embed_url=core_utils.waifu_pics(endpoint="awoo")
@ -43,8 +75,17 @@ class AnimeGirls(commands.Cog):
guild_ids=None, guild_ids=None,
name="bonk", name="bonk",
description="Posts a gif of an anime bonking someone on the head", description="Posts a gif of an anime bonking someone on the head",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def bonk(self, ctx: commands.Context): async def bonk(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="bonk") embed_url=core_utils.waifu_pics(endpoint="bonk")
@ -52,9 +93,20 @@ class AnimeGirls(commands.Cog):
) )
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="glomp", description="Posts a gif of an aggressive hug" guild_ids=None,
name="glomp",
description="Posts a gif of an aggressive hug",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def glomp(self, ctx: commands.Context): async def glomp(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="glomp") embed_url=core_utils.waifu_pics(endpoint="glomp")
@ -62,9 +114,20 @@ class AnimeGirls(commands.Cog):
) )
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="pout", description="Posts a gif of an anime girl pouting" guild_ids=None,
name="pout",
description="Posts a gif of an anime girl pouting",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def pout(self, ctx: commands.Context): async def pout(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="blush") embed_url=core_utils.waifu_pics(endpoint="blush")
@ -72,9 +135,20 @@ class AnimeGirls(commands.Cog):
) )
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="waifu", description="Posts a gif of an anime girl" guild_ids=None,
name="waifu",
description="Posts a gif of an anime girl",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def waifu(self, ctx: commands.Context): async def waifu(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="waifu") embed_url=core_utils.waifu_pics(endpoint="waifu")
@ -82,9 +156,20 @@ class AnimeGirls(commands.Cog):
) )
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="neko", description="Posts a gif of a cat/anime girl" guild_ids=None,
name="neko",
description="Posts a gif of a cat/anime girl",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def neko(self, ctx: commands.Context): async def neko(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="neko") embed_url=core_utils.waifu_pics(endpoint="neko")
@ -95,8 +180,17 @@ class AnimeGirls(commands.Cog):
guild_ids=None, guild_ids=None,
name="bully", name="bully",
description="Posts a gif of an anime girl bullying someone", description="Posts a gif of an anime girl bullying someone",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def bully(self, ctx: commands.Context): async def bully(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="bully") embed_url=core_utils.waifu_pics(endpoint="bully")
@ -104,9 +198,20 @@ class AnimeGirls(commands.Cog):
) )
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="cry", description="Posts a gif of an anime girl crying" guild_ids=None,
name="cry",
description="Posts a gif of an anime girl crying",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def cry(self, ctx: commands.Context): async def cry(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="cry") embed_url=core_utils.waifu_pics(endpoint="cry")
@ -114,9 +219,20 @@ class AnimeGirls(commands.Cog):
) )
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="hug", description="Posts a gif of an anime girl huging" guild_ids=None,
name="hug",
description="Posts a gif of an anime girl huging",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def hug(self, ctx: commands.Context): async def hug(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="hug") embed_url=core_utils.waifu_pics(endpoint="hug")
@ -124,9 +240,20 @@ class AnimeGirls(commands.Cog):
) )
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="kiss", description="Posts a gif of an anime girl kissing" guild_ids=None,
name="kiss",
description="Posts a gif of an anime girl kissing",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def kiss(self, ctx: commands.Context): async def kiss(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="kiss") embed_url=core_utils.waifu_pics(endpoint="kiss")
@ -134,9 +261,20 @@ class AnimeGirls(commands.Cog):
) )
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="lick", description="Posts a gif of an anime girl licking" guild_ids=None,
name="lick",
description="Posts a gif of an anime girl licking",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def lick(self, ctx: commands.Context): async def lick(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="lick") embed_url=core_utils.waifu_pics(endpoint="lick")
@ -147,8 +285,17 @@ class AnimeGirls(commands.Cog):
guild_ids=None, guild_ids=None,
name="pat", name="pat",
description="Posts a gif of an anime girl pating someone on the head", description="Posts a gif of an anime girl pating someone on the head",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def pat(self, ctx: commands.Context): async def pat(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="pat") embed_url=core_utils.waifu_pics(endpoint="pat")
@ -159,8 +306,17 @@ class AnimeGirls(commands.Cog):
guild_ids=None, guild_ids=None,
name="smug", name="smug",
description="Posts a gif of an anime girl being smug", description="Posts a gif of an anime girl being smug",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def smug(self, ctx: commands.Context): async def smug(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="smug") embed_url=core_utils.waifu_pics(endpoint="smug")
@ -171,8 +327,17 @@ class AnimeGirls(commands.Cog):
guild_ids=None, guild_ids=None,
name="highfive", name="highfive",
description="Posts a gif of an anime girl highfiveing", description="Posts a gif of an anime girl highfiveing",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def highfive(self, ctx: commands.Context): async def highfive(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="highfive") embed_url=core_utils.waifu_pics(endpoint="highfive")
@ -180,9 +345,20 @@ class AnimeGirls(commands.Cog):
) )
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="nom", description="Posts a gif of an anime girl eating" guild_ids=None,
name="nom",
description="Posts a gif of an anime girl eating",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def nom(self, ctx: commands.Context): async def nom(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="nom") embed_url=core_utils.waifu_pics(endpoint="nom")
@ -193,8 +369,17 @@ class AnimeGirls(commands.Cog):
guild_ids=None, guild_ids=None,
name="bite", name="bite",
description="Posts a gif of an anime girl biting someone", description="Posts a gif of an anime girl biting someone",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def bite(self, ctx: commands.Context): async def bite(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="bite") embed_url=core_utils.waifu_pics(endpoint="bite")
@ -202,9 +387,20 @@ class AnimeGirls(commands.Cog):
) )
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="slap", description="Posts a gif of an anime girl slapping" guild_ids=None,
name="slap",
description="Posts a gif of an anime girl slapping",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def slap(self, ctx: commands.Context): async def slap(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="slap") embed_url=core_utils.waifu_pics(endpoint="slap")
@ -212,9 +408,20 @@ class AnimeGirls(commands.Cog):
) )
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="wink", description="Posts a gif of an anime girl winking" guild_ids=None,
name="wink",
description="Posts a gif of an anime girl winking",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def wink(self, ctx: commands.Context): async def wink(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="wink") embed_url=core_utils.waifu_pics(endpoint="wink")
@ -222,9 +429,20 @@ class AnimeGirls(commands.Cog):
) )
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="poke", description="Posts a gif of an anime girl pokeing" guild_ids=None,
name="poke",
description="Posts a gif of an anime girl pokeing",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def poke(self, ctx: commands.Context): async def poke(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="poke") embed_url=core_utils.waifu_pics(endpoint="poke")
@ -232,9 +450,20 @@ class AnimeGirls(commands.Cog):
) )
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="dance", description="Posts a gif of an anime girl dancing" guild_ids=None,
name="dance",
description="Posts a gif of an anime girl dancing",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def dance(self, ctx: commands.Context): async def dance(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="dance") embed_url=core_utils.waifu_pics(endpoint="dance")
@ -245,8 +474,17 @@ class AnimeGirls(commands.Cog):
guild_ids=None, guild_ids=None,
name="cringe", name="cringe",
description="Posts a gif of an anime girl cringeing", description="Posts a gif of an anime girl cringeing",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def cringe(self, ctx: commands.Context): async def cringe(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="cringe") embed_url=core_utils.waifu_pics(endpoint="cringe")
@ -257,8 +495,17 @@ class AnimeGirls(commands.Cog):
guild_ids=None, guild_ids=None,
name="blush", name="blush",
description="Posts a gif of an anime girl blushing", description="Posts a gif of an anime girl blushing",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def blush(self, ctx: commands.Context): async def blush(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_url=core_utils.waifu_pics(endpoint="blush") embed_url=core_utils.waifu_pics(endpoint="blush")
@ -267,9 +514,20 @@ class AnimeGirls(commands.Cog):
@commands.slash_command(guild_ids=None, name="owo", description="owo-afies text") @commands.slash_command(guild_ids=None, name="owo", description="owo-afies text")
@option( @option(
name="input_string", description="The text you want owo-afied", required=True name="input_string",
description="The text you want owo-afied",
required=True,
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def owo(self, ctx: commands.Context, input_string: str): async def owo(self, ctx: discord.ApplicationContext, input_string: str):
from owotext import OwO from owotext import OwO
uwu = OwO() uwu = OwO()

View File

@ -63,7 +63,7 @@ class Cheeky(commands.Cog):
await ctx.respond(embed=embed) await ctx.respond(embed=embed)
@commands.command(name="coom", pass_context=True) @commands.command(name="coom", pass_context=True)
async def coom(self, ctx: commands.Context, id=None): async def coom(self, ctx: discord.ApplicationContext, id=None):
if ctx.message.author.id != core_utils.my_id: if ctx.message.author.id != core_utils.my_id:
return return
message = list(await ctx.message.channel.history(limit=2).flatten())[-1] message = list(await ctx.message.channel.history(limit=2).flatten())[-1]
@ -78,26 +78,44 @@ class Cheeky(commands.Cog):
guild_ids=None, guild_ids=None,
name="clap", name="clap",
description="Returns your passed in text separated by 👏", description="Returns your passed in text separated by 👏",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
@option( @option(
name="input_string", name="input",
input_type="str", input_type="str",
description="The text you want to split", description="The text you want to split",
required=True, required=True,
) )
async def clap(self, ctx: commands.Context, input_string: str): async def clap(self, ctx: discord.ApplicationContext, input: str):
if len(input_string.split()) == 1: if len(input.split()) == 1:
input_string = [char for char in input_string] input = [char for char in input]
await ctx.respond(" :clap: ".join(input_string)) await ctx.respond(" :clap: ".join(input))
else: else:
await ctx.respond(" :clap: ".join(input_string.split()) + " :clap: ") await ctx.respond(" :clap: ".join(input.split()) + " :clap: ")
@commands.slash_command( @commands.slash_command(
guild_ids=None, guild_ids=None,
name="dracula", name="dracula",
description="Prints a verse from our holy texts 🧛‍♂️", description="Prints a verse from our holy texts 🧛‍♂️",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def dracula(self, ctx: commands.Context): async def dracula(self, ctx: discord.ApplicationContext):
verse = random.choice( verse = random.choice(
requests.get(core_utils.json_endpoint + "dracula_flow").text.splitlines() requests.get(core_utils.json_endpoint + "dracula_flow").text.splitlines()
) )
@ -125,8 +143,17 @@ class Cheeky(commands.Cog):
debug_guild=826547484632678450, debug_guild=826547484632678450,
name="greentext", name="greentext",
description="Posts a greentext image", description="Posts a greentext image",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def greentext(self, ctx: commands.Context): async def greentext(self, ctx: discord.ApplicationContext):
import get_from_reddit import get_from_reddit
embed = discord.Embed( embed = discord.Embed(
@ -144,7 +171,19 @@ class Cheeky(commands.Cog):
await ctx.respond(embed=embed) await ctx.respond(embed=embed)
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="roll", decide="Roll X number of N sided die", type=int guild_ids=None,
name="roll",
decide="Roll X number of N sided die",
type=int,
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
@option(name="num_of_dies", required=True, type=int) @option(name="num_of_dies", required=True, type=int)
@option(name="sides", required=True, description="Number of sides on your die") @option(name="sides", required=True, description="Number of sides on your die")
@ -155,14 +194,26 @@ class Cheeky(commands.Cog):
default=None, default=None,
) )
async def roll( async def roll(
self, ctx: commands.Context, number_of_die, sides, number_to_add=None self, ctx: discord.ApplicationContext, number_of_die, sides, number_to_add=None
): ):
import dice import dice
await ctx.respond(embed=dice.roll(number_of_die, sides, number_to_add)) await ctx.respond(embed=dice.roll(number_of_die, sides, number_to_add))
@commands.slash_command(name="excuse") @commands.slash_command(
async def excuse(self, ctx: commands.Context): name="excuse",
description="Gets a random developer excuse",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
)
async def excuse(self, ctx: discord.ApplicationContext):
import excuse import excuse
await ctx.respond(excuse.get_excuse()) await ctx.respond(excuse.get_excuse())
@ -185,10 +236,19 @@ class Cheeky(commands.Cog):
guild_ids=None, guild_ids=None,
name="meme", name="meme",
description="Generate a dank classic meme. White bold text over an image", description="Generate a dank classic meme. White bold text over an image",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def meme( async def meme(
self, self,
ctx: commands.Context, ctx: discord.ApplicationContext,
template: discord.Option( template: discord.Option(
str, str,
autocomplete=discord.utils.basic_autocomplete(get_all_meme_templates), autocomplete=discord.utils.basic_autocomplete(get_all_meme_templates),
@ -226,13 +286,22 @@ class Cheeky(commands.Cog):
guild_ids=None, guild_ids=None,
name="wallpaper", name="wallpaper",
description="Queries unsplash's API for a wallpaper that matches your tags", description="Queries unsplash's API for a wallpaper that matches your tags",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
@option( @option(
name="tags", name="tags",
description="Space delimited tags you want to use as your query", description="Space delimited tags you want to use as your query",
required=True, required=True,
) )
async def wallpaper(self, ctx: commands.Context, tags): async def wallpaper(self, ctx: discord.ApplicationContext, tags):
import wallpaper import wallpaper
await ctx.defer() await ctx.defer()
@ -240,8 +309,20 @@ class Cheeky(commands.Cog):
embed=core_utils.generate_embed(embed_url=wallpaper.get_wall(tags)) embed=core_utils.generate_embed(embed_url=wallpaper.get_wall(tags))
) )
@commands.slash_command(name="donate") @commands.slash_command(
async def donate(self, ctx: commands.Context): name="donate",
description="Returns my donation links",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
)
async def donate(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
"https://paypal.me/ldooks\nhttps://venmo.com/ldooks\nhttps://cash.app/$ldooks" "https://paypal.me/ldooks\nhttps://venmo.com/ldooks\nhttps://cash.app/$ldooks"
) )
@ -249,7 +330,16 @@ class Cheeky(commands.Cog):
@commands.slash_command( @commands.slash_command(
guild_ids=None, guild_ids=None,
name="tiktok", name="tiktok",
description="Returns a god awful tts with the tiktok voice", description="Returns a god awful text-to-speech with the tiktok voice",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
@option( @option(
name="input", name="input",
@ -257,7 +347,7 @@ class Cheeky(commands.Cog):
description="The text you want as TTS", description="The text you want as TTS",
max_length=300, max_length=300,
) )
async def tiktok(self, ctx: commands.Context, input: str): async def tiktok(self, ctx: discord.ApplicationContext, input: str):
import tempfile import tempfile
import base64 import base64
import json import json
@ -300,10 +390,21 @@ class Cheeky(commands.Cog):
os.remove(file_path + ".mp3") os.remove(file_path + ".mp3")
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="8ball", description="Ask the magic 8 ball a question" guild_ids=None,
name="8ball",
description="Ask the magic 8 ball a question",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
@option(name="question", description="Your question", required=True) @option(name="question", description="Your question", required=True)
async def eight_ball(self, ctx: commands.Context, question: str): async def eight_ball(self, ctx: discord.ApplicationContext, question: str):
import eight_ball import eight_ball
result = eight_ball.check_8ball(question) result = eight_ball.check_8ball(question)
@ -311,46 +412,56 @@ class Cheeky(commands.Cog):
await ctx.respond(":8ball: %s :8ball:" % result) await ctx.respond(":8ball: %s :8ball:" % result)
@commands.slash_command( @commands.slash_command(
name="flows", description="Gets the river flow stats for 3 rivers" name="flows",
description="Gets the river flow stats for 3 rivers",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def flows(self, ctx: commands.Context): async def flows(self, ctx: discord.ApplicationContext):
import river_stats import river_stats
await ctx.defer() await ctx.defer()
result = river_stats.get_stats() result = river_stats.get_stats()
await ctx.send_followup(embed=result) await ctx.send_followup(embed=result)
@commands.slash_command( # @commands.slash_command(
guild_ids=None, # guild_ids=None,
name="tweet", # name="tweet",
description="Returns an image of the pasted in message ID as a tweet", # description="Returns an image of the pasted in message ID as a tweet",
) # )
@option( # @option(
name="message_id", # name="message_id",
description="The message ID to turn into a tweet", # description="The message ID to turn into a tweet",
required=True, # required=True,
) # )
async def twitter(self, ctx: commands.Context, message_id: str): # async def twitter(self, ctx: discord.ApplicationContext, message_id: str):
message = await ctx.channel.fetch_message(message_id) # message = await ctx.channel.fetch_message(message_id)
author_avatar = message.author.avatar # author_avatar = message.author.avatar
response = requests.get( # response = requests.get(
"https://some-random-api.ml/canvas/tweet/?avatar=%s&username=%s&displayname=%s&comment=%s" # "https://some-random-api.ml/canvas/tweet/?avatar=%s&username=%s&displayname=%s&comment=%s"
% ( # % (
author_avatar, # author_avatar,
core_utils.gen_username()[:14], # core_utils.gen_username()[:14],
message.author.display_name, # message.author.display_name,
message.content[:999], # message.content[:999],
) # )
) # )
with open("/tmp/tweet.jpg", "wb") as f: # with open("/tmp/tweet.jpg", "wb") as f:
f.write(response.content) # f.write(response.content)
# await ctx.message.delete() # # await ctx.message.delete()
await ctx.respond(file=discord.File("/tmp/tweet.jpg")) # await ctx.respond(file=discord.File("/tmp/tweet.jpg"))
# @commands.slash_command( # @commands.slash_command(
# guild_ids=None, name="lewd", description="Posts nsfw content" # guild_ids=None, name="lewd", description="Posts nsfw content"
# ) # )
# async def lewd(self, ctx: commands.Context): # async def lewd(self, ctx: discord.ApplicationContext):
# if not ctx.channel.is_nsfw(): # if not ctx.channel.is_nsfw():
# await ctx.send("You can only use this command in NSFW channels") # await ctx.send("You can only use this command in NSFW channels")
# return # return
@ -375,21 +486,39 @@ class Cheeky(commands.Cog):
guild_ids=None, guild_ids=None,
name="freebird", name="freebird",
description="Gives you that good good when you're about to hit em with the flim flam", description="Gives you that good good when you're about to hit em with the flim flam",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def freebird(self, ctx: commands.Context): async def freebird(self, ctx: discord.ApplicationContext):
await ctx.respond("https://youtu.be/xTemcPZw8Eo?t=210") await ctx.respond("https://youtu.be/xTemcPZw8Eo?t=210")
@commands.slash_command( @commands.slash_command(
guild_ids=None, guild_ids=None,
name="bigtext", name="bigtext",
description="Returns your text in big letters", description="Returns your text in big letters",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
@option( @option(
name="input_string", name="input_string",
description="The text you want to make big", description="The text you want to make big",
required=True, required=True,
) )
async def bigtext(self, ctx: commands.Context, input_string: str): async def bigtext(self, ctx: discord.ApplicationContext, input_string: str):
def char_to_emoji(c: str) -> str: def char_to_emoji(c: str) -> str:
"""Convert a character to its corresponding Discord emoji representation.""" """Convert a character to its corresponding Discord emoji representation."""
if c == "!": if c == "!":

View File

@ -33,7 +33,7 @@ class Games(commands.Cog):
) )
async def ffxiv( async def ffxiv(
self, self,
ctx: commands.Context, ctx: discord.ApplicationContext,
player_name: str, player_name: str,
server: discord.Option( server: discord.Option(
str, autocomplete=discord.utils.basic_autocomplete(get_ffxiv_worlds) str, autocomplete=discord.utils.basic_autocomplete(get_ffxiv_worlds)
@ -56,7 +56,7 @@ class Games(commands.Cog):
description="Query Battlefield 2042's API for data about a player", description="Query Battlefield 2042's API for data about a player",
) )
@option("player_name", description="Your Origin/EA account name", required=True) @option("player_name", description="Your Origin/EA account name", required=True)
async def battlefield(self, ctx: commands.Context, player_name: str): async def battlefield(self, ctx: discord.ApplicationContext, player_name: str):
import battlefield import battlefield
await ctx.defer() await ctx.defer()

View File

@ -15,7 +15,7 @@ class Markov(commands.Cog):
description="Generate a markov chain based on a user in the server", description="Generate a markov chain based on a user in the server",
) )
@option("User", description="Choose a member", input_type="user") @option("User", description="Choose a member", input_type="user")
async def markov(self, ctx: commands.Context, user: discord.Member): async def markov(self, ctx: discord.ApplicationContext, user: discord.Member):
await ctx.defer() await ctx.defer()
temp_message = await ctx.followup.send("Just a moment, generating autism") temp_message = await ctx.followup.send("Just a moment, generating autism")

View File

@ -21,7 +21,7 @@ class ServerUtils(commands.Cog):
type=bool, type=bool,
default=False, default=False,
) )
async def invite(self, ctx: commands.Context, temp: bool): async def invite(self, ctx: discord.ApplicationContext, temp: bool):
# Default to creating the invite to the channel the message was sent in # Default to creating the invite to the channel the message was sent in
# if the user is in a voice channel, create the invite there # if the user is in a voice channel, create the invite there
invite_channel = ctx.channel invite_channel = ctx.channel
@ -56,7 +56,7 @@ class ServerUtils(commands.Cog):
@option( @option(
name="emoji_name", description="The name of the emoji to create", required=True name="emoji_name", description="The name of the emoji to create", required=True
) )
async def emoji(self, ctx: commands.Context, url, emoji_name): async def emoji(self, ctx: discord.ApplicationContext, url, emoji_name):
import core_utils import core_utils
await ctx.defer() await ctx.defer()
@ -87,13 +87,22 @@ class ServerUtils(commands.Cog):
@commands.slash_command( @commands.slash_command(
guild_ids=None, guild_ids=None,
name="wordle", name="wordle",
description="Returns a link to the worlde luke is hosting", description="A self-hosted version of worlde",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def wordle(self, ctx: commands.Context): async def wordle(self, ctx: discord.ApplicationContext):
await ctx.respond("https://wordle.luker.fr") await ctx.respond("https://wordle.luker.fr")
@commands.slash_command(guild_ids=None, name="dot", description="dot") @commands.slash_command(guild_ids=None, name="dot", description="dot")
async def dot(self, ctx: commands.Context): async def dot(self, ctx: discord.ApplicationContext):
if ctx.author.id == core_utils.my_id: if ctx.author.id == core_utils.my_id:
for role in ctx.guild.roles: for role in ctx.guild.roles:
try: try:
@ -136,7 +145,7 @@ class ServerUtils(commands.Cog):
name="info", name="info",
description="Posts an embed stats about this discord server", description="Posts an embed stats about this discord server",
) )
async def info(self, ctx: commands.Context): async def info(self, ctx: discord.ApplicationContext):
import datetime import datetime
server = ctx.guild server = ctx.guild
@ -179,7 +188,7 @@ class ServerUtils(commands.Cog):
default=20, default=20,
required=True, required=True,
) )
async def purge(self, ctx: commands.Context, count: int): async def purge(self, ctx: discord.ApplicationContext, count: int):
def is_me(m): def is_me(m):
return m.author == ctx.author return m.author == ctx.author
@ -197,7 +206,7 @@ class ServerUtils(commands.Cog):
default=3, default=3,
required=True, required=True,
) )
async def cleanup(self, ctx: commands.Context, count: int): async def cleanup(self, ctx: discord.ApplicationContext, count: int):
def is_discord_bot(m): def is_discord_bot(m):
return m.author == self.bot.user return m.author == self.bot.user
@ -205,7 +214,7 @@ class ServerUtils(commands.Cog):
await ctx.respond("ok", delete_after=2) await ctx.respond("ok", delete_after=2)
@commands.command(name="shoo") @commands.command(name="shoo")
async def shoo(self, ctx: commands.Context): async def shoo(self, ctx: discord.ApplicationContext):
if ctx.message.author.id != core_utils.my_id: if ctx.message.author.id != core_utils.my_id:
return return
await ctx.message.delete() await ctx.message.delete()
@ -216,7 +225,7 @@ class ServerUtils(commands.Cog):
description="Creates a role, text, and voice channel of the same name", description="Creates a role, text, and voice channel of the same name",
) )
@commands.has_permissions(administrator=True) @commands.has_permissions(administrator=True)
async def vc(self, ctx: commands.Context, channel_role_name): async def vc(self, ctx: discord.ApplicationContext, channel_role_name):
# Check that the role/channel doesnt already exist # Check that the role/channel doesnt already exist
# returns either a string or None, so we'll proceed on the None condition # returns either a string or None, so we'll proceed on the None condition
if discord.utils.find(lambda r: r.name == channel_role_name, ctx.guild.roles): if discord.utils.find(lambda r: r.name == channel_role_name, ctx.guild.roles):

View File

@ -35,7 +35,7 @@ class StableDiffusion(commands.Cog):
) )
async def sd( async def sd(
self, self,
ctx: commands.Context, ctx: discord.ApplicationContext,
positive_prompt: str, positive_prompt: str,
negative_prompt: str, negative_prompt: str,
model_name: str, model_name: str,

View File

@ -28,7 +28,7 @@ class StarCitizen(commands.Cog):
name="medpens", name="medpens",
description="Posts an infographic about which medpens to use for which injuries in Star Citizen", description="Posts an infographic about which medpens to use for which injuries in Star Citizen",
) )
async def post_medpen_guide(self, ctx: commands.Context): async def post_medpen_guide(self, ctx: discord.ApplicationContext):
await ctx.respond("https://i.redd.it/lfswlf5c13t71.png") await ctx.respond("https://i.redd.it/lfswlf5c13t71.png")
@starcitizen.command( @starcitizen.command(
@ -36,7 +36,7 @@ class StarCitizen(commands.Cog):
name="drugs", name="drugs",
description="Returns a list of all the drugs in game sorted by their price", description="Returns a list of all the drugs in game sorted by their price",
) )
async def post_drugs(self, ctx: commands.Context): async def post_drugs(self, ctx: discord.ApplicationContext):
headers = {"api_key": os.getenv("uexcorp_key")} headers = {"api_key": os.getenv("uexcorp_key")}
response = requests.get( response = requests.get(
@ -87,7 +87,7 @@ class StarCitizen(commands.Cog):
) )
async def get_ship( async def get_ship(
self, self,
ctx: commands.Context, ctx: discord.ApplicationContext,
ship: discord.Option( ship: discord.Option(
str, str,
autocomplete=discord.utils.basic_autocomplete(get_all_ships), autocomplete=discord.utils.basic_autocomplete(get_all_ships),
@ -211,7 +211,7 @@ class StarCitizen(commands.Cog):
) )
async def get_price( async def get_price(
self, self,
ctx: commands.Context, ctx: discord.ApplicationContext,
commodity: discord.Option( commodity: discord.Option(
str, autocomplete=discord.utils.basic_autocomplete(get_all_commodities) str, autocomplete=discord.utils.basic_autocomplete(get_all_commodities)
), ),
@ -235,7 +235,7 @@ class StarCitizen(commands.Cog):
) )
async def calculate_trade_profits( async def calculate_trade_profits(
self, self,
ctx: commands.Context, ctx: discord.ApplicationContext,
commodity: discord.Option( commodity: discord.Option(
str, autocomplete=discord.utils.basic_autocomplete(get_all_commodities) str, autocomplete=discord.utils.basic_autocomplete(get_all_commodities)
), ),
@ -255,7 +255,7 @@ class StarCitizen(commands.Cog):
description="The player name to search for", description="The player name to search for",
required=True, required=True,
) )
async def rsi_find(self, ctx: commands.Context, player: str): async def rsi_find(self, ctx: discord.ApplicationContext, player: str):
await ctx.defer() await ctx.defer()
embed = await star_citizen.rsi_find(player=player) embed = await star_citizen.rsi_find(player=player)
await ctx.send_followup(embed=embed) await ctx.send_followup(embed=embed)

View File

@ -73,21 +73,39 @@ class Tarkov(commands.Cog):
return bosses return bosses
@tarkov.command( @tarkov.command(
guild_ids=core_utils.my_guilds, guild_ids=None,
name="kappa", name="kappa",
description="Posts an image with all kappa tasks", description="Posts a link to a google doc containing all the tasks you need for kappa",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def post_kappa(self, ctx: commands.Context): async def post_kappa(self, ctx: discord.ApplicationContext):
await ctx.respond( await ctx.respond(
"https://docs.google.com/spreadsheets/d/1lwU7T1Yxt0s28xZdfFRiDEYH7BbwOkZfsv-Ozv1Ka00/edit?gid=1115791232#gid=1115791232" "https://docs.google.com/spreadsheets/d/1lwU7T1Yxt0s28xZdfFRiDEYH7BbwOkZfsv-Ozv1Ka00/edit?gid=1115791232#gid=1115791232"
) )
@tarkov.command( @tarkov.command(
guild_ids=core_utils.my_guilds, guild_ids=None,
name="traders", name="traders",
description="Time until trader resets", description="Time until trader resets",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def trader_resets(self, ctx: commands.Context): async def trader_resets(self, ctx: discord.ApplicationContext):
await ctx.defer() await ctx.defer()
embed = discord.Embed( embed = discord.Embed(
description="-------", color=discord.Color.blue(), type="rich" description="-------", color=discord.Color.blue(), type="rich"
@ -126,13 +144,22 @@ class Tarkov(commands.Cog):
await ctx.send_followup(embed=embed) await ctx.send_followup(embed=embed)
@tarkov.command( @tarkov.command(
guild_ids=core_utils.my_guilds, guild_ids=None,
name="spawns", name="spawns",
description="Boss Spawn Rates", description="Boss Spawn Rates",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def boss_spawns( async def boss_spawns(
self, self,
ctx: commands.Context, ctx: discord.ApplicationContext,
boss_name: discord.Option( boss_name: discord.Option(
str, str,
autocomplete=discord.utils.basic_autocomplete(get_all_bosses), autocomplete=discord.utils.basic_autocomplete(get_all_bosses),
@ -183,13 +210,22 @@ class Tarkov(commands.Cog):
await ctx.send_followup(embed=embed) await ctx.send_followup(embed=embed)
@tarkov.command( @tarkov.command(
guild_ids=core_utils.my_guilds, guild_ids=None,
name="boss", name="boss",
description="Boss Info", description="Boss Info",
contexts={
discord.InteractionContextType.guild,
discord.InteractionContextType.bot_dm,
discord.InteractionContextType.private_channel,
},
integration_types={
discord.IntegrationType.guild_install,
discord.IntegrationType.user_install,
},
) )
async def boss_info( async def boss_info(
self, self,
ctx: commands.Context, ctx: discord.ApplicationContext,
boss_name: discord.Option( boss_name: discord.Option(
str, autocomplete=discord.utils.basic_autocomplete(get_all_bosses) str, autocomplete=discord.utils.basic_autocomplete(get_all_bosses)
), ),

View File

@ -10,7 +10,7 @@ class Users(commands.Cog):
@commands.slash_command(guild_ids=None, name="avatar") @commands.slash_command(guild_ids=None, name="avatar")
@option("User", description="Choose a member", input_type="user") @option("User", description="Choose a member", input_type="user")
async def avatar(self, ctx: commands.Context, user: discord.Member): async def avatar(self, ctx: discord.ApplicationContext, user: discord.Member):
await ctx.respond( await ctx.respond(
embed=core_utils.generate_embed( embed=core_utils.generate_embed(
embed_title="{}".format(user.name), embed_title="{}".format(user.name),

View File

@ -35,7 +35,7 @@ class Warframe(commands.Cog):
) )
async def get_warframe_mod( async def get_warframe_mod(
self, self,
ctx: commands.Context, ctx: discord.ApplicationContext,
mod: discord.Option( mod: discord.Option(
str, str,
autocomplete=discord.utils.basic_autocomplete(get_all_mods), autocomplete=discord.utils.basic_autocomplete(get_all_mods),

View File

@ -1,6 +1,6 @@
beautifulsoup4 beautifulsoup4
cmagick cmagick
git+https://github.com/pycord-development/pycord@6a69f6683be41e0c983cd0621eab240e86d37086 git+https://github.com/Pycord-Development/pycord
googletrans==4.0.0rc1 googletrans==4.0.0rc1
gTTS gTTS
httpx httpx

View File

@ -11,16 +11,9 @@ def text_to_speech(input):
robot robot
""" """
file, file_path = tempfile.mkstemp() file, file_path = tempfile.mkstemp()
message = " ".join(input.split()[1:])
language = "en" language = "en"
# check for another language denoted at the end of the message
if ";" in message:
print(message.split(";"))
language = message.split(";")[1].strip()
message = message.split(";")[0]
gTTS(text=message, lang=language, slow=False).save(file_path) gTTS(text=input, lang=language, slow=False).save(file_path)
return file_path return file_path

View File

@ -26,7 +26,7 @@ class TrackDays(commands.Cog):
) )
async def trackdays_lookup( async def trackdays_lookup(
self, self,
ctx: commands.Context, ctx: discord.ApplicationContext,
track: discord.Option( track: discord.Option(
str, str,
autocomplete=discord.utils.basic_autocomplete(get_all_tracks), autocomplete=discord.utils.basic_autocomplete(get_all_tracks),