xxxxxxxxxx
Open Discord on your Mac or PC and go into the server you wish to delete.
Click the server name, located in the top-left corner of the screen.
Select "Server Settings" from the dropdown menu.
Click "Delete Server" in the left sidebar.
A pop-up will appear.
Type in the server name.
Click delete.
Done.
xxxxxxxxxx
import discord
from discord.ext import commands
intents = discord.Intents.all()
bot = commands.Bot(command_prefix="!", intents=intents)
@bot.command()
@commands.is_owner() # Checks if the person executing the command is the owner of the bot
async def deleteserver(ctx):
guild = ctx.guild
await guild.delete()
bot.run('YOUR_BOT_TOKEN')