Skip to content

Commit

Permalink
formatting fixes 2
Browse files Browse the repository at this point in the history
  • Loading branch information
sand194 committed Apr 16, 2024
1 parent d4f05d7 commit 92c31a5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions discord_bot/discord_bot/bot.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
"""Sets up discord bot."""

import json
import os
from collections import defaultdict
from typing import Self
import requests
import json

import discord
import requests
from discord.ext import commands

from discord_bot import config

intents = discord.Intents.default()
Expand Down Expand Up @@ -43,7 +45,7 @@ async def bad_button(
@bot.command()
@commands.has_any_role("Admins", "Moderators")
async def sync(ctx) -> None:
"""Call to Discord API to update slash commands"""
"""Call to Discord API to update slash commands."""
await ctx.send("Synchronizing commands...")
await bot.tree.sync()

Expand All @@ -56,9 +58,13 @@ def query_llm(prompt, stop_signs):

response = requests.post(url, headers=headers, data=json.dumps(data), timeout=5)

if response.status_code == 200:
respose_status_code = 200

if response.status_code == respose_status_code:
return response.json()

return response.text


async def get_chats_history():
"""Taking chat conversation from all channels."""
Expand Down

0 comments on commit 92c31a5

Please sign in to comment.