Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
92fb4e5
update readme for more details. Added example .env. Added discord ico…
Mattyfreshy Feb 11, 2024
0e55f8e
update readme for more details. Added example .env. Added discord ico…
Mattyfreshy Feb 11, 2024
6c01290
update readme for more details. Added example .env. Added discord ico…
Mattyfreshy Feb 11, 2024
d6580da
update readme for more details. Added example .env. Added discord ico…
Mattyfreshy Feb 11, 2024
ed51264
update readme. Fixed embed to include profile pic and profile viewibl…
Mattyfreshy Feb 11, 2024
dfaf842
update readme and moved .env.example outside src folder
Mattyfreshy Feb 11, 2024
6f0cdf6
update readme and moved .env.example outside src folder
Mattyfreshy Feb 11, 2024
e5999a0
update readme and moved .env.example outside src folder
Mattyfreshy Feb 11, 2024
73633fb
update readme and moved .env.example outside src folder
Mattyfreshy Feb 11, 2024
4e1ff62
minor readme fix. Updated profile in attacks to include profile menti…
Mattyfreshy Feb 11, 2024
5ed85ef
minor readme fix. Updated profile in attacks to include profile menti…
Mattyfreshy Feb 11, 2024
1ac88eb
removed .env.example and updated readme.
Mattyfreshy Feb 11, 2024
471c6a4
fixed minor mistake with wrong avatar being displayed
Mattyfreshy Feb 11, 2024
a31f75e
branch test
Mattyfreshy Feb 11, 2024
980ac42
undo branch test
Mattyfreshy Feb 11, 2024
cbf9ba4
Merge remote-tracking branch 'upstream/main' into main
Mattyfreshy Feb 11, 2024
0bc96b9
Extract image from most recent attack to display on profile embed
Mattyfreshy Feb 11, 2024
9802afa
beta version pagination of profile attacks
Mattyfreshy Feb 12, 2024
dc6a339
added feature to view attacks and defense images with buttons to navi…
Mattyfreshy Feb 12, 2024
3937ccc
fixed bug where if user was not registered, users name caused an exce…
Mattyfreshy Feb 12, 2024
cf1342c
Added .env descriptor to readme. Updated /attack to include "Art Figh…
Mattyfreshy Feb 12, 2024
4802027
revert to pre profileIMage feature
Mattyfreshy Feb 13, 2024
ce8299c
Merge remote-tracking branch 'upstream/main' into main
Mattyfreshy Feb 13, 2024
8aa7d1d
undo branch test
Mattyfreshy Feb 11, 2024
3c390e0
Merge branch 'main' of https://github.com/Mattyfreshy/Shells_MF into …
Mattyfreshy Feb 13, 2024
068d109
Added ArtFight to bots attack messages
Mattyfreshy Feb 13, 2024
e4c1d55
Fixed minor misunderstanding with Add Art Fight to the bot's attack m…
Mattyfreshy Feb 14, 2024
51340fb
/attack minor ui updates
Mattyfreshy Feb 14, 2024
31c372b
/attack minor ui updates
Mattyfreshy Feb 14, 2024
c235913
minor UI update
Mattyfreshy Feb 14, 2024
18364fb
Merge remote-tracking branch 'upstream/main' into main
Mattyfreshy Mar 2, 2024
74b76ef
Update: Modified ReadMe and bot's attack messages to sel file structure
Mattyfreshy Mar 2, 2024
d51b757
minor footer icon fix
Mattyfreshy Mar 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
20 changes: 16 additions & 4 deletions src/artfight/attacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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:
Expand Down