Please enter the commit message for your changes. Lines starting

with '#' will be ignored, and an empty message aborts the commit.
This commit is contained in:
WhatDidYouExpect 2025-07-07 13:05:50 +02:00
parent c732049d79
commit 6637ece3d8
5 changed files with 14 additions and 5 deletions

View file

@ -112,6 +112,7 @@
"command_ran": "Info: {message.author.name} ran {message.content}", "command_ran": "Info: {message.author.name} ran {message.content}",
"command_ran_s": "Info: {interaction.user} ran ", "command_ran_s": "Info: {interaction.user} ran ",
"command_desc_ping": "ping", "command_desc_ping": "ping",
"command_desc_setlang": "Set a new language for the bot (temporarily)",
"command_ping_embed_desc": "Bot Latency:", "command_ping_embed_desc": "Bot Latency:",
"command_ping_footer": "Requested by", "command_ping_footer": "Requested by",
"command_about_desc": "about", "command_about_desc": "about",

View file

@ -113,6 +113,7 @@
"command_ran": "Info: {message.author.name} ha eseguito {message.content}", "command_ran": "Info: {message.author.name} ha eseguito {message.content}",
"command_ran_s": "Info: {interaction.user} ha eseguito ", "command_ran_s": "Info: {interaction.user} ha eseguito ",
"command_desc_ping": "ping", "command_desc_ping": "ping",
"command_desc_setlang": "Imposta una nuova lingua per il bot (temporaneamente)",
"command_ping_embed_desc": "Latenza del bot:", "command_ping_embed_desc": "Latenza del bot:",
"command_ping_footer": "Richiesto da", "command_ping_footer": "Richiesto da",
"command_about_desc": "informazioni", "command_about_desc": "informazioni",

11
bot.py
View file

@ -23,6 +23,7 @@ import requests
import discord import discord
from discord.ext import commands from discord.ext import commands
from discord import app_commands
from discord import Colour, Embed, File, Interaction, Message from discord import Colour, Embed, File, Interaction, Message
from discord.abc import Messageable from discord.abc import Messageable
@ -30,7 +31,7 @@ from better_profanity import profanity
from discord.ext import commands from discord.ext import commands
from modules.central import ping_server from modules.central import ping_server
from modules.volta.main import _ from modules.volta.main import _, set_language
from modules.markovmemory import * from modules.markovmemory import *
from modules.version import * from modules.version import *
from modules.sentenceprocessing import * from modules.sentenceprocessing import *
@ -353,6 +354,14 @@ async def help(ctx: commands.Context) -> None:
await send_message(ctx, embed=embed) await send_message(ctx, embed=embed)
@bot.hybrid_command(description=f"{(_('command_desc_setlang'))}")
@app_commands.describe(locale="Choose your language")
async def setlanguage(ctx: commands.Context, locale: str) -> None:
await ctx.defer()
set_language(locale)
await ctx.send(":thumbsup:")
# Event: Called on every message # Event: Called on every message
@bot.event @bot.event
async def on_message(message: discord.Message) -> None: async def on_message(message: discord.Message) -> None:

View file

@ -37,7 +37,7 @@ arch = platform.machine()
slash_commands_enabled = True # 100% broken, its a newer enough version so its probably enabled by default.... fix this at somepoint or hard code it in goober central code slash_commands_enabled = True # 100% broken, its a newer enough version so its probably enabled by default.... fix this at somepoint or hard code it in goober central code
launched = False launched = False
latest_version = "0.0.0" latest_version = "0.0.0"
local_version = "2.0.1" local_version = "2.0.2"
os.environ['gooberlocal_version'] = local_version os.environ['gooberlocal_version'] = local_version
REACT = os.getenv("REACT") REACT = os.getenv("REACT")
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 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

View file

@ -19,8 +19,6 @@ def is_remote_ahead(branch='main', remote='origin'):
# Automatically update the local repository if the remote is ahead # Automatically update the local repository if the remote is ahead
def auto_update(branch='main', remote='origin'): def auto_update(branch='main', remote='origin'):
if launched == True:
return
if launched == True: if launched == True:
print(_("already_started")) print(_("already_started"))
return return
@ -77,7 +75,7 @@ def check_for_update():
print(f"{YELLOW}{_('new_version').format(latest_version=latest_version, local_version=local_version)}{RESET}") print(f"{YELLOW}{_('new_version').format(latest_version=latest_version, local_version=local_version)}{RESET}")
print(f"{YELLOW}{_('changelog').format(VERSION_URL=VERSION_URL)}{RESET}") print(f"{YELLOW}{_('changelog').format(VERSION_URL=VERSION_URL)}{RESET}")
auto_update() auto_update()
elif local_version > latest_version and beta == True: elif beta == True:
print(f"{YELLOW}You are running an \"unstable\" version of Goober, do not expect it to work properly.\nVersion {local_version}{RESET}") print(f"{YELLOW}You are running an \"unstable\" version of Goober, do not expect it to work properly.\nVersion {local_version}{RESET}")
elif local_version > latest_version: elif local_version > latest_version:
print(f"{YELLOW}{_('modification_warning')}{RESET}") print(f"{YELLOW}{_('modification_warning')}{RESET}")