-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
56 lines (45 loc) · 1.57 KB
/
bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from discord.ext import commands
import discord
import config
import os
intents = discord.Intents(members= True, guilds=True, reactions=True,messages = True,presences=True )
Bot = commands.Bot(command_prefix = "$", intents = intents)
TOKEN = config.TOKEN
@Bot.event
async def on_ready():
print("I'm ready")
await Bot.change_presence(activity=discord.Game(name="ctf.pwnlab.me'de"))
@Bot.event
async def on_member_join(member):
channel =discord.utils.get(member.guild.text_channels, name="🔄》hareketler")
await channel.send(f"{member.mention} bize katıldı. Hoş geldi!")
@Bot.event
async def on_command_error(ctx, error):
await ctx.send(error)
@Bot.command()
@commands.has_role("Yönetici")
async def clear(ctx, amount=10):
await ctx.channel.purge(limit=amount)
@Bot.command()
@commands.has_role("Yönetici")
async def send(ctx, message):
await ctx.channel.purge(limit=1)
await ctx.send(message)
@Bot.command()
@commands.has_role("Yönetici")
async def load(ctx, extension):
Bot.load_extension(f"cogs.{extension}")
@Bot.command()
@commands.has_role("Yönetici")
async def unload(ctx, extension):
Bot.unload_extension(f"cogs.{extension}")
@Bot.command()
@commands.has_role("Yönetici")
async def reload(ctx, extension):
Bot.unload_extension(f"cogs.{extension}")
Bot.load_extension(f"cogs.{extension}")
await ctx.send(f"{extension} has reloaded")
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
Bot.load_extension(f"cogs.{filename[:-3]}")
Bot.run(TOKEN)