-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathCodeX.py
More file actions
156 lines (134 loc) · 5.9 KB
/
CodeX.py
File metadata and controls
156 lines (134 loc) · 5.9 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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import os
os.system("pip install -r requirements.txt")
import asyncio
import traceback
from threading import Thread
from datetime import datetime
import aiohttp
import discord
from discord.ext import commands
from core import Context
from core.Cog import Cog
from core.axon import axon
from utils.Tools import *
from utils.config import *
import jishaku
import cogs
os.environ["JISHAKU_NO_DM_TRACEBACK"] = "False"
os.environ["JISHAKU_HIDE"] = "True"
os.environ["JISHAKU_NO_UNDERSCORE"] = "True"
os.environ["JISHAKU_FORCE_PAGINATOR"] = "True"
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv("TOKEN")
client = axon()
tree = client.tree
@client.event
async def on_ready():
await client.wait_until_ready()
print("""
\033[1;31m
▄████▄ ▒█████ ▓█████▄ ▓█████ ▒██ ██▒
▒██▀ ▀█ ▒██▒ ██▒▒██▀ ██▌▓█ ▀ ▒▒ █ █ ▒░
▒▓█ ▄ ▒██░ ██▒░██ █▌▒███ ░░ █ ░
▒▓▓▄ ▄██▒▒██ ██░░▓█▄ ▌▒▓█ ▄ ░ █ █ ▒
▒ ▓███▀ ░░ ████▓▒░░▒████▓ ░▒████▒▒██▒ ▒██▒
░ ░▒ ▒ ░░ ▒░▒░▒░ ▒▒▓ ▒ ░░ ▒░ ░▒▒ ░ ░▓ ░
░ ▒ ░ ▒ ▒░ ░ ▒ ▒ ░ ░ ░░░ ░▒ ░
░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░
\033[0m
""")
print("Loaded & Online!")
print(f"Logged in as: {client.user}")
print(f"Connected to: {len(client.guilds)} guilds")
print(f"Connected to: {len(client.users)} users")
try:
synced = await client.tree.sync()
all_commands = list(client.commands)
print(f"Synced Total {len(all_commands)} Client Commands and {len(synced)} Slash Commands")
except Exception as e:
print(e)
@client.event
async def on_command_completion(context: commands.Context) -> None:
if context.author.id == 767979794411028491:
return
full_command_name = context.command.qualified_name
split = full_command_name.split("\n")
executed_command = str(split[0])
webhook_url = "https://discord.com/api/webhooks/1389541229775159356/fnyxoWRhcIt77OLabLZLLCrKxoxQDmEN4yZbUaDMK82-qymTbMMwwQA5WkFJ4zRi0R_l"
async with aiohttp.ClientSession() as session:
webhook = discord.Webhook.from_url(webhook_url, session=session)
if context.guild is not None:
try:
embed = discord.Embed(color=0x000000)
avatar_url = context.author.avatar.url if context.author.avatar else context.author.default_avatar.url
embed.set_author(
name=f"Executed {executed_command} Command By : {context.author}",
icon_url=avatar_url
)
embed.set_thumbnail(url=avatar_url)
embed.add_field(name=" Command Name :",
value=f"{executed_command}",
inline=False)
embed.add_field(
name=" Command Executed By :",
value=f"{context.author} | ID: [{context.author.id}](https://discord.com/users/{context.author.id})",
inline=False)
embed.add_field(
name=" Command Executed In :",
value=f"{context.guild.name} | ID: [{context.guild.id}](https://discord.com/guilds/{context.guild.id})",
inline=False)
embed.add_field(
name=" Command Executed In Channel :",
value=f"{context.channel.name} | ID: [{context.channel.id}](https://discord.com/channels/{context.guild.id}/{context.channel.id})",
inline=False)
embed.timestamp = discord.utils.utcnow()
embed.set_footer(text="Quantum X Development™ ❤️",
icon_url=client.user.display_avatar.url)
await webhook.send(embed=embed)
except Exception as e:
print(f'Command failed: {e}')
traceback.print_exc()
else:
try:
embed1 = discord.Embed(color=0x000000)
avatar_url = context.author.avatar.url if context.author.avatar else context.author.default_avatar.url
embed1.set_author(
name=f"Executed {executed_command} Command By : {context.author}",
icon_url=avatar_url
)
embed1.set_thumbnail(url=avatar_url)
embed1.add_field(name=" Command Name :",
value=f"{executed_command}",
inline=False)
embed1.add_field(
name=" Command Executed By :",
value=f"{context.author} | ID: [{context.author.id}](https://discord.com/users/{context.author.id})",
inline=False)
embed1.set_footer(text=f"Powered by Quantum X Development™",
icon_url=client.user.display_avatar.url)
await webhook.send(embed=embed1)
except Exception as e:
print(f'Command failed: {e}')
traceback.print_exc()
from flask import Flask
from threading import Thread
app = Flask(__name__)
@app.route('/')
def home():
return f"Axon Development™ 2025"
def run():
app.run(host='0.0.0.0', port=8080)
def keep_alive():
server = Thread(target=run)
server.start()
keep_alive()
async def main():
async with client:
os.system("clear")
await client.load_extension("jishaku")
await client.start(TOKEN)
if __name__ == "__main__":
asyncio.run(main())