Moved all the good stuff into .env file

This commit is contained in:
Entarno54 2025-05-12 20:35:24 +07:00
parent 434112cf1c
commit 8c7d04241d
3 changed files with 16 additions and 8 deletions

View File

@ -1,12 +1,16 @@
import nextcord
from nextcord.ext import commands
import os
import openai
import json
import nextcord
from nextcord.ext import commands
Enabled = False
SquogAILink = "https://api.webraft.in/v1"
SquogAIToken = "wr-tmkosxfStCjKSKsUJZueAS"
# Get these from .env file too
SquogAILink = os.environ.get("AI_URL") ## AI_URL = https://
SquogAIToken = os.environ.get("AI_TOKEN") ## AI_TOKEN = ...
SquogAI = openai.OpenAI(api_key=SquogAIToken, base_url=SquogAILink)
@ -65,7 +69,7 @@ class AI(commands.Cog):
try:
SquogResponse = await getResponse(SquogUser["messages"])
print(SquogResponse)
SquogUser["messages"].append(SquogResponse["choices"][0]["message"])
await message.reply(SquogResponse["choices"][0]["message"]["content"])

View File

@ -10,11 +10,13 @@ class Logger(commands.Cog):
@commands.Cog.listener()
async def on_message_delete(self, ctx: nextcord.Message):
embedlist = [nextcord.Embed(
title="Message delete",
description=ctx.content,
url="https://git.squog.ru/entar/SquogBot"
)]
embedlist[0].set_author(name=ctx.author.name, icon_url=ctx.author.avatar.url)
for image in ctx.attachments:

View File

@ -1,12 +1,14 @@
import nextcord
from nextcord.ext import commands
import os
from dotenv import load_dotenv
import os
load_dotenv()
#Defining the basic stuff here
SquogToken = os.environ.get("TOKEN")
#Getting the token from .env. TOKEN = ...
SquogToken = os.environ.get("BOT_TOKEN")
client = commands.Bot(command_prefix="!", intents=nextcord.Intents.all())