diff --git a/README.md b/README.md index 7b97686..b60c9f4 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Open for anyone to contribute to. 2. Clone this repository. -3. Navigate into the project directory: +3. Navigate into the `Shells` project directory: ```bash cd Shells @@ -40,12 +40,12 @@ Open for anyone to contribute to. pip install -r requirements.txt ``` -6. Make an environment variables file: +6. Make an environment variables file (`.env`) You should still be in the `Shells` directory: ```bash touch .env ``` -7. Fill in the .env file with the following: +7. Fill in the `.env` file with the following: ```bash DISCORD_TOKEN=your_discord_bot_token diff --git a/src/artfight/attacks.py b/src/artfight/attacks.py index 8694748..9a803d8 100644 --- a/src/artfight/attacks.py +++ b/src/artfight/attacks.py @@ -103,6 +103,7 @@ async def callback_4(interaction: discord.Interaction): ) async def callback_5(interaction: discord.Interaction): confirm_embed = discord.Embed(title="Confirm Attack", color=discord.Colour.light_embed(), description=f"Size: **{select_1.values[0]}**\nFinish: **{select_2.values[0]}**\nColor: **{select_3.values[0]}**\nShading: **{select_4.values[0]}**\nBackground: **{select_5.values[0]}**\n") + confirm_embed.set_author(name="Art Fight", icon_url=interaction.guild.icon.url) await interaction.response.edit_message(content=None, embed=confirm_embed, view=view_6) select_5.callback = callback_5 view_5 = View() @@ -117,13 +118,22 @@ async def success_callback(interaction: discord.Interaction): #self.db_ref_attacks.update({0: "siblings are message ids"}) score_calculation = artfight.utils.size_calc(select_1.values[0]) + artfight.utils.finish_calc(select_2.values[0]) + artfight.utils.color_calc(select_3.values[0]) + artfight.utils.shading_calc(select_4.values[0]) + artfight.utils.background_calc(select_5.values[0]) - content = f"{interaction.user.mention} has attacked {victim.mention} for {score_calculation} points!" - final_embed = discord.Embed(title=f"{interaction.user.name}: {message}", description="", color=discord.Colour.light_embed()) + + content = f"{victim.mention} you have been attacked by {interaction.user.mention}!" + # embed_content = f"**{interaction.user.mention}** has attacked **{victim.mention}** for {score_calculation} points!" + final_embed = discord.Embed(title="", description="", color=discord.Colour.light_embed()) + final_embed.set_author(name=f"{interaction.user.name} : {message}", icon_url=interaction.user.avatar.url) + final_embed.set_footer(text=f"Art Fight", icon_url=interaction.guild.icon.url) + final_embed.set_image(url="attachment://image.png") image_file = await image.to_file(filename="image.png") sent_message = await interaction.channel.send(content=content, embed=final_embed, file=image_file, view=None) - content += f" **attack id: {sent_message.id}**" + + content += f"\n **Attack Id: {sent_message.id}**" + # embed_content += f"\n **Attack Id: {sent_message.id}**" + # final_embed.description = embed_content await sent_message.edit(content=content) + attack_info = {sent_message.id: { "attacker":interaction.user.id, "victim":victim.id, @@ -189,6 +199,7 @@ async def success_callback(interaction: discord.Interaction): self.db_ref_users.update(victim_info) confirmation_embed = discord.Embed(title="**Attack Successfully Sent!**", color=discord.Colour.light_embed()) + confirmation_embed.set_author(name="Art Fight", icon_url=interaction.guild.icon.url) await interaction.response.edit_message(content="", embed=confirmation_embed, view=None) success_button.callback = success_callback @@ -198,6 +209,7 @@ async def success_callback(interaction: discord.Interaction): cancel_button = Button(label="Cancel Attack" ,style=discord.ButtonStyle.danger) async def cancel_callback(interaction: discord.Interaction): cancel_embed = discord.Embed(title="**Attack Cancelled**", description="(feel free to dismiss this message)", color=discord.Colour.light_embed()) + cancel_embed.set_author(name="Art Fight", icon_url=interaction.guild.icon.url) await interaction.response.edit_message(content="", embed=cancel_embed, view=None) cancel_button.callback = cancel_callback @@ -243,7 +255,7 @@ async def view(self, interaction: discord.Interaction, attack_id: str): @af.command(name="delete", description="deletes the specified attack and readjusts your score") async def delete(self, interaction: discord.Interaction, attack_id: str): - permitted_users = ["skarpetky", "spectregray", "___bryant"] + permitted_users = ["skarpetky", "spectregray", "___bryant", "silentvoice._."] curr_attack = self.db_ref_attacks.child(attack_id.strip()).get() if curr_attack is None: