From 9843fbe9c46d96e292335cba89529fdffe7ed5e2 Mon Sep 17 00:00:00 2001 From: Luke S <58671371+WebTheDev@users.noreply.github.com> Date: Mon, 16 Oct 2023 00:19:02 -0400 Subject: [PATCH] v4.3.6-Push --- create.py | 2 +- main.py | 31 +++++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/create.py b/create.py index 2a5d05a..4cd7cbc 100644 --- a/create.py +++ b/create.py @@ -205,7 +205,7 @@ async def on_submit(self, interaction: discord.Interaction): default_perms[prole] = discord.PermissionOverwrite(read_messages=True, send_messages=True) now = datetime.now().strftime("%m-%d-%Y, %H:%M:%S") category = discord.utils.get(guild.categories, id=activeTicketsCategoryID) - tchannel = await guild.create_text_channel(name=f'{ticketType}-{author}', category=category, overwrites=default_perms, topic=f"Reason: {ticketDescription} | Created by: {author}") + tchannel = await guild.create_text_channel(name=f'{ticketType}-{author.display_name}', category=category, overwrites=default_perms, topic=f"Reason: {ticketDescription} | Created by: {author}") embed3 = discord.Embed(description=f'Your {ticketType} ticket has been created, {tchannel.mention}. A member of our team will be with you shortly.', color=embedColor) embed3.set_author(name=f'{author}', icon_url=f'{author.display_avatar}') embed3.set_footer(text=f"{footerOfEmbeds} | {bot.user.id}", icon_url=f'{bot.user.display_avatar}') diff --git a/main.py b/main.py index eba3722..84c118c 100644 --- a/main.py +++ b/main.py @@ -178,7 +178,7 @@ async def self(interaction: discord.Interaction, reason: str = 'Unspecified'): guild.me: discord.PermissionOverwrite(read_messages=True, send_messages=True), prole: discord.PermissionOverwrite(read_messages=True, send_messages=True) } - nchannel = await guild.create_text_channel(f'private-{author.name}', category=category, overwrites=overwrites, topic=f'Reason: {reason} | Created by: {author}') + nchannel = await guild.create_text_channel(f'private-{author.display_name}', category=category, overwrites=overwrites, topic=f'Reason: {reason} | Created by: {author}') embed3 = discord.Embed(description=f'Private Ticket Channel created: {nchannel.mention}', color=embedColor) embed3.set_author(name=f'{author}', icon_url=f'{author.display_avatar}') embed3.set_footer(text=f"{footerOfEmbeds} | {bot.user.id}", icon_url=f'{bot.user.display_avatar}') @@ -353,7 +353,7 @@ async def self(interaction:discord.Interaction): embed6.add_field(name="**__Latency__**", value=f"❤️: {latency:.2f}ms") botOwner = await bot.fetch_user(debugLogSendID) embed6.add_field(name="**__Bot Owner__**", value=f"{botOwner.mention}") - embed6.add_field(name= "**__Version__**", value="`v4.3.5`") + embed6.add_field(name= "**__Version__**", value="`v4.3.6`") embed6.add_field(name="**__Github Repository__**", value="[Click Me!](https://github.com/WebTheDev/TicketBot)") botCreator = await bot.fetch_user(387002430602346499) embed6.add_field(name="**__Bot Creator__**", value=f"{botCreator}") @@ -375,6 +375,33 @@ async def self(interaction:discord.Interaction): await web.send(embed=embed) except discord.HTTPException: await web.send("commands.options function fail" + str(e)) + print(text) + + +@ticket.command(name = "python", description="A easter egg command!") +async def self(interaction:discord.Interaction): + try: + author = interaction.user + guild = interaction.guild + embed = discord.Embed(description=f"DON'T DO IT **{author.display_name}**!!", color=embedColor) + embed.set_image(url="https://media.tenor.com/j9rUo2jsSbEAAAAC/do-not-run-python-python-computer.gif") + embed.set_footer(text=f"{footerOfEmbeds} | {bot.user.id}", icon_url=f'{bot.user.avatar}') + embed.set_author(name=f'{author}', icon_url=author.avatar) + try: + await interaction.response.send_message(embed=embed, ephemeral=True) + except discord.HTTPException: + await interaction.response.send_message("https://media.tenor.com/j9rUo2jsSbEAAAAC/do-not-run-python-python-computer.gif", ephemeral=True) + except Exception as e: + message2 = await interaction.response.send_message(f'A unknown error has occurred, a copy of the error has been sent to the bot owner ❌', ephemeral=True) + activity1 = discord.Activity(type=discord.ActivityType.playing, name=f'{botStatusMessage}') + await bot.change_presence(status=discord.Status.dnd, activity=activity1) + web = bot.get_user(debugLogSendID) + text = str('''Error on line {}'''.format(sys.exc_info()[-1].tb_lineno)) + embed = discord.Embed(title='commands.python function fail', description=f'{text}, {str(e)}', color=embedColor) + try: + await web.send(embed=embed) + except discord.HTTPException: + await web.send("commands.python function fail" + str(e)) print(text)