some fixes
This commit is contained in:
parent
8f1c68aa04
commit
2312e00cdc
19
src/main.py
19
src/main.py
@ -1,16 +1,17 @@
|
|||||||
"""Discord Bot zur Bildgenerierung mit NovelAI API."""
|
"""Discord Bot zur Bildgenerierung mit NovelAI API."""
|
||||||
|
|
||||||
import io
|
import io
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import random
|
|
||||||
import zipfile
|
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
import random
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
import zipfile
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
|
import requests
|
||||||
from discord import app_commands
|
from discord import app_commands
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
import requests
|
|
||||||
|
|
||||||
# ENV Variablen
|
# ENV Variablen
|
||||||
NOVELAI_API_TOKEN = os.getenv("NOVELAI_API_TOKEN")
|
NOVELAI_API_TOKEN = os.getenv("NOVELAI_API_TOKEN")
|
||||||
@ -21,7 +22,7 @@ ALLOWED_CHANNEL_ID = int(os.getenv("DISCORD_CHANNEL_ID", "0"))
|
|||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
stream=sys.stdout,
|
stream=sys.stdout,
|
||||||
level=logging.INFO,
|
level=logging.INFO,
|
||||||
format="%(asctime)s - %(levelname)s - %(message)s"
|
format="%(asctime)s - %(levelname)s - %(message)s",
|
||||||
)
|
)
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -31,11 +32,7 @@ if not all([NOVELAI_API_TOKEN, BOT_TOKEN, ALLOWED_CHANNEL_ID]):
|
|||||||
)
|
)
|
||||||
|
|
||||||
intents = discord.Intents.default()
|
intents = discord.Intents.default()
|
||||||
bot = commands.Bot(
|
bot = commands.Bot(command_prefix=commands.when_mentioned, intents=intents)
|
||||||
command_prefix=commands.when_mentioned,
|
|
||||||
intents=intents
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
async def on_ready():
|
async def on_ready():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user