wop commited on
Commit
598903b
1 Parent(s): 3eed57f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -12
app.py CHANGED
@@ -1,6 +1,8 @@
1
  import asyncio
2
  import os
3
  import threading
 
 
4
  from threading import Event
5
  from typing import Optional
6
 
@@ -62,7 +64,8 @@ async def uptime(ctx):
62
  async def ai(ctx, *, input_text: str):
63
  """Ask our AI model a question."""
64
  async with ctx.typing():
65
- result = ask(input_text)
 
66
 
67
  # Reply with the embed
68
  await ctx.reply(result)
@@ -163,17 +166,40 @@ async def on_member_join(member):
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)
@@ -188,7 +214,7 @@ async def on_member_join(member):
188
  description=f"Hope you have a great stay here, {member.mention}!",
189
  color=discord.Color.blue()
190
  )
191
- embed.add_field(name="Random Bible Verse", value=passage, inline=False)
192
  embed.set_footer(text="Created by Cosmos")
193
  await welcome_channel.send(embed=embed)
194
 
 
1
  import asyncio
2
  import os
3
  import threading
4
+ import json
5
+ import random
6
  from threading import Event
7
  from typing import Optional
8
 
 
64
  async def ai(ctx, *, input_text: str):
65
  """Ask our AI model a question."""
66
  async with ctx.typing():
67
+ #result = ask(input_text)
68
+ result = "the ai is disabled currently"
69
 
70
  # Reply with the embed
71
  await ctx.reply(result)
 
166
  f"Here are some channels you might find interesting:\n{channels_message}\n\n"
167
  )
168
 
169
+ # Load Bible verses JSON data
170
+ verses_json = '''
171
+ {
172
+ "verses": [
173
+ {
174
+ "reference": "**Romans 12:10**",
175
+ "text": "“Be devoted to one another in love. Honor one another above yourselves.”"
176
+ },
177
+ {
178
+ "reference": "**John 4:20**",
179
+ "text": "“If someone says, ‘I love God,’ and hates his brother, he is a liar; for he who does not love his brother whom he has seen, how can he love God whom he has not seen?”"
180
+ },
181
+ {
182
+ "reference": "**Ephesians 4:32**",
183
+ "text": "“And be kind to one another, tenderhearted, forgiving one another, even as God in Christ forgave you.”"
184
+ },
185
+ {
186
+ "reference": "**John 13:34-35**",
187
+ "text": "“A new commandment I give to you, that you love one another; as I have loved you, that you also love one another. By this, all will know that you are My disciples if you have love for one another.”"
188
+ },
189
+ {
190
+ "reference": "**Corinthians 12:26**",
191
+ "text": "“And if one member suffers, all the members suffer with it; or if one member is honored, all the members rejoice with it.”"
192
+ }
193
+ ]
194
+ }
195
+ '''
196
+
197
+ verses_data = json.loads(verses_json)
198
+ random_verse = random.choice(verses_data["verses"]) # Selecting the first verse for demonstration
199
 
200
+ # Include the Bible verse in the message content
201
+ message_content += f"\n\nRandom Bible Verse:\n{random_verse['reference']} - {random_verse['text']}"
202
+
203
  # Send a direct message to the user with the message content including the Bible verse
204
  try:
205
  await member.send(message_content)
 
214
  description=f"Hope you have a great stay here, {member.mention}!",
215
  color=discord.Color.blue()
216
  )
217
+ embed.add_field(name="Random Bible Verse", value=f"{random_verse['reference']} - {random_verse['text']}", inline=False)
218
  embed.set_footer(text="Created by Cosmos")
219
  await welcome_channel.send(embed=embed)
220