Update 1.3

This commit is contained in:
Profitroll 2022-02-10 21:26:16 +02:00
parent f52f9c2281
commit 4362d5cac4
7 changed files with 32 additions and 12 deletions

View File

@ -17,7 +17,7 @@ log_size = 512
debug = False
try:
with open(filename, 'r', encoding="utf-8") as json_file:
with open("config.json", 'r', encoding="utf-8") as json_file:
output = json.load(json_file)
json_file.close()
debug = output["debug"]
@ -152,6 +152,10 @@ def getMsg(string, guild=None):
appendLog(f"Could not get locale string named {string} due to exception {exp}", guild)
return f"Could not get locale string {string}"
def getEmbed(string, guild=None):
# Feature coming soon
pass
def isUserVoice(vc):
global path
try:

View File

@ -16,6 +16,7 @@
"result_prefix": "Command prefix **{0}** is now set as primary for this server",
"warn_channel": "⚠ Parent channel is not set!\nFor the bot to work, you need to set parent channel: `{0}channel CHANNEL-ID`",
"warn_category": "⚠ Parent category is not set!\nFor the bot to work, you need to set parent category: `{0}category CATEGORY-ID`",
"warn_text_channel": "⚠ Selected channel is a text channel!\nPlease, use an ID of the voice channel instead.",
"reset_channel": "Parent voice channel has been reset",
"reset_category": "Parent category has been reset",
"reset_prefix": "Commands prefix has been reset and now is `{0}`",

View File

@ -16,6 +16,7 @@
"result_prefix": "Префикс `{0}` был установлен как основной для этого сервера",
"warn_channel": "⚠ Родительский канал не установлен!\nДля работы бота нужно установить канал: `{0}channel ID-КАНАЛА`",
"warn_category": "⚠ Родительская категория не установлена!\nДля работы бота нужно установить категорию: `{0}category ID-КАТЕГОРИИ`",
"warn_text_channel": "⚠ Выбранный канал является текстовым!\nПожалуйста, укажите ID голосового канала.",
"reset_channel": "Родительский голосовой канал был сброшен",
"reset_category": "Родительская категория была сброшена",
"reset_prefix": "Прификс команд был сброшен, теперь это `{0}`",

View File

@ -16,6 +16,7 @@
"result_prefix": "Префікс **{0}** було встановлено як основний для цього сервера",
"warn_channel": "⚠ Твірний канал не встановлено!\nДля роботи робота потрібно встановити канал: `{0}channel ID-КАНАЛА`",
"warn_category": "⚠ Твірна категорія не встановлена!\nДля роботи робота потрібно встановити категорію: `{0}category ID-КАТЕГОРІЇ`",
"warn_text_channel": "⚠ Обраний канал є текстовим!\nБудь ласка, вкажіть ID голосового каналу.",
"reset_channel": "Твірний голосовий канал було скинуто",
"reset_category": "Твірну категорію було скинуто",
"reset_prefix": "Префікс команд було скинуто, тепер це `{0}`",

3
start.bat Normal file
View File

@ -0,0 +1,3 @@
title YusarinBot
cls
python3 yusarin.py

2
start.sh Normal file
View File

@ -0,0 +1,2 @@
#!/bin/sh
python3 yusarin.py

View File

@ -13,7 +13,7 @@ except Exception as exp:
from functions import *
pid = os.getpid()
version = 1.2
version = 1.3
if loadJson("config.json")["check_for_updates"]:
try:
@ -165,17 +165,25 @@ async def on_message(message):
selected_channel = discord.utils.get(message.guild.channels, id=int(fullcmd[1]))
guildConfSet(message.guild, "channel", int(fullcmd[1]))
if isinstance(selected_channel, discord.VoiceChannel):
await message.channel.send(getMsg("result_channel", message.guild).format(selected_channel.name))
guildConfSet(message.guild, "channel", int(fullcmd[1]))
if guildConfGet(message.guild, "category") is None:
await message.channel.send(getMsg("result_channel", message.guild).format(selected_channel.name))
await message.channel.send(getMsg("warn_category", message.guild).format(prefix))
if guildConfGet(message.guild, "category") is None:
await message.channel.send(getMsg("warn_category", message.guild).format(prefix))
else:
print(type(selected_channel))
await message.channel.send(getMsg("warn_text_channel", message.guild))
except Exception as exp:
#print(exp)
print(exp)
await message.channel.send(getMsg("usage_channel", message.guild).format(prefix))