Simple Customizable Discord Bot!
Автор: Patch Games
Загружено: 2025-06-10
Просмотров: 615
Make your own customizable Discord bot in under a minute! 🔧
Perfect for beginners — no experience needed.
Control messages, add commands, and more!
My Patreon:
https://patreon.com/PatchGames?utm_me...
✨ Full code in the description.
👍 Like & sub for more cool Python + Discord projects!
#discordbot #pythonshorts #coding #discord #botdev #programming #pythonproject #techshorts #codingshorts #discordbots
Code:
import discord
from discord.ext import commands
import logging
from dotenv import load_dotenv
import os
load_dotenv()
token = os.getenv('DISCORD_TOKEN')
handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w')
intents = discord.Intents.default()
intents.message_content = True
intents.members = True
bot = commands.Bot(command_prefix='!', intents=intents)
gamer_role = "Gamer"
@bot.event
async def on_ready():
print(f"We are ready to go in, {bot.user.name}")
@bot.event
async def on_member_join(member):
await member.send(f"Welcome to the server, {member.name}!")
@bot.event
async def on_message(message):
if message.author == bot.user:
return
if "s**t" in message.content.lower():
await message.delete()
await message.channel.send(f"{message.author.mention}, please refrain from using inappropriate language.")
if "f**k" in message.content.lower():
await message.delete()
await message.channel.send(f"{message.author.mention}, please refrain from using inappropriate language.")
if "d**k" in message.content.lower():
await message.delete()
await message.channel.send(f"{message.author.mention}, please refrain from using inappropriate language.")
if "c**t" in message.content.lower():
await message.delete()
await message.channel.send(f"{message.author.mention}, please refrain from using inappropriate language.")
if "n***r" in message.content.lower():
await message.delete()
await message.channel.send(f"{message.author.mention}, please refrain from using inappropriate language.")
if "c*m" in message.content.lower():
await message.delete()
await message.channel.send(f"{message.author.mention}, please refrain from using inappropriate language.")
if "s**x" in message.content.lower():
await message.delete()
await message.channel.send(f"{message.author.mention}, please refrain from using inappropriate language.")
await bot.process_commands(message)
@bot.command()
async def hello(ctx):
await ctx.send(f"Hello, {ctx.author.mention}!")
@bot.command()
async def Gamer(ctx):
role1 = discord.utils.get(ctx.guild.roles, name=gamer_role)
if role1:
await ctx.author.add_roles(role1)
await ctx.send(f"{ctx.author.mention}, you have been given the {gamer_role} role! and fuck off connor!")
else:
await ctx.send("Role doesn't exist.")
@bot.command()
async def GamerRemove(ctx):
role1 = discord.utils.get(ctx.guild.roles, name=gamer_role)
if role1:
await ctx.author.remove_roles(role1)
await ctx.send(f"{ctx.author.mention}, you removed the {gamer_role} role!")
else:
await ctx.send("Role not found.")
@bot.command()
@commands.has_role(gamer_role)
async def secret(ctx):
await ctx.send("Welcome to the Gamer club!")
@secret.error
async def secret_error(ctx, error):
if isinstance(error, commands.MissingRole):
await ctx.send("You do not have access!")
bot.run(token, log_handler=handler, log_level=logging.DEBUG)

Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: