mirror of
https://github.com/TotalFreedomMC/TotalFreedomBot.git
synced 2024-12-22 15:44:57 +00:00
Update server_commands.py
This commit is contained in:
parent
067ef84d11
commit
081e6491f1
1 changed files with 14 additions and 14 deletions
|
@ -16,7 +16,7 @@ class ServerCommands(commands.Cog):
|
|||
@commands.command()
|
||||
@is_liaison()
|
||||
async def eventhost(self, ctx, user: discord.Member):
|
||||
"""Add or remove event host role - liaison only"""
|
||||
"""Add or remove event host role - liaison only."""
|
||||
eventhostrole = ctx.guild.get_role(event_host)
|
||||
if eventhostrole in user.roles:
|
||||
await user.remove_roles(eventhostrole)
|
||||
|
@ -28,7 +28,7 @@ class ServerCommands(commands.Cog):
|
|||
@commands.command()
|
||||
@is_creative_designer()
|
||||
async def masterbuilder(self, ctx, user: discord.Member):
|
||||
"""Add or remove master builder role - ECD only"""
|
||||
"""Add or remove master builder role - ECD only."""
|
||||
master_builder_role = ctx.guild.get_role(master_builder)
|
||||
if master_builder_role in user.roles:
|
||||
await user.remove_roles(master_builder_role)
|
||||
|
@ -40,7 +40,7 @@ class ServerCommands(commands.Cog):
|
|||
@commands.command()
|
||||
@is_staff()
|
||||
async def serverban(self, ctx, user: discord.Member):
|
||||
"""Add or remove server banned role"""
|
||||
"""Add or remove server banned role."""
|
||||
serverbannedrole = ctx.guild.get_role(server_banned)
|
||||
if serverbannedrole in user.roles:
|
||||
await user.remove_roles(serverbannedrole)
|
||||
|
@ -52,7 +52,7 @@ class ServerCommands(commands.Cog):
|
|||
@commands.command()
|
||||
@is_staff()
|
||||
async def start(self, ctx):
|
||||
"""Starts the server"""
|
||||
"""Starts the server."""
|
||||
em = discord.Embed()
|
||||
try:
|
||||
attempt = hit_endpoint('start')
|
||||
|
@ -76,7 +76,7 @@ class ServerCommands(commands.Cog):
|
|||
|
||||
@commands.command()
|
||||
async def uptime(self, ctx):
|
||||
"""Returns the uptime of the VPS"""
|
||||
"""Returns the uptime of the VPS."""
|
||||
em = discord.Embed()
|
||||
em.title = 'VPS Uptime Information'
|
||||
em.description = hit_endpoint('uptime')
|
||||
|
@ -85,7 +85,7 @@ class ServerCommands(commands.Cog):
|
|||
@commands.command()
|
||||
@is_staff()
|
||||
async def stop(self, ctx):
|
||||
"""Stops the server"""
|
||||
"""Stops the server."""
|
||||
em = discord.Embed()
|
||||
try:
|
||||
attempt = hit_endpoint('stop')
|
||||
|
@ -110,7 +110,7 @@ class ServerCommands(commands.Cog):
|
|||
@commands.command(aliases=['adminconsole', 'ac'])
|
||||
@is_staff()
|
||||
async def telnet(self, ctx, *args):
|
||||
"""mv, gtfo, kick, mute or warn from discord"""
|
||||
"""mv, gtfo, kick, mute or warn from discord."""
|
||||
em = discord.Embed()
|
||||
command = ''
|
||||
for arg in args:
|
||||
|
@ -141,7 +141,7 @@ class ServerCommands(commands.Cog):
|
|||
@commands.command()
|
||||
@is_senior()
|
||||
async def kill(self, ctx):
|
||||
"""Kills the server"""
|
||||
"""Kills the server."""
|
||||
em = discord.Embed()
|
||||
try:
|
||||
attempt = hit_endpoint('kill')
|
||||
|
@ -167,7 +167,7 @@ class ServerCommands(commands.Cog):
|
|||
@commands.command()
|
||||
@is_staff()
|
||||
async def restart(self, ctx):
|
||||
"""Restarts the server"""
|
||||
"""Restarts the server."""
|
||||
em = discord.Embed()
|
||||
try:
|
||||
self.bot.telnet_object.session.write(
|
||||
|
@ -187,7 +187,7 @@ class ServerCommands(commands.Cog):
|
|||
@commands.command()
|
||||
@is_senior()
|
||||
async def console(self, ctx, *, command):
|
||||
"""Send a command as console"""
|
||||
"""Send a command as console."""
|
||||
em = discord.Embed()
|
||||
try:
|
||||
self.bot.telnet_object.session.write(
|
||||
|
@ -205,7 +205,7 @@ class ServerCommands(commands.Cog):
|
|||
|
||||
@commands.command(aliases=['status'])
|
||||
async def state(self, ctx):
|
||||
"""Gets the current status of the Server"""
|
||||
."""Gets the current status of the Server."""
|
||||
em = discord.Embed()
|
||||
if get_server_status():
|
||||
em.description = 'Server is online'
|
||||
|
@ -270,14 +270,14 @@ class ServerCommands(commands.Cog):
|
|||
|
||||
@commands.command()
|
||||
async def ip(self, ctx):
|
||||
"""Returns the server IP"""
|
||||
"""Returns the server IP."""
|
||||
await ctx.send(embed=discord.Embed(description='play.totalfreedom.me', title='Server IP'))
|
||||
# pass #discordSRV responds already.
|
||||
|
||||
@commands.command()
|
||||
@is_staff()
|
||||
async def archivereports(self, ctx):
|
||||
"""Archive all in-game reports older than 24 hours"""
|
||||
."""Archive all in-game reports older than 24 hours."""
|
||||
count = 0
|
||||
reports_channel = self.bot.get_channel(reports_channel_id)
|
||||
archived_reports_channel = self.bot.get_channel(
|
||||
|
@ -298,7 +298,7 @@ class ServerCommands(commands.Cog):
|
|||
|
||||
@commands.command(aliases=['lag', 'gc'])
|
||||
async def tps(self, ctx):
|
||||
"""Lag information regarding the server"""
|
||||
"""Lag information regarding the server."""
|
||||
em = discord.Embed()
|
||||
em.title = 'Server lag information'
|
||||
if get_server_status():
|
||||
|
|
Loading…
Reference in a new issue