1
0
mirror of https://gitlab.com/simple-stock-bots/simple-discord-stock-bot.git synced 2025-06-15 23:06:40 +00:00

update package naming

This commit is contained in:
Anson 2023-04-16 15:54:20 -06:00
parent 31f12e0b45
commit 4213a20026

23
bot.py
View File

@ -3,9 +3,9 @@ import io
import logging
import os
import discord
import mplfinance as mpf
from discord.ext import commands
import nextcord
from nextcord.ext import commands
from D_info import D_info
from symbol_router import Router
@ -16,16 +16,17 @@ s = Router()
d = D_info()
client = discord.Client()
intents = nextcord.Intents.default()
bot = commands.Bot(
command_prefix="/",
description=d.help_text,
)
client = nextcord.Client(intents=intents)
bot = commands.Bot(command_prefix="/", description=d.help_text, intents=intents)
logger = logging.getLogger("discord")
logging.basicConfig(format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO)
logger = logging.getLogger("nextcord")
logger.setLevel(logging.INFO)
handler = logging.FileHandler(filename="nextcord.log", encoding="utf-8", mode="w")
handler.setFormatter(logging.Formatter("%(asctime)s:%(levelname)s:%(name)s: %(message)s"))
logger.addHandler(handler)
@bot.event
@ -112,7 +113,7 @@ async def intra(ctx: commands, sym: str):
# Get price so theres no request lag after the image is sent
price_reply = s.price_reply([symbol])[0]
await ctx.send(
file=discord.File(
file=nextcord.File(
buf,
filename=f"{symbol.name}:intra{datetime.date.today().strftime('%S%M%d%b%Y')}.png",
),
@ -153,7 +154,7 @@ async def chart(ctx: commands, sym: str):
# Get price so theres no request lag after the image is sent
price_reply = s.price_reply([symbol])[0]
await ctx.send(
file=discord.File(
file=nextcord.File(
buf,
filename=f"{symbol.name}:1M{datetime.date.today().strftime('%d%b%Y')}.png",
),