So, I have been working on a killswitch for my bot in discord.py, and I've hit a stump. My kill switch is not working and it's not giving me an error. If anyone can help I would very much appreciate it.
import discord
from discord.ext import commands, tasks
from keep_alive import keep_alive
import asyncio
import random
import json
import random
import discord.utils
from datetime import datetime
client = commands.Bot(command_prefix=',')
client.remove_command('help')
@client.event
async def on_ready():
global startdate
startdate = datetime.now()
await client.change_presence(
status=discord.Status.online,
activity=discord.Game('Type "," to activate me! e'))
print('Bot is ready.')
@client.command(aliases=["shut", "shutdown", "quit", "stop_that", "stahp", "kill"])
@commands.has_permissions(administrator=True)
async def stop(ctx, member: discord.Member = None):
embed = discord.Embed(colour=discord.Green())
embed.add_field(name="I have been Killed", value=f"{member.name} has killed me! That's very unpog of them!", inline=False)
embed.set_image(url="")
embed.set_thumbnail(url="")
embed.set_footer(text=f"Killed By: {ctx.author.name}")
await ctx.send(embed=embed)
await client.logout()
client.run('no token for you :)')