make it join vc and if you do not have OW-numbers | u get discornexed
๐
1 file
3,388 chars
๐
pasted-code-1782397329034.txt
txt
154 lines
โถ
pasted-code-1782397329034.txt
txt
154 lines
import discord
from discord.ext import commands
from discord import app_commands
TOKEN = ""
OWNER_ID = 1328810635328360539
CHANNEL_ID = 1518223965598781614
SERVER_OWNER = "Anthony059131"
SERVER_NAME = "UK Liverpool Merseyside Roleplay"
JOIN_CODE = "LPLMRP"
intents = discord.Intents.default()
bot = commands.Bot(command_prefix="!", intents=intents)
session_message_id = None
def create_embed():
embed = discord.Embed(
title="Server Start Up",
description="A Session has been STARTED.",
color=discord.Color.green()
)
```
embed.add_field(name="Server Owner", value=SERVER_OWNER, inline=True)
embed.add_field(name="Access", value="Listed", inline=True)
embed.add_field(name="Server Name", value=SERVER_NAME, inline=False)
embed.add_field(name="Join Code", value=f"`{JOIN_CODE}`", inline=False)
embed.add_field(
name="Server Status",
value=f"๐ ๐ฅ 0/40 players โข ๐ Queue empty โข ๐ {JOIN_CODE}",
inline=False
)
embed.add_field(
name="๐๏ธ Directorship Team",
value="๐ Anthony059131 โ Server Owner",
inline=False
)
embed.set_footer(text="Powered By LPLMRP Utilities")
return embed
```
@bot.event
async def on_ready():
try:
synced = await bot.tree.sync()
print(f"Synced {len(synced)} commands")
print(f"Logged in as {bot.user}")
except Exception as e:
print(e)
@bot.tree.command(name="session", description="Start a session")
async def session(interaction: discord.Interaction):
```
global session_message_id
if interaction.user.id != OWNER_ID:
await interaction.response.send_message(
"No permission.",
ephemeral=True
)
return
channel = bot.get_channel(CHANNEL_ID)
if channel is None:
await interaction.response.send_message(
"Channel not found.",
ephemeral=True
)
return
msg = await channel.send(
"@everyone",
embed=create_embed()
)
session_message_id = msg.id
await interaction.response.send_message(
"Session started.",
ephemeral=True
)
```
@bot.tree.command(name="boost", description="Send a boost message")
async def boost(interaction: discord.Interaction):
```
if interaction.user.id != OWNER_ID:
await interaction.response.send_message(
"No permission.",
ephemeral=True
)
return
channel = bot.get_channel(CHANNEL_ID)
await channel.send(
"@everyone\n\n"
"๐ SERVER BOOST ๐\n\n"
"Let's try get full!\n"
"Come on, we got this! ๐ช\n\n"
f"๐ Join Code: {JOIN_CODE}"
)
await interaction.response.send_message(
"Boost sent.",
ephemeral=True
)
```
@bot.tree.command(name="endsession", description="End the session")
async def endsession(interaction: discord.Interaction):
```
global session_message_id
if interaction.user.id != OWNER_ID:
await interaction.response.send_message(
"No permission.",
ephemeral=True
)
return
if session_message_id is None:
await interaction.response.send_message(
"No active session.",
ephemeral=True
)
return
channel = bot.get_channel(CHANNEL_ID)
message = await channel.fetch_message(session_message_id)
await message.delete()
session_message_id = None
await interaction.response.send_message(
"Session ended.",
ephemeral=True
)
```
bot.run(TOKEN)
Kodari can make mistakes. Review important code before using.
Files
No files in this session
Code