-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathmain.py
66 lines (53 loc) · 1.68 KB
/
main.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
57
58
59
60
61
62
63
64
65
66
# coding: utf-8
import os
import json
import aiohttp
import asyncio
import discord
import subprocess
import datetime
from utils import *
from os import system, name
from discord.ext.commands.core import cooldown
from discord import Permissions
from discord.ext import (
commands,
tasks
)
intents = discord.Intents.default()
intents.members = True
client = commands.Bot(command_prefix=prefix, intents=intents)
client.remove_command('help')
@client.command()
async def spam_send(ctx, count):
try:
with open(spam_text_file, 'r') as spam_text_n:
spam_text = spam_text_n.read()
await ctx.send(spam_text.strip('\"'))
except Exception as e: print(e)
@client.command()
async def load(ctx, extension):
if ctx.author.id == 848621214935154738:
client.load_extension(f"cogs {extension}")
await ctx.send("Cogs loaded!")
else:
await ctx.send("You are not a bot developer.")
@client.command()
async def unload(ctx, extension):
if ctx.author.id == 848621214935154738:
client.unload_extension(f"cogs {extension}")
await ctx.send("Cogs unloaded!")
else:
await ctx.send("You are not a bot developer.")
@client.command()
async def reload(ctx, extension):
if ctx.author.id == 848621214935154738:
client.unload_extension(f"cogs {extension}")
client.load_extension(f"cogs {extension}")
await ctx.send("Cogs reloaded!")
else:
await ctx.send("You are not a bot developer.")
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
client.load_extension(f"cogs.{filename[:-3]}")
client.run(token)