Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -163,23 +163,23 @@ async def on_member_join(member):
|
|
163 |
f"Here are some channels you might find interesting:\n{channels_message}\n\n"
|
164 |
)
|
165 |
|
166 |
-
# Send a direct message to the user
|
167 |
-
try:
|
168 |
-
await member.send(message_content)
|
169 |
-
except discord.HTTPException:
|
170 |
-
print(f"Failed to send a DM to {member.name}")
|
171 |
-
|
172 |
# Fetch a random Bible verse
|
173 |
bible_api_url = "https://labs.bible.org/api/?passage=random&type=json"
|
174 |
response = requests.get(bible_api_url)
|
175 |
if response.status_code == 200:
|
176 |
verse = response.json()[0]
|
177 |
passage = f"{verse['bookname']} {verse['chapter']}:{verse['verse']} - {verse['text']}"
|
178 |
-
# Include the Bible verse in the
|
179 |
-
message_content += f"
|
180 |
else:
|
181 |
passage = "Unable to fetch Bible verse"
|
182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
# Create an embed for the welcome channel
|
184 |
welcome_channel = discord.utils.get(member.guild.channels, name="👋wellcome-goodbye")
|
185 |
if welcome_channel:
|
@@ -192,8 +192,6 @@ async def on_member_join(member):
|
|
192 |
embed.set_footer(text="Created by Cosmos")
|
193 |
await welcome_channel.send(embed=embed)
|
194 |
|
195 |
-
|
196 |
-
|
197 |
@bot.command()
|
198 |
async def search(ctx, *, query: str):
|
199 |
"""Search for a bible verse."""
|
|
|
163 |
f"Here are some channels you might find interesting:\n{channels_message}\n\n"
|
164 |
)
|
165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
# Fetch a random Bible verse
|
167 |
bible_api_url = "https://labs.bible.org/api/?passage=random&type=json"
|
168 |
response = requests.get(bible_api_url)
|
169 |
if response.status_code == 200:
|
170 |
verse = response.json()[0]
|
171 |
passage = f"{verse['bookname']} {verse['chapter']}:{verse['verse']} - {verse['text']}"
|
172 |
+
# Include the Bible verse in the message content
|
173 |
+
message_content += f"\n\nRandom Bible Verse:\n{passage}"
|
174 |
else:
|
175 |
passage = "Unable to fetch Bible verse"
|
176 |
|
177 |
+
# Send a direct message to the user with the message content including the Bible verse
|
178 |
+
try:
|
179 |
+
await member.send(message_content)
|
180 |
+
except discord.HTTPException:
|
181 |
+
print(f"Failed to send a DM to {member.name}")
|
182 |
+
|
183 |
# Create an embed for the welcome channel
|
184 |
welcome_channel = discord.utils.get(member.guild.channels, name="👋wellcome-goodbye")
|
185 |
if welcome_channel:
|
|
|
192 |
embed.set_footer(text="Created by Cosmos")
|
193 |
await welcome_channel.send(embed=embed)
|
194 |
|
|
|
|
|
195 |
@bot.command()
|
196 |
async def search(ctx, *, query: str):
|
197 |
"""Search for a bible verse."""
|