misc: changed coco to autoreact, removed polarisxpconvert command

This commit is contained in:
Seaswimmer 2023-08-08 14:56:55 -04:00
parent ad393dde4b
commit 06599441e4
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -14,27 +14,10 @@ class Galaxy(commands.Cog):
self.bot = bot self.bot = bot
self.config = Config.get_conf(self, identifier=6621962) self.config = Config.get_conf(self, identifier=6621962)
self.config.register_guild( self.config.register_guild(
cocotarget = 0, autoreact_target = 0,
cocoemoji = 1028535684757209118 autoreact_emoji = 1028535684757209118
) )
@commands.command(aliases=["pxc", "pc", "polarisconvert", "tatsutopolaris", "ttp"])
@commands.guild_only()
async def polarisxpconvert(self, ctx, *, tatsu_studs: str):
"""Converts Tatsu Studs to Polaris XP."""
try:
tatsu_studs_int = int(f"{tatsu_studs}".replace(",", ""))
except ValueError:
await ctx.send(content="Please input a number!")
return
math = round((tatsu_studs_int/25)*10)
output_from = f'{tatsu_studs_int:,}'
output_to = f'{math:,}'
embed = discord.Embed(color=await self.bot.get_embed_color(None))
embed.add_field(name="Tatsu Studs", value=f"{output_from}", inline=False)
embed.add_field(name="Polaris XP", value=f"{output_to}", inline=False)
await ctx.send(embed=embed)
@commands.command() @commands.command()
@checks.is_owner() @checks.is_owner()
async def nslookup(self, ctx: commands.Context, *, website: str): async def nslookup(self, ctx: commands.Context, *, website: str):
@ -47,7 +30,6 @@ class Galaxy(commands.Cog):
except FileNotFoundError: except FileNotFoundError:
await ctx.send("`nslookup` command not found. Make sure you have `nslookup` installed and it's in your system PATH.") await ctx.send("`nslookup` command not found. Make sure you have `nslookup` installed and it's in your system PATH.")
@commands.command() @commands.command()
async def galaxyissues(self, ctx, target: discord.Member = None): async def galaxyissues(self, ctx, target: discord.Member = None):
if ctx.me.id == 1070819799254438039: if ctx.me.id == 1070819799254438039:
@ -68,35 +50,35 @@ class Galaxy(commands.Cog):
await ctx.send(f"Output link: {output}") await ctx.send(f"Output link: {output}")
@commands.Cog.listener('on_message') @commands.Cog.listener('on_message')
async def cocoreact(self, message): async def autoreact(self, message):
if message.guild is not None: if message.guild is not None:
emoji_id = await self.config.guild(message.guild).cocoemoji() emoji_id = await self.config.guild(message.guild).autoreact_emoji()
if self.check_if_discord_unicode_emoji(emoji_id) is False: if self.check_if_discord_unicode_emoji(emoji_id) is False:
emoji = self.bot.get_emoji(emoji_id) emoji = self.bot.get_emoji(emoji_id)
elif self.check_if_discord_unicode_emoji(emoji_id) is True: elif self.check_if_discord_unicode_emoji(emoji_id) is True:
emoji = emoji_id emoji = emoji_id
cocotarget = await self.config.guild(message.guild).cocotarget() autoreact_target = await self.config.guild(message.guild).autoreact_target()
if cocotarget == 0: if autoreact_target == 0:
return return
if not message.author.id == cocotarget: if not message.author.id == autoreact_target:
return return
await message.add_reaction(emoji) await message.add_reaction(emoji)
@commands.command(name='coco') @commands.command(name='autoreact')
@commands.guild_only() @commands.guild_only()
async def coco_list(self, ctx: commands.Context): async def autoreact_list(self, ctx: commands.Context):
"""Checks who Coco is currently set to.""" """Checks Autoreact's settings."""
emoji_id = await self.config.guild(ctx.guild).cocoemoji() emoji_id = await self.config.guild(ctx.guild).autoreact_emoji()
cocotarget = await self.config.guild(ctx.guild).cocotarget() autoreact_target = await self.config.guild(ctx.guild).autoreact_target()
if self.check_if_discord_unicode_emoji(emoji_id) is True: if self.check_if_discord_unicode_emoji(emoji_id) is True:
emoji = emoji_id emoji = emoji_id
embed = discord.Embed(color=await self.bot.get_embed_color(None), description=f"Coco is currently set to <@{cocotarget}> ({cocotarget}).\nCoco's emoji is currently set to {emoji}.") embed = discord.Embed(color=await self.bot.get_embed_color(None), description=f"Autoreact is currently set to target <@{autoreact_target}> ({autoreact_target}).\Autoreact's emoji is currently set to {emoji}.")
else: else:
emoji = self.bot.get_emoji(emoji_id) emoji = self.bot.get_emoji(emoji_id)
embed = discord.Embed(color=await self.bot.get_embed_color(None), description=f"Coco is currently set to <@{cocotarget}> ({cocotarget}).\nCoco's emoji is currently set to {emoji} ({await self.config.guild(ctx.guild).cocoemoji()}).") embed = discord.Embed(color=await self.bot.get_embed_color(None), description=f"Autoreact is currently set to target <@{autoreact_target}> ({autoreact_target}).\Autoreact's emoji is currently set to {emoji} ({await self.config.guild(ctx.guild).autoreact_emoji()}).")
await ctx.send(embed=embed) await ctx.send(embed=embed)
coco = app_commands.Group(name='coco', guild_only=True, description="This group handles the autoreact functionality.") autoreact = app_commands.Group(name='autoreact', guild_only=True, description="This group handles the autoreact functionality.")
def check_if_discord_unicode_emoji(self, emoji: str): def check_if_discord_unicode_emoji(self, emoji: str):
emoji_ranges = [ emoji_ranges = [
@ -122,14 +104,14 @@ class Galaxy(commands.Cog):
else: else:
return input_string return input_string
@coco.command(name="emoji") @autoreact.command(name="emoji")
@app_commands.describe(emoji="Which emoji are you setting Coco to use?") @app_commands.describe(emoji="Which emoji are you setting Autoreact to use?")
async def coco_emoji(self, interaction: discord.Interaction, emoji: str = None): async def autoreact_emoji(self, interaction: discord.Interaction, emoji: str = None):
"""Sets Coco's emoji.""" """Sets autoreact's emoji."""
if emoji: if emoji:
if self.check_if_discord_unicode_emoji(emoji) is True: if self.check_if_discord_unicode_emoji(emoji) is True:
await self.config.guild(interaction.guild).cocoemoji.set(emoji) await self.config.guild(interaction.guild).autoreactemoji.set(emoji)
embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"Coco's emoji has been set to {emoji}.") embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"Autoreact's emoji has been set to {emoji}.")
await interaction.response.send_message(embed=embed) await interaction.response.send_message(embed=embed)
else: else:
emoji_id = self.extract_id(input_string=emoji) emoji_id = self.extract_id(input_string=emoji)
@ -139,32 +121,32 @@ class Galaxy(commands.Cog):
emoji_obj = emoji_to_find emoji_obj = emoji_to_find
break break
else: else:
await interaction.response.send_message(content=f"You're trying to set the coco emoji to an emoji I don't have access to!", ephemeral=True) await interaction.response.send_message(content=f"You're trying to set the autoreact emoji to an emoji I don't have access to!", ephemeral=True)
return return
await self.config.guild(interaction.guild).cocoemoji.set(emoji_obj.id) await self.config.guild(interaction.guild).autoreact_emoji.set(emoji_obj.id)
embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"Coco's emoji has been set to {emoji_obj} ({emoji_obj.id}).") embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"Autoreact's emoji has been set to {emoji_obj} ({emoji_obj.id}).")
await interaction.response.send_message(embed=embed) await interaction.response.send_message(embed=embed)
else: else:
await self.config.guild(interaction.guild).cocoemoji.set('💀') await self.config.guild(interaction.guild).autoreact_emoji.set('💀')
embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"Coco's emoji has been set to 💀.") embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"Autoreact's emoji has been set to 💀.")
await interaction.response.send_message(embed=embed) await interaction.response.send_message(embed=embed)
@coco.command(name="set") @autoreact.command(name="set")
@app_commands.describe(member="Who are you targetting?") @app_commands.describe(member="Who are you targetting?")
async def coco_set(self, interaction: discord.Interaction, member: discord.Member): async def autoreact_set(self, interaction: discord.Interaction, member: discord.Member):
"""Sets Coco's target.""" """Sets Autoreact's target."""
if member: if member:
await self.config.guild(interaction.guild).cocotarget.set(member.id) await self.config.guild(interaction.guild).autoreact_target.set(member.id)
embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"Coco has been set to {member.mention} ({member.id}).") embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"Autoreact has been set to automatically react to {member.mention} ({member.id})'s messages.")
await interaction.response.send_message(embed=embed) await interaction.response.send_message(embed=embed)
else: else:
await interaction.response.send_message(content="That is not a valid argument!", ephemeral=True) await interaction.response.send_message(content="That is not a valid argument!", ephemeral=True)
@coco.command(name="reset") @autoreact.command(name="reset")
async def coco_reset(self, interaction: discord.Interaction): async def autoreact_reset(self, interaction: discord.Interaction):
"""Resets Coco's target.""" """Resets Autoreact's target."""
await self.config.guild(interaction.guild).cocotarget.set(0) await self.config.guild(interaction.guild).autoreact_target.set(0)
embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"Coco has been reset.") embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"Autoreact's target has been reset.")
await interaction.response.send_message(embed=embed) await interaction.response.send_message(embed=embed)
@commands.command() @commands.command()