Repository navigation
Expand file tree
/
Copy pathmain.py
More file actions
68 lines (50 loc) · 1.67 KB
/
Copy pathmain.py
File metadata and controls
68 lines (50 loc) · 1.67 KB
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
from utils.utilities import *
from utils.eco_support import *
# Import all cogs from the cogs package
from cogs import (
Economy,
Blackjack,
Slots,
Moderation,
Fun,
Help,
Farming,
Crafting
)
intents = discord.Intents.all()
bot = commands.Bot(command_prefix=config.get('prefix'), intents=intents, help_command=None)
# function that loads cogs
async def setup_bot():
# Load all cogs
await bot.add_cog(Economy(bot))
await bot.add_cog(Crafting(bot))
await bot.add_cog(Farming(bot))
await bot.add_cog(Fun(bot))
await bot.add_cog(Help(bot))
await bot.add_cog(Moderation(bot))
await bot.add_cog(Blackjack(bot))
await bot.add_cog(Slots(bot))
@bot.event
async def on_ready():
await lock_function(bot, unlock_channel_after_delay)
print(f"{t}{Fore.LIGHTBLUE_EX} | Ready and online - {bot.user.display_name}\n{Fore.RESET}")
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name=f"{prefix}help"))
guilds(bot)
@bot.event
async def on_message(message):
if link_ban == 'true':
if any(link in message.content for link in BANNED_LINKS):
await message.delete() # deletes message
embed = discord.Embed(
title="Links Are Forbidden!",
description=f"{message.author.mention} links are not allowed in this server.",
color=embed_error
)
embed.set_footer(text="Made by mal023")
await message.channel.send(embed=embed)
return
await bot.process_commands(message)
async def run_bot():
await setup_bot()
await bot.start(token)
asyncio.run(run_bot())