Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -45,7 +45,13 @@ async def uptime(ctx):
|
|
45 |
hours, remainder = divmod(int(delta.total_seconds()), 3600)
|
46 |
minutes, seconds = divmod(remainder, 60)
|
47 |
days, hours = divmod(hours, 24)
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
async def update_status():
|
51 |
await bot.wait_until_ready() # Wait until the bot is fully ready
|
@@ -66,9 +72,25 @@ async def on_ready():
|
|
66 |
bot.loop.create_task(update_status()) # Create the task within the on_ready event
|
67 |
|
68 |
@bot.event
|
69 |
-
async def on_member_join(
|
70 |
-
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
# running in thread
|
74 |
def run_bot():
|
|
|
45 |
hours, remainder = divmod(int(delta.total_seconds()), 3600)
|
46 |
minutes, seconds = divmod(remainder, 60)
|
47 |
days, hours = divmod(hours, 24)
|
48 |
+
|
49 |
+
# Create a fancy embed with emojis
|
50 |
+
embed = discord.Embed(title="Bot Uptime", color=discord.Color.green())
|
51 |
+
embed.add_field(name="Uptime", value=f"{days} days, {hours} hours, {minutes} minutes, {seconds} seconds", inline=False)
|
52 |
+
embed.set_footer(text="🤖 Powered by Discord Bot")
|
53 |
+
|
54 |
+
await ctx.send(embed=embed)
|
55 |
|
56 |
async def update_status():
|
57 |
await bot.wait_until_ready() # Wait until the bot is fully ready
|
|
|
72 |
bot.loop.create_task(update_status()) # Create the task within the on_ready event
|
73 |
|
74 |
@bot.event
|
75 |
+
async def on_member_join(member):
|
76 |
+
channel = discord.utils.get(member.guild.channels, name="👋wellcome-goodbye")
|
77 |
+
|
78 |
+
# Fetch a random Bible verse
|
79 |
+
bible_api_url = "https://labs.bible.org/api/?passage=random&type=json"
|
80 |
+
response = requests.get(bible_api_url)
|
81 |
+
if response.status_code == 200:
|
82 |
+
verse = response.json()[0]
|
83 |
+
passage = f"{verse['bookname']} {verse['chapter']}:{verse['verse']} - {verse['text']}"
|
84 |
+
else:
|
85 |
+
passage = "Unable to fetch Bible verse"
|
86 |
+
|
87 |
+
# Create an embed
|
88 |
+
embed = discord.Embed(title=f"Welcome to the server, {member.name}!", color=discord.Color.blue())
|
89 |
+
embed.add_field(name="Welcome Message", value=f"Hope you have a great stay here.", inline=False)
|
90 |
+
embed.add_field(name="Random Bible Verse", value=passage, inline=False)
|
91 |
+
embed.set_footer(text="👋📖 Powered by Discord Bot")
|
92 |
+
|
93 |
+
await channel.send(embed=embed)
|
94 |
|
95 |
# running in thread
|
96 |
def run_bot():
|