turn off the palworld channel update thing

This commit is contained in:
Luke Robles 2024-02-13 19:31:04 -08:00
parent 7dbabbc8c8
commit d618ab46a1

View File

@ -10,7 +10,7 @@ import os
class PalWorld(commands.Cog):
def __init__(self, bot):
self.bot: commands.Bot = bot
self.poll_server_population.start()
# self.poll_server_population.start()
palworld = discord.SlashCommandGroup("palworld", "Palworld related commands")
@ -171,26 +171,26 @@ class PalWorld(commands.Cog):
"https://img.game8.co/3822502/5ae8382d16bd390dd19f343e87680d51.png/show"
)
@tasks.loop(seconds=60)
async def poll_server_population(self):
# Wait until the bot is ready before we actually start executing code
await self.bot.wait_until_ready()
# @tasks.loop(seconds=60)
# async def poll_server_population(self):
# # Wait until the bot is ready before we actually start executing code
# await self.bot.wait_until_ready()
from source_rcon import SourceRcon
from loguru import logger
# from source_rcon import SourceRcon
# from loguru import logger
logger.disable("source_rcon")
# logger.disable("source_rcon")
rcon = SourceRcon("192.168.1.200", 25575, os.getenv("pal_rcon_pass"))
num_players = len(rcon.send_command("ShowPlayers").split("\n")[1:-1])
# rcon = SourceRcon("192.168.1.200", 25575, os.getenv("pal_rcon_pass"))
# num_players = len(rcon.send_command("ShowPlayers").split("\n")[1:-1])
# channel = self.bot.get_channel(1201389692759842816) # test server
channel = self.bot.get_channel(1199397770746925239)
# # channel = self.bot.get_channel(1201389692759842816) # test server
# channel = self.bot.get_channel(1199397770746925239)
if str(num_players) in channel.name.split("/")[0]:
return
# if str(num_players) in channel.name.split("/")[0]:
# return
await channel.edit(name="Palworlders (%s/16 online)" % num_players)
# await channel.edit(name="Palworlders (%s/16 online)" % num_players)
def setup(bot):