Coding Global Background
Coding Global

Wth did I do wrong?

Archiviert 2 years ago
2 Nachrichten
1 Mitglieder
2 years ago
In Discord öffnen
L
lover.boy_sky
PyTorch

import discord from discord.ext import commands intents = discord.Intents.default() intents.members = True bot = commands.Bot(command_prefix='!', intents=intents) @bot.event async def on_ready(): print(f'Logged in as {bot.user}') await bot.change_presence(activity=discord.Game('Aestron>>')) warn_limit = 3 warnings = {} @bot.command() @commands.has_permissions(kick_members=True) async def kick(ctx, member : discord.Member): if member: await member.kick() await ctx.send(f'{member.name} has been kicked.') else: await ctx.send('You need to mention a user to kick.') @bot.command() @commands.has_permissions(ban_members=True) async def ban(ctx, member : discord.Member): if member: await member.ban() await ctx.send(f'{member.name} has been banned.') else: await ctx.send('You need to mention a user to ban.') @bot.command() @commands.has_permissions(manage_messages=True) async def purge(ctx, limit : int): if limit > 0 and limit <= 100: await ctx.channel.purge(limit=limit) else: await ctx.send('Please provide a number between 1 and 100.') @bot.command() @commands.has_permissions(kick_members=True) async def warn(ctx, member : discord.Member): if member: if member.id not in warnings: warnings[member.id] = 1 else: warnings[member.id] += 1 await ctx.send(f'{member.name} has been warned. They now have {warnings[member.id]} warnings.') if warnings[member.id] == warn_limit: await ctx.send(f'{member.name} reached the warning limit and has been kicked.') await member.kick() else: await ctx.send('You need to mention a user to warn.') bot.run(//hidden-token-do-not-copy-lmao//')

Antworten (2)