Skip to content

Commit 533f690

Browse files
committed
very small changes
1 parent af6a196 commit 533f690

3 files changed

Lines changed: 23 additions & 17 deletions

File tree

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
<img src="https://img.shields.io/badge/license-GPL-brightgreen.svg?style=plastic&logo=GNU&label=License">
99
</a>
1010

11-
<a href="https://github.com/astra1dev/PowerConverter/actions/workflows/python-app.yml">
11+
<a href="../../actions/workflows/python-app.yml">
1212
<img src="https://github.com/astra1dev/tack-oh/actions/workflows/python-app.yml/badge.svg?event=push">
1313
</a>
1414

15-
<a href="../../releases/latest">
16-
<img src="https://img.shields.io/github/release/astra1dev/tack-oh.svg?label=version&style=plastic">
17-
</a>
18-
1915
<a href="../../releases">
2016
<img src="https://img.shields.io/github/downloads/astra1dev/tack-oh/total.svg?style=plastic">
2117
</a>
18+
19+
<a href="../../releases/latest">
20+
<img src="https://img.shields.io/github/downloads/astra1dev/tack-oh/latest/total?style=plastic">
21+
</a>
2222

2323
</p>
2424

@@ -40,7 +40,8 @@
4040
> This is a self-hosted bot – meaning you will need to host and maintain your own instance.
4141
4242
# 🛠️ Installation
43+
- Set up your bot on the [Discord developer portal](https://discord.com/developers/applications) if you haven't already.
4344
- Download the necessary files with `git clone https://github.com/astra1dev/tack-oh.git`
4445
- Install the required packages with `python -m pip install -r requirements.txt`
4546
- Edit the file `/settings/.env` to include your bot's token
46-
- Run the bot with `python3 bot.py`
47+
- Run the bot with `python3 bot.py`

bot.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,20 @@
4444
# for uptime calculation
4545
start_time = time.time()
4646

47+
4748
# -------------------- FUNCTIONS -------------------- #
4849
@bot.event
4950
async def on_ready():
51+
"""
52+
Called when the client is done preparing the data received from Discord.
53+
Usually after login is successful and the Client.guilds and co. are filled up.
54+
"""
5055
i = 0
51-
print(f"\n{45*'-'}\n"
52-
f"[✅] {bot.user.name}#{bot.user.discriminator} (ID: {bot.user.id}, Display Name: {bot.user.display_name}) "
53-
f"\n is connected to the following servers:")
56+
print(f"[✅] {bot.user.name}#{bot.user.discriminator} (ID: {bot.user.id}, Display Name: {bot.user.display_name}) "
57+
f"is connected to the following servers:")
5458
for _ in bot.guilds:
5559
print(f"{str(i + 1)}: {str(bot.guilds[i].name)}, ID: {str(bot.guilds[i].id)}")
56-
i = i + 1
57-
print(f"{45*'-'}\n")
60+
i += 1
5861

5962
# Load commands from other files
6063
try:
@@ -72,7 +75,7 @@ async def on_ready():
7275
# Load slash commands
7376
await bot.tree.sync()
7477
afk.start()
75-
print("[✅] Slash commands loaded.")
78+
print("\n[✅] Slash commands loaded.")
7679

7780

7881
class ChallengeView(discord.ui.View):
@@ -108,8 +111,8 @@ async def accept_button(self, interaction: discord.Interaction, button: discord.
108111
return
109112

110113
embed = discord.Embed(title=":video_game: Game: connect4", colour=discord.Colour(0x00ff00),
111-
description=f"{self.board_slots}{self.board.print_board()}\nCurrent Player: {self.player1.mention}\n"
112-
f":flag_white:: Forfeit")
114+
description=f"{self.board_slots}{self.board.print_board()}\nCurrent Player: "
115+
f"{self.player1.mention}\n:flag_white:: Forfeit")
113116
embed.add_field(name=f":red_circle: {self.player1.name}", value="", inline=True)
114117
embed.add_field(name=f":yellow_circle: {self.player2.name}", value="", inline=True)
115118
await self.message.edit(embed=embed, view=None)
@@ -128,7 +131,8 @@ async def decline_button(self, interaction: discord.Interaction, button: discord
128131
await interaction.response.defer()
129132

130133

131-
def create_connect4_embed(title: str, description: str, curr_player: discord.Member, other_player: discord.Member) -> discord.Embed:
134+
def create_connect4_embed(title: str, description: str, curr_player: discord.Member,
135+
other_player: discord.Member) -> discord.Embed:
132136
embed = discord.Embed(title=title, description=description, colour=discord.Colour(0x00ff00))
133137
embed.add_field(name=f":red_circle: {curr_player.name}", value="", inline=True)
134138
embed.add_field(name=f":yellow_circle: {other_player.name}", value="", inline=True)
@@ -195,8 +199,8 @@ async def on_reaction_add(reaction, user) -> None:
195199
return None
196200
else:
197201
embed = discord.Embed(title=":video_game: Game: connect4",
198-
description=f"{board_slots}{curr_board.print_board()}\nCurrent Player: {other_player.mention}"
199-
f"\n:flag_white:: Forfeit",
202+
description=f"{board_slots}{curr_board.print_board()}\nCurrent Player: "
203+
f"{other_player.mention}\n:flag_white:: Forfeit",
200204
colour=discord.Colour(0x00ff00))
201205
embed.add_field(name=f":red_circle: {curr_player.name}", value="", inline=True)
202206
embed.add_field(name=f":yellow_circle: {other_player.name}", value="", inline=True)

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ python-dotenv
33
requests
44
animec
55
peewee
6+
psutil

0 commit comments

Comments
 (0)