modified: bot.py
This commit is contained in:
16
bot.py
16
bot.py
@@ -644,10 +644,19 @@ async def leave(ctx):
|
|||||||
await ctx.send("Left the voice channel.")
|
await ctx.send("Left the voice channel.")
|
||||||
else:
|
else:
|
||||||
await ctx.send("I am not in a voice channel.")
|
await ctx.send("I am not in a voice channel.")
|
||||||
|
|
||||||
|
|
||||||
@client.hybrid_command()
|
@client.hybrid_command()
|
||||||
@commands.has_permissions(administrator=True)
|
|
||||||
async def toggle_feature(ctx, feature: str, state: str):
|
async def toggle_feature(ctx, feature: str, state: str):
|
||||||
"""Enables or disables a feature like askmultus or vision."""
|
"""Allows admin to enable or disable features based on user permissions."""
|
||||||
|
user_id = ctx.author.id
|
||||||
|
user_data = load_user_data(user_id)
|
||||||
|
user_perms = user_data["permission"]
|
||||||
|
|
||||||
|
if user_perms < 8: # Nur Admins (permission level >= 8) können Funktionen aktivieren/deaktivieren
|
||||||
|
await ctx.send("You do not have the necessary permissions to toggle features.")
|
||||||
|
return
|
||||||
|
|
||||||
global features
|
global features
|
||||||
|
|
||||||
if feature.lower() not in features:
|
if feature.lower() not in features:
|
||||||
@@ -663,6 +672,9 @@ async def toggle_feature(ctx, feature: str, state: str):
|
|||||||
else:
|
else:
|
||||||
await ctx.send("Please specify 'on' or 'off'.")
|
await ctx.send("Please specify 'on' or 'off'.")
|
||||||
|
|
||||||
|
await ctx.send("Please specify 'on' or 'off'.")
|
||||||
|
|
||||||
|
|
||||||
@client.hybrid_command()
|
@client.hybrid_command()
|
||||||
async def version(ctx):
|
async def version(ctx):
|
||||||
"""Displays the current version of the bot."""
|
"""Displays the current version of the bot."""
|
||||||
|
|||||||
Reference in New Issue
Block a user