I’m trying to make a discord bot with enables a Aternos server and I’m trying to make a status voice channel, I’m fairly new to this stuff so it might be a simple mistake.
I’m not getting any errors its just no changing the name
import discord
from discord.ext import commands
from python_aternos import Client
atclient = Client()
atclient.login_with_session('token')
aternos = atclient.account
servs = aternos.list_servers()
myserv = servs[0]
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix='>', intents=intents)
@bot.command()
async def start(ctx):
try:
myserv.start()
await ctx.send("Starting Server")
except Exception as e:
await ctx.send(f"An error occurred: {e}")
@bot.event
async def update():
while true:
sleep(5)
channel = client.get_channel(1234638593704726592)
myserv.fetch()
await channel.edit(name=myserv.status)
bot.run('token')
I wanted the update function to have every 5 seconds it gets the status of the server and change the voice channel name but it did nothing.
New contributor
w01n 187395 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.