Skip to content

Commit

Permalink
chore: version 3.19 (#65)
Browse files Browse the repository at this point in the history
* chore: version 3.19

* feat: update to handle new clustering setup
  • Loading branch information
Skelmis committed Dec 17, 2023
1 parent de76bb9 commit 222da50
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion suggestions/bot.py
Expand Up @@ -46,7 +46,7 @@

class SuggestionsBot(commands.AutoShardedInteractionBot, BotBase):
def __init__(self, *args, **kwargs):
self.version: str = "Public Release 3.18"
self.version: str = "Public Release 3.19"
self.main_guild_id: int = 601219766258106399
self.legacy_beta_role_id: int = 995588041991274547
self.automated_beta_role_id: int = 998173237282361425
Expand Down
22 changes: 16 additions & 6 deletions suggestions/cogs/help_guild_cog.py
Expand Up @@ -76,16 +76,26 @@ async def instance_info(
shard_id = self.bot.get_shard_id(guild_id)
cluster_id = (
1
if shard_id < 10
if shard_id < 5
else 2
if shard_id < 20
if shard_id < 10
else 3
if shard_id < 30
if shard_id < 15
else 4
if shard_id < 40
if shard_id < 20
else 5
if shard_id < 50
if shard_id < 25
else 6
if shard_id < 30
else 7
if shard_id < 35
else 8
if shard_id < 40
else 9
if shard_id < 45
else 10
if shard_id < 50
else 11
)

await interaction.send(
Expand Down Expand Up @@ -154,7 +164,7 @@ async def show_bot_status(
title="Bot infrastructure status",
)
down_shards: list[str] = [str(i) for i in range(53)]
down_clusters: list[str] = [str(i) for i in range(1, 7)]
down_clusters: list[str] = [str(i) for i in range(1, 12)]
avg_bot_latency: list[float] = []
async with aiohttp.ClientSession(
headers={"X-API-KEY": os.environ["GARVEN_API_KEY"]}
Expand Down
2 changes: 1 addition & 1 deletion suggestions/main.py
Expand Up @@ -29,7 +29,7 @@ async def create_bot(database_wrapper=None) -> SuggestionsBot:
total_shards = 53
cluster_id = int(os.environ["CLUSTER"])
offset = cluster_id - 1
number_of_shards_per_cluster = 10
number_of_shards_per_cluster = 5
shard_ids = [
i
for i in range(
Expand Down
9 changes: 0 additions & 9 deletions suggestions/zonis_routes.py
Expand Up @@ -79,12 +79,3 @@ async def share_with_devs(self, title, description, sender):
)
embed.set_footer(text=f"Sender: {sender}")
await channel.send(embed=embed)

@client.route()
async def refresh_premium(self, user_id: int):
# TODO Implement the ability to refresh premium states for a user
return True

@client.route()
async def shared_guilds(self, guild_ids: list[int]):
return [gid for gid in guild_ids if gid in self.bot.guild_ids]

0 comments on commit 222da50

Please sign in to comment.