forked from gooberinc/goober
cleared out the last of the image command
This commit is contained in:
parent
b01bd5b80b
commit
10ab18bc51
12 changed files with 72 additions and 223 deletions
|
@ -1,26 +1,19 @@
|
|||
import os
|
||||
import platform
|
||||
from dotenv import load_dotenv
|
||||
import pathlib
|
||||
import subprocess
|
||||
|
||||
from dotenv import load_dotenv
|
||||
import discord
|
||||
from discord import Colour, Embed, File, Interaction, Message
|
||||
from discord.ext import commands
|
||||
from discord import app_commands
|
||||
from discord import Colour, Embed, File, Interaction, Message
|
||||
from discord.abc import Messageable
|
||||
from discord.ext import commands
|
||||
import subprocess
|
||||
def get_git_branch():
|
||||
try:
|
||||
branch = subprocess.check_output(
|
||||
["git", "rev-parse", "--abbrev-ref", "HEAD"],
|
||||
stderr=subprocess.DEVNULL
|
||||
).decode('utf-8').strip()
|
||||
return branch
|
||||
except subprocess.CalledProcessError:
|
||||
return None
|
||||
|
||||
env_path = pathlib.Path(__file__).parent.parent / '.env'
|
||||
load_dotenv(dotenv_path=env_path)
|
||||
|
||||
# ANSI colors
|
||||
ANSI = "\033["
|
||||
RED = f"{ANSI}31m"
|
||||
GREEN = f"{ANSI}32m"
|
||||
|
@ -28,10 +21,30 @@ YELLOW = f"{ANSI}33m"
|
|||
PURPLE = f"{ANSI}35m"
|
||||
DEBUG = f"{ANSI}1;30m"
|
||||
RESET = f"{ANSI}0m"
|
||||
|
||||
VERSION_URL = "https://raw.githubusercontent.com/gooberinc/version/main"
|
||||
UPDATE_URL = VERSION_URL+"/latest_version.json"
|
||||
UPDATE_URL = f"{VERSION_URL}/latest_version.json"
|
||||
print(UPDATE_URL)
|
||||
LOCAL_VERSION_FILE = "current_version.txt"
|
||||
|
||||
LOCAL_VERSION_FILE = "current_version.txt"
|
||||
MEMORY_FILE = "memory.json"
|
||||
MEMORY_LOADED_FILE = "MEMORY_LOADED" # used in markov module
|
||||
local_version = "3.0.0"
|
||||
latest_version = "0.0.0"
|
||||
os.environ['gooberlocal_version'] = local_version
|
||||
|
||||
def get_git_branch() -> str | None:
|
||||
try:
|
||||
return subprocess.check_output(
|
||||
["git", "rev-parse", "--abbrev-ref", "HEAD"],
|
||||
stderr=subprocess.DEVNULL
|
||||
).decode().strip()
|
||||
except subprocess.CalledProcessError:
|
||||
return None
|
||||
|
||||
branch = get_git_branch()
|
||||
beta = branch != "main" if branch else True
|
||||
|
||||
TOKEN = os.getenv("DISCORDBOTTOKEN", "0")
|
||||
PREFIX = os.getenv("BOTPREFIX", "g.")
|
||||
PING_LINE = os.getenv("PINGLINE")
|
||||
|
@ -45,27 +58,23 @@ showmemenabled = os.getenv("SHOWMEMENABLED")
|
|||
BLACKLISTED_USERS = os.getenv("BLACKLISTEDUSERS", "").split(",")
|
||||
USERTRAIN_ENABLED = os.getenv("USERTRAINENABLED", "true").lower() == "true"
|
||||
NAME = os.getenv("NAME")
|
||||
MEMORY_FILE = "memory.json"
|
||||
MEMORY_LOADED_FILE = "MEMORY_LOADED" # is this still even used?? okay just checked its used in the markov module
|
||||
ALIVEPING = os.getenv("ALIVEPING")
|
||||
AUTOUPDATE = os.getenv("AUTOUPDATE")
|
||||
song = os.getenv("SONG")
|
||||
launched = False
|
||||
latest_version = "0.0.0"
|
||||
local_version = "3.0.0"
|
||||
os.environ['gooberlocal_version'] = local_version
|
||||
REACT = os.getenv("REACT")
|
||||
if get_git_branch() != "main":
|
||||
beta = True
|
||||
# this makes goober think its a beta version, so it will not update to the latest stable version or run any version checks
|
||||
else:
|
||||
beta = False
|
||||
|
||||
|
||||
# Set up Discord bot intents and create bot instance
|
||||
intents: discord.Intents = discord.Intents.default()
|
||||
intents = discord.Intents.default()
|
||||
intents.messages = True
|
||||
intents.presences = True
|
||||
intents.members = True
|
||||
intents.message_content = True
|
||||
bot: commands.Bot = commands.Bot(command_prefix=PREFIX, intents=intents, allowed_mentions=discord.AllowedMentions(everyone=False, roles=False, users=False, replied_user=True))
|
||||
|
||||
bot = commands.Bot(
|
||||
command_prefix=PREFIX,
|
||||
intents=intents,
|
||||
allowed_mentions=discord.AllowedMentions(
|
||||
everyone=False, roles=False, users=False, replied_user=True
|
||||
)
|
||||
)
|
||||
|
||||
launched = False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue