-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
635 lines (566 loc) · 26.1 KB
/
bot.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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
import discord
from discord.ext import commands, tasks
from discord import app_commands
from mcstatus import JavaServer
from mcrcon import MCRcon
from config import *
intents = discord.Intents.default()
bot = commands.Bot(command_prefix="!", intents=intents)
def send_rcon_command(command):
try:
with MCRcon(RCON_HOST, RCON_PASSWORD, port=RCON_PORT) as rcon_client:
response = rcon_client.command(command)
return response
except Exception as error:
return f"Command error: {error}"
# Config for simple query
@tasks.loop(minutes=1)
async def update_status_message():
try:
data = await query_minecraft_server(IP, PORT)
if data["online"]:
player_count = data["players_online"]
max_players = data["max_players"]
status_message = f"{player_count}/{max_players} players online"
await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.playing, name=status_message))
else:
await bot.change_presence(activity=discord.ActivityType.playing, name="Minecraft server offline")
except Exception as error:
print(f"Error updating status: {error}")
async def query_minecraft_server(ip: str, port: int):
try:
server = JavaServer.lookup(f"{ip}:{port}")
status = await server.async_status()
if status.players.sample:
player_names = [player.name for player in status.players.sample]
else:
player_names = []
return {
"online": True,
"version": status.version.name,
"players_online": status.players.online,
"max_players": status.players.max,
"description": status.description,
"player_names": player_names,
"ping": await server.async_ping(),
}
except Exception as error:
print(f"Error querying the server: {error}")
return {"online": False}
def check_admin_role(interaction) -> bool:
return any(role.id in ALLOWED_ROLE_ID for role in interaction.user.roles)
@bot.event
async def on_ready():
print(f'Logged in as {bot.user.name} ({bot.user.id})')
synced = await bot.tree.sync()
print(f"{len(synced)} commands sycned. Bot ready!")
update_status_message.start() # Start the status update
server_group = app_commands.Group(name="server", description="Server Commands")
@server_group.command(name="status", description="Get the status of a Minecraft server")
async def minecraft(interaction: discord.Interaction):
print(f"Status Command: Called by {interaction.user.name}")
await interaction.response.defer()
data = await query_minecraft_server(IP, PORT)
if data["online"]:
embed = discord.Embed(
title=f"🟢 {bot.user.name} Status",
description=f"{IP}:{PORT} is **online**!",
color=discord.Color.green()
)
ping = data['ping'] * 100
embed.add_field(name="🌍 Version", value=data["version"], inline=True)
embed.add_field(name="📝 Description", value=str(data["description"]), inline=False)
embed.add_field(name="📡 Ping", value=f"{ping:.2f} ms", inline=True)
if data["players_online"] > 0:
players_list = data["player_names"]
if len(players_list) > 50:
players_list = players_list[:50] + ["...and more"]
players_formatted = "\n".join(players_list)
embed.add_field(name=f"👥 Players Online {data['players_online']}/{data['max_players']}", value=players_formatted, inline=False)
else:
embed.add_field(name=f"👥 Players Online {data['players_online']}/{data['max_players']}", value="No players online.", inline=False)
embed.set_thumbnail(url="https://i.ibb.co/QJhHc3d/Userbox-creeper-svg.png")
await interaction.followup.send(embed=embed)
else:
embed = discord.Embed(
title=f"🔴 {bot.name} Status",
description=f"{IP}:{PORT} is **offline**.",
color=discord.Color.red()
)
embed.set_footer(text="Server might be down or unreachable", icon_url="https://i.imgur.com/75gA21p.png")
await interaction.followup.send(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="give", description="Give an item to a player")
async def give(interaction: discord.Interaction, user: str, item: str, amount: int=1):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
print(f"Give Command: Called by {interaction.user.name}. Given to {user}, {item}, {amount}")
command = f"/give {user} {item} {amount}"
response = send_rcon_command(command)
if response.endswith("[HERE]") or response.endswith("was found"):
embed = discord.Embed(
title="Error!",
description="The command was unsuccessful. Please check the server logs for more details.",
color=discord.Color.red()
)
else:
embed = discord.Embed(
title="Item Given",
description=f"**Player:** {user}\n**Item:** {item}\n**Amount:** {amount}",
color=discord.Color.green()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="teleport", description="Teleport a player to another player")
async def teleport(interaction: discord.Interaction, player1: str, player2: str):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
print(f"Teleport Command: Called by {interaction.user.name}. {player1} teleported to {player2}")
command = f"/tp {player1} {player2}"
response = send_rcon_command(command)
if response.endswith("[HERE]") or response.endswith("was found"):
embed = discord.Embed(
title="Error!",
description="The command was unsuccessful. Please check the server logs for more details.",
color=discord.Color.red()
)
else:
embed = discord.Embed(
title="Player Teleported",
description=f"**Player:** {player1}\n**Destination:** {player2}",
color=discord.Color.blue()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="spawn", description="Teleport a player to the spawn")
async def spawn(interaction: discord.Interaction, player: str):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
print(f"Spawn Command: Called by {interaction.user.name}. {user} teleported to spawn.")
command = f"/tp {player} ~ ~ ~"
response = send_rcon_command(command)
if response.endswith("[HERE]") or response.endswith("was found"):
embed = discord.Embed(
title="Error!",
description="The command was unsuccessful. Please check the server logs for more details.",
color=discord.Color.red()
)
else:
embed = discord.Embed(
title="Player Teleported to Spawn",
description=f"**Player:** {player}",
color=discord.Color.purple()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="kick", description="Kick a player from the server")
async def kick(interaction: discord.Interaction, player: str, reason: str):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
command = f"/kick {player} {reason}"
response = send_rcon_command(command)
if response.endswith("[HERE]") or response.endswith("was found"):
embed = discord.Embed(
title="Error!",
description="The command was unsuccessful. Please check the server logs for more details.",
color=discord.Color.red()
)
else:
embed = discord.Embed(
title="Player Kicked",
description=f"**Player:** {player}\n**Reason:** {reason}",
color=discord.Color.red()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="ban", description="Ban a player from the server")
async def ban(interaction: discord.Interaction, player: str, reason: str):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
command = f"/ban {player} {reason}"
response = send_rcon_command(command)
if response.endswith("[HERE]") or response.endswith("was found"):
embed = discord.Embed(
title="Error!",
description="The command was unsuccessful. Please check the server logs for more details.",
color=discord.Color.red()
)
else:
embed = discord.Embed(
title="Player Banned",
description=f"**Player:** {player}\n**Reason:** {reason}",
color=discord.Color.red()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="unban", description="Unban a player from the server")
async def unban(interaction: discord.Interaction, player: str):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
command = f"/pardon {player}"
response = send_rcon_command(command)
if response.endswith("[HERE]") or response.endswith("was found"):
embed = discord.Embed(
title="Error!",
description="The command was unsuccessful. Please check the server logs for more details.",
color=discord.Color.red()
)
else:
embed = discord.Embed(
title="Player Unbanned",
description=f"**Player:** {player}",
color=discord.Color.green()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="advancement", description="Grant or revoke an advancement")
async def advancement(interaction: discord.Interaction, action: str, player: str, advancement: str):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
if action not in ["grant", "revoke"]:
await interaction.response.send_message("Invalid action. Use 'grant' or 'revoke'.", ephemeral=True)
return
command = f"/advancement {action} {player} {advancement}"
response = send_rcon_command(command)
if response.endswith("[HERE]") or response.endswith("was found"):
embed = discord.Embed(
title="Error!",
description="The command was unsuccessful. Please check the server logs for more details.",
color=discord.Color.red()
)
else:
embed = discord.Embed(
title="Advancement Updated",
description=f"**Action:** {action.capitalize()}\n**Player:** {player}\n**Advancement:** {advancement}",
color=discord.Color.gold()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="summon", description="Summon an entity at specified coordinates")
async def summon(interaction: discord.Interaction, entity: str, x: int, y: int, z: int):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
command = f"/summon {entity} {x} {y} {z}"
response = send_rcon_command(command)
if response.endswith("[HERE]"):
embed = discord.Embed(
title="Error!",
description="The command was unsuccessful. Please check the server logs for more details.",
color=discord.Color.red()
)
else:
embed = discord.Embed(
title="Entity Summoned",
description=f"**Entity:** {entity}\n**Coordinates:** X:{x} Y:{y} Z:{z}",
color=discord.Color.orange()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="setworldspawn", description="Summon an entity at specified coordinates")
async def setspawn(interaction: discord.Interaction, x: int, y: int, z: int):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
command = f"/setworldspawn {x} {y} {z}"
response = send_rcon_command(command)
if response.endswith("[HERE]"):
embed = discord.Embed(
title="Error!",
description="The command was unsuccessful. Please check the server logs for more details.",
color=discord.Color.red()
)
else:
embed = discord.Embed(
title="World spawn set!",
description=f"Spawn set at Coordinates:** X:{x} Y:{y} Z:{z}",
color=discord.Color.green()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="weather", description="Change the weather in the game")
async def weather(interaction: discord.Interaction, weather_type: str, duration: int):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
if weather_type not in ["clear", "rain", "thunder"]:
await interaction.response.send_message("Invalid weather type. Use 'clear', 'rain', or 'thunder'.", ephemeral=True)
return
command = f"/weather {weather_type} {duration}"
response = send_rcon_command(command)
if response.endswith("[HERE]"):
embed = discord.Embed(
title="Error!",
description="The command was unsuccessful. Please check the server logs for more details.",
color=discord.Color.red()
)
else:
embed = discord.Embed(
title="Weather Changed",
description=f"**Weather Type:** {weather_type.capitalize()}\n**Duration:** {duration} seconds",
color=discord.Color.blue()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="time", description="Set the time of day")
async def time(interaction: discord.Interaction, time_of_day: str):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
if time_of_day not in ["day", "night", "midnight", "noon"]:
await interaction.response.send_message("Invalid time of day. Use 'day', 'night', 'midnight', or 'noon'.", ephemeral=True)
return
command = f"/time set {time_of_day}"
response = send_rcon_command(command)
if response.endswith("[HERE]"):
embed = discord.Embed(
title="Error!",
description="The command was unsuccessful. Please check the server logs for more details.",
color=discord.Color.red()
)
else:
embed = discord.Embed(
title="Time Set",
description=f"**Time of Day:** {time_of_day.capitalize()}",
color=discord.Color.yellow()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="effect", description="Apply or remove a status effect from a player")
async def effect(interaction: discord.Interaction, action: str, player: str, effect: str, duration: int, amplifier: int = 0):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
if action not in ["give", "clear"]:
await interaction.response.send_message("Invalid action. Use 'give' or 'clear'.", ephemeral=True)
return
command = f"/effect {action} {player} {effect} {duration} {amplifier}"
response = send_rcon_command(command)
if response.endswith("[HERE]") or response.endswith("was found"):
embed = discord.Embed(
title="Error!",
description="The command was unsuccessful. Please check the server logs for more details.",
color=discord.Color.red()
)
else:
embed = discord.Embed(
title="Effect Applied",
description=f"**Action:** {action.capitalize()}\n**Player:** {player}\n**Effect:** {effect}\n**Duration:** {duration} seconds\n**Amplifier:** {amplifier}",
color=discord.Color.pink()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="kill", description="Kill a player or entity")
async def kill(interaction: discord.Interaction, target: str):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
command = f"/kill {target}"
response = send_rcon_command(command)
if response.endswith("[HERE]") or response.endswith("was found"):
embed = discord.Embed(
title="Error!",
description="The command was unsuccessful. Please check the server logs for more details.",
color=discord.Color.red()
)
else:
embed = discord.Embed(
title="Target Killed",
description=f"**Target:** {target}",
color=discord.Color.red()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="xp", description="Adds XP or LEVEL to a player")
@app_commands.describe(
action="Action to perform (add, set, query)",
player="Target player",
amount="Amount of XP or Levels to add/remove",
action2="Type to modify (points or levels)"
)
async def add_xp(
interaction: discord.Interaction,
action: str,
player: str,
amount: int,
action2: str
):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
if action not in ["set", "add", "query"]:
await interaction.response.send_message("Wrong type specified. Use `set`, `add` or `query`.", ephemeral=True)
return
if action2 not in ["points", "levels"]:
await interaction.response.send_message("Wrong type specified. Use `points` or `levels`.", ephemeral=True)
return
if action2 == "points":
command = f"/xp {action} {player} {amount} points"
elif action2 == "levels":
command = f"/xp {action} {player} {amount} levels"
response = send_rcon_command(command)
if response.endswith("[HERE]") or response.endswith("was found"):
embed = discord.Embed(
title="Error!",
description="The command was unsuccessful. Please check the server logs for more details.",
color=discord.Color.red()
)
else:
embed = discord.Embed(
title="Success!",
description=f"**Target:** {player}\n**Action:** {action.capitalize()}\n**Amount:** {amount} {action2}",
color=discord.Color.green()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="locate", description="Locate a specific structure or biome")
async def locate(interaction: discord.Interaction, structure: str):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
command = f"/locate {structure}"
response = send_rcon_command(command)
if response.endswith("[HERE]"):
embed = discord.Embed(
title="Error!",
description="The command was unsuccessful. Please check the server logs for more details.",
color=discord.Color.red()
)
else:
embed = discord.Embed(
title="Structure Located",
description=f"**Structure/Biome:** {structure}",
color=discord.Color.green()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@server_group.command(name="banlist", description="View the ban list")
async def banlist(interaction: discord.Interaction):
command = "/banlist"
response = send_rcon_command(command)
embed = discord.Embed(
title="Ban List",
description="Viewing the ban list.",
color=discord.Color.blue()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@server_group.command(name="list", description="List all online players")
async def list_players(interaction: discord.Interaction):
response = send_rcon_command("/list")
embed = discord.Embed(
title="Online Players",
description="List of all online players.",
color=discord.Color.green()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@server_group.command(name="seed", description="Get the world seed")
async def seed(interaction: discord.Interaction):
response = send_rcon_command("/seed")
embed = discord.Embed(
title="World Seed",
description=f"**Seed:** {response}",
color=discord.Color.orange()
)
embed.set_footer(text="World seed fetched successfully.")
await interaction.response.send_message(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="reload", description="Reload server")
async def reload(interaction: discord.Interaction):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
response = send_rcon_command("/reload")
embed = discord.Embed(
title="Success!",
description=f"{response}...\n**Server reloaded.**",
color=discord.Color.green()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
@app_commands.check(check_admin_role)
@server_group.command(name="difficulty", description="Change the game difficulty")
async def difficulty(interaction: discord.Interaction, level: str):
if not check_admin_role(interaction):
await interaction.response.send_message("You do not have the required role to use this command.", ephemeral=True)
return
if level not in ["peaceful", "easy", "normal", "hard"]:
await interaction.response.send_message("Wrong difficulty level. Use 'peaceful', 'easy', 'normal', or 'hard'.", ephemeral=True)
return
command = f"/difficulty {level}"
response = send_rcon_command(command)
if response.endswith("[HERE]"):
embed = discord.Embed(
title="Error!",
description="The command was unsuccessful. Please check the server logs for more details.",
color=discord.Color.red()
)
else:
embed = discord.Embed(
title="Difficulty Changed",
description=f"**New Difficulty Level:** {level.capitalize()}",
color=discord.Color.purple()
)
embed.set_footer(text=f"Response: {response}")
await interaction.response.send_message(embed=embed)
role_group = app_commands.Group(name="role", description="Add/Remove Admin Roles")
@role_group.command(name="add", description="Add a role to the admin list")
@app_commands.checks.has_permissions(moderate_members=True)
async def add_role(interaction: discord.Interaction, role: discord.Role):
if role.id in ALLOWED_ROLE_ID:
await interaction.response.send_message(f"Role {role.name} is already an admin role.", ephemeral=True)
else:
ALLOWED_ROLE_ID.append(role.id)
ave_admin_roles(ALLOWED_ROLE_ID)
await interaction.response.send_message(f"Role {role.name} has been added to the admin list.", ephemeral=True)
@role_group.command(name="remove", description="Remove a role from the admin list")
@app_commands.checks.has_permissions(moderate_members=True)
async def remove_role(interaction: discord.Interaction, role: discord.Role):
if role.id in ALLOWED_ROLE_ID:
ALLOWED_ROLE_ID.remove(role.id)
save_admin_roles(ALLOWED_ROLE_ID)
await interaction.response.send_message(f"Role {role.name} has been removed from the admin list.", ephemeral=True)
else:
await interaction.response.send_message(f"Role {role.name} is not an admin role.", ephemeral=True)
@role_group.command(name="view", description="View Admin Roles")
async def view_roles(interaction: discord.Interaction):
guild_roles = interaction.guild.roles
# Find roles matching the IDs in ALLOWED_ROLE_ID
roles_mentions = [f"<@&{role.id}>" for role in guild_roles if role.id in ALLOWED_ROLE_ID]
embed = discord.Embed(
title="Admin Roles",
description="Roles managing minecraft server",
color=discord.Color.blue()
)
if roles_mentions:
embed.add_field(name="Admin Roles", value=', '.join(roles_mentions))
else:
embed.add_field(name="Admin Roles", value="No admin roles found.")
embed.set_footer(text="Requested by " + interaction.user.name)
embed.set_thumbnail(url="https://i.ibb.co/QJhHc3d/Userbox-creeper-svg.png")
await interaction.response.send_message(embed=embed, ephemeral=True)
bot.tree.add_command(server_group)
bot.tree.add_command(role_group)
bot.run(DISCORD_TOKEN)