-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
127 lines (114 loc) · 4.25 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
from main_imports import *
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix=commands.when_mentioned_or('??'), intents=intents)
bot.remove_command('help')
@bot.event
async def on_ready():
print('The bot is logged in.')
print('Ready!')
print('Logged in as ---->', bot.user)
print('ID:', bot.user.id)
await bot.change_presence(activity=discord.Game(name=f"Flying Above you..||@perseus help"),status=discord.Status.do_not_disturb)
@bot.event
async def on_guild_join(guild):
channel = bot.get_channel(827923431084654644)
emb = discord.Embed(title=f"Ser ver Joined",color=0xdfab4d)
emb.add_field(name='Server Name', value=f'{guild.name}', inline=False)
emb.add_field(name='Server ID', value=f'{guild.id}', inline=False)
emb.add_field(name='Owner ID', value=f'{guild.owner_id}', inline=False)
emb.add_field(name='Owner name', value=f'<@{guild.owner_id}>', inline=False)
emb.add_field(name='Link To The server', value=f' https://disboard.org/server/{guild.id} ' , inline=False)
emb.add_field(name='Server Members', value=f'{guild.member_count}' , inline=False)
emb.add_field(name='Total Servers', value=f'{len(bot.guilds)}', inline=False)
await channel.send(embed=emb)
@bot.event
async def on_guild_remove(guild):
channel = bot.get_channel(836895991252516874)
emb = discord.Embed(title=f"Server Left",color=0xdfab4d)
emb.add_field(name='Server Name', value=f'{guild.name}', inline=False)
emb.add_field(name='Server ID', value=f'{guild.id}', inline=False)
emb.add_field(name='Owner ID', value=f'{guild.owner_id}', inline=False)
emb.add_field(name='Owner name', value=f'<@{guild.owner_id}>', inline=False)
emb.add_field(name='Total Servers', value=f'{len(client.guilds)}', inline=False)
await channel.send(embed=emb)
extensions=[
'help.help',
'fun.gay',
'fun.meme',
'fun.simp',
'fun.tds',
'fun.wife',
'fun.flip',
'fun.say',
'fun.sendav',
'anime.hug',
'anime.kill',
'anime.nep',
'anime.pat',
'anime.slap',
'botmisc.invite',
'botmisc.report',
'botmisc.support',
'botmisc.vote',
'botmisc.top',
'moderation.announce',
'moderation.ban',
'moderation.kick',
'moderation.purge',
'moderation.role',
'moderation.slowmode',
'moderation.warn',
'nsfw.nsfw',
'misc.misc1'
]
if __name__ == "__main__":
for extension in extensions:
try:
bot.load_extension(extension)
except Exception as e:
print (f"Error loading {extension}", file=sys.stderr)
traceback.print_exc()
@bot.command(
name="logout",
aliases=["disconnect", "close", "stopbot", "die"],
description="Log the bot out of discord!",
)
@commands.is_owner()
async def logout(ctx):
"""
If the user running the command owns the bot then this will disconnect the bot from discord.
"""
embed3 = discord.Embed(
title="Logging out...",
color=0xdF7C00,
description=
f"All proccess are getting terminated and bot is looging out in __**3**__ "
)
embed2 = discord.Embed(
title="Logging out...",
color=0xdF4D00,
description=
f"All proccess are getting terminated and bot is looging out in __**2**__ "
)
embed1 = discord.Embed(
title="Logging out...",
color=0xdF1300,
description=
f"All proccess are getting terminated and bot is looging out in __**1**__ "
)
embed = discord.Embed(
title="Logged out...",
color=000000,
description=
f"All proccess are succefully terminated and the bot is logged out "
)
message = await ctx.send(embed=embed3)
await asyncio.sleep(1)
await message.edit(embed=embed2)
await asyncio.sleep(1)
await message.edit(embed=embed1)
await asyncio.sleep(1)
await message.edit(embed=embed)
await bot.logout()
bot.run(os.getenv('TOKEN'))