-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
69 lines (56 loc) · 2.63 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
67
68
69
import settings
import discord
from discord.ext import commands
import asyncio
from cogs.admin import DebugCommand, EditCommand, PingCommand, StatusCommands, SayCommand
from cogs.faqs import FAQs
from cogs.fun import EnchantCommands, LookForCommand, RandomCommands, LookForView, DeadChat
from cogs.general import JoinAndLeaveMessage, ServerInfoCommand, BotPing, BotPingView
from cogs.giveaway import GiveawayCommand, GAModerationCommands, JudgeGA
from cogs.help import HelpCommand, LinkCommand, Pin, R_u_sure, StarterMessage, StarterView, SyntaxCommand, AskToResolve
from cogs.ideas import IdeaVoteReactions
from cogs.logs import Logs
from cogs.mod import ClearCommand, PunishmentCommands, AutoThreads
from cogs.minecraft import ColorCommand, FileCommand, MessageFormatter, PackformatCommand, SnapshotScraper, TemplateCommand
from cogs.voice_channels import CustomVoiceChannels
from utils.packmcmeta import update_mcmeta_info
logger = settings.logging.getLogger("bot")
cogs = [DebugCommand, EditCommand, PingCommand, StatusCommands,
FAQs,
EnchantCommands, LookForCommand, RandomCommands, DeadChat,
HelpCommand, LinkCommand, Pin, StarterMessage, SyntaxCommand, AskToResolve,
JoinAndLeaveMessage, SayCommand, ServerInfoCommand, BotPing,
GiveawayCommand, GAModerationCommands,
Logs, IdeaVoteReactions,
ClearCommand, PunishmentCommands, AutoThreads,
SnapshotScraper, ColorCommand, FileCommand, MessageFormatter, PackformatCommand, TemplateCommand,
CustomVoiceChannels,]
views = [LookForView, StarterView, R_u_sure, BotPingView]
class AntBot(commands.Bot):
def __init__(self, *, intents: discord.Intents, command_prefix: str):
super().__init__(intents=intents, command_prefix=commands.when_mentioned_or(command_prefix), case_insensitive=True)
async def setup_hook(self):
update_mcmeta_info.start()
#
self.remove_command("help")
for cog in cogs:
await self.add_cog(cog(self))
for view in views:
self.add_view(view())
self.add_view(JudgeGA(self))
await self.tree.sync()
HelpCog = self.get_cog("HelpCommand")
HelpCog.all_features.update({command.name: command.aliases for command in sorted(self.commands, key=lambda cmd: cmd.name)})
del HelpCog.all_features['debug']
logger.info(f"User: {bot.user} (ID: {bot.user.id})")
try:
with open("assets/pfps/online.png", "rb") as file:
await bot.user.edit(avatar=file.read())
except:
logger.warn("pfp ratelimit")
intents = discord.Intents.all()
bot = AntBot(command_prefix="!", intents=intents)
# @bot.tree.command()
# async def saygex(Interaction: discord.Interaction):
# await Interaction.response.send_message("say gex")
bot.run(settings.DISCORD_API_SECRET, root_logger=True)