Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -74,6 +74,7 @@ async def verse(ctx):
|
|
74 |
@bot.command()
|
75 |
@commands.has_permissions(kick_members=True)
|
76 |
async def kick(ctx, member: discord.Member, *, reason: Optional[str] = "No reason provided"):
|
|
|
77 |
try:
|
78 |
await member.kick(reason=reason)
|
79 |
await ctx.send(f"{member.mention} has been kicked. Reason: {reason}")
|
@@ -85,6 +86,7 @@ async def kick(ctx, member: discord.Member, *, reason: Optional[str] = "No reaso
|
|
85 |
@bot.command()
|
86 |
@commands.has_permissions(ban_members=True)
|
87 |
async def ban(ctx, member: discord.Member, *, reason: Optional[str] = "No reason provided"):
|
|
|
88 |
try:
|
89 |
await member.ban(reason=reason)
|
90 |
await ctx.send(f"{member.mention} has been banned. Reason: {reason}")
|
@@ -149,6 +151,27 @@ async def on_member_join(member):
|
|
149 |
|
150 |
await channel.send(embed=embed)
|
151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
@bot.command()
|
153 |
@commands.has_permissions(manage_messages=True)
|
154 |
async def purge(ctx, limit: int):
|
|
|
74 |
@bot.command()
|
75 |
@commands.has_permissions(kick_members=True)
|
76 |
async def kick(ctx, member: discord.Member, *, reason: Optional[str] = "No reason provided"):
|
77 |
+
"""Kicks a member."""
|
78 |
try:
|
79 |
await member.kick(reason=reason)
|
80 |
await ctx.send(f"{member.mention} has been kicked. Reason: {reason}")
|
|
|
86 |
@bot.command()
|
87 |
@commands.has_permissions(ban_members=True)
|
88 |
async def ban(ctx, member: discord.Member, *, reason: Optional[str] = "No reason provided"):
|
89 |
+
"""Bans a member."""
|
90 |
try:
|
91 |
await member.ban(reason=reason)
|
92 |
await ctx.send(f"{member.mention} has been banned. Reason: {reason}")
|
|
|
151 |
|
152 |
await channel.send(embed=embed)
|
153 |
|
154 |
+
@bot.command()
|
155 |
+
async def search(ctx, *, query: str):
|
156 |
+
"""Search for a bible verse."""
|
157 |
+
bible_api_url = f"https://labs.bible.org/api/?passage={query}&type=json"
|
158 |
+
response = requests.get(bible_api_url)
|
159 |
+
|
160 |
+
if response.status_code == 200:
|
161 |
+
verses = response.json()
|
162 |
+
if verses:
|
163 |
+
# If verses are found, concatenate them into a single message
|
164 |
+
passage = "\n".join(f"**{verse['bookname']} {verse['chapter']}:{verse['verse']}** - \n{verse['text']}" for verse in verses)
|
165 |
+
passage = truncate_response(passage)
|
166 |
+
embed = discord.Embed(title=f"Search Results for '{query}'", description=passage, color=discord.Color.blue())
|
167 |
+
else:
|
168 |
+
embed = discord.Embed(title="Search Results", description="No results found.", color=discord.Color.red())
|
169 |
+
else:
|
170 |
+
embed = discord.Embed(title="Search Results", description="Unable to fetch search results.", color=discord.Color.red())
|
171 |
+
|
172 |
+
embed.set_footer(text="Created by Cosmos")
|
173 |
+
await ctx.send(embed=embed)
|
174 |
+
|
175 |
@bot.command()
|
176 |
@commands.has_permissions(manage_messages=True)
|
177 |
async def purge(ctx, limit: int):
|