Working on #13
This commit is contained in:
@@ -4,12 +4,13 @@ import sys
|
||||
from discord import ApplicationContext, Embed, User, option, slash_command
|
||||
from discord import utils as ds_utils
|
||||
from discord.ext import commands
|
||||
from libbot import config_get
|
||||
from libbot.pycord.classes import PycordBot
|
||||
from libbot.sync import config_get as sync_config_get
|
||||
|
||||
from enums.colors import Color
|
||||
from modules.scheduled import scheduler
|
||||
from modules.utils import config_get
|
||||
from modules.utils_sync import config_get_sync, guild_name
|
||||
from modules.utils_sync import guild_name
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -106,7 +107,7 @@ class Admin(commands.Cog):
|
||||
@slash_command(
|
||||
name="clear",
|
||||
description="Видалити деяку кількість повідомлень в каналі",
|
||||
guild_ids=[config_get_sync("guild")],
|
||||
guild_ids=[sync_config_get("guild")],
|
||||
)
|
||||
@option("amount", description="Кількість")
|
||||
@option("user", description="Користувач", default=None)
|
||||
@@ -170,7 +171,7 @@ class Admin(commands.Cog):
|
||||
@slash_command(
|
||||
name="reboot",
|
||||
description="Перезапустити бота",
|
||||
guild_ids=[config_get_sync("guild")],
|
||||
guild_ids=[sync_config_get("guild")],
|
||||
)
|
||||
async def reboot_cmd(self, ctx: ApplicationContext):
|
||||
await ctx.defer(ephemeral=True)
|
||||
|
@@ -3,13 +3,14 @@ from discord import utils as ds_utils
|
||||
from discord.abc import GuildChannel
|
||||
from discord.commands import SlashCommandGroup
|
||||
from discord.ext import commands
|
||||
from libbot import config_get
|
||||
from libbot.pycord.classes import PycordBot
|
||||
from libbot.sync import config_get as sync_config_get
|
||||
|
||||
from classes.holo_user import HoloUser
|
||||
from enums.colors import Color
|
||||
from modules.database import col_users
|
||||
from modules.utils import config_get
|
||||
from modules.utils_sync import config_get_sync, guild_name
|
||||
from modules.utils_sync import guild_name
|
||||
|
||||
|
||||
class CustomChannels(commands.Cog):
|
||||
@@ -27,7 +28,7 @@ class CustomChannels(commands.Cog):
|
||||
@customchannel.command(
|
||||
name="get",
|
||||
description="Отримати персональний текстовий канал",
|
||||
guild_ids=[config_get_sync("guild")],
|
||||
guild_ids=[sync_config_get("guild")],
|
||||
)
|
||||
@option("name", description="Назва каналу")
|
||||
@option("reactions", description="Дозволити реакції")
|
||||
@@ -97,7 +98,7 @@ class CustomChannels(commands.Cog):
|
||||
@customchannel.command(
|
||||
name="edit",
|
||||
description="Змінити параметри особистого каналу",
|
||||
guild_ids=[config_get_sync("guild")],
|
||||
guild_ids=[sync_config_get("guild")],
|
||||
)
|
||||
@option("name", description="Назва каналу")
|
||||
@option("reactions", description="Дозволити реакції")
|
||||
@@ -142,7 +143,7 @@ class CustomChannels(commands.Cog):
|
||||
@customchannel.command(
|
||||
name="remove",
|
||||
description="Відібрати канал, знищуючи його, та частково повернути кошти",
|
||||
guild_ids=[config_get_sync("guild")],
|
||||
guild_ids=[sync_config_get("guild")],
|
||||
)
|
||||
@option("confirm", description="Підтвердження операції")
|
||||
async def customchannel_remove_cmd(
|
||||
|
16
cogs/data.py
16
cogs/data.py
@@ -7,13 +7,15 @@ from discord import ApplicationContext, Embed, File, option
|
||||
from discord import utils as ds_utils
|
||||
from discord.commands import SlashCommandGroup
|
||||
from discord.ext import commands
|
||||
from libbot import config_get
|
||||
from libbot.pycord.classes import PycordBot
|
||||
from libbot.sync import config_get as sync_config_get
|
||||
from libbot.sync import json_write as sync_json_write
|
||||
|
||||
from classes.holo_user import HoloUser
|
||||
from enums.colors import Color
|
||||
from modules.database import col_users
|
||||
from modules.utils import config_get
|
||||
from modules.utils_sync import config_get_sync, guild_name, json_write_sync
|
||||
from modules.utils_sync import guild_name
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -27,7 +29,7 @@ class Data(commands.Cog):
|
||||
@data.command(
|
||||
name="export",
|
||||
description="Експортувати дані",
|
||||
guild_ids=[config_get_sync("guild")],
|
||||
guild_ids=[sync_config_get("guild")],
|
||||
)
|
||||
@option(
|
||||
"kind", description="Тип даних, які треба експортувати", choices=["Користувачі"]
|
||||
@@ -91,16 +93,14 @@ class Data(commands.Cog):
|
||||
}
|
||||
)
|
||||
|
||||
json_write_sync(users, str(Path(f"tmp/{uuid}")))
|
||||
sync_json_write(users, Path(f"tmp/{uuid}"))
|
||||
|
||||
await ctx.respond(
|
||||
file=File(str(Path(f"tmp/{uuid}")), filename="users.json")
|
||||
)
|
||||
await ctx.respond(file=File(Path(f"tmp/{uuid}"), filename="users.json"))
|
||||
|
||||
@data.command(
|
||||
name="migrate",
|
||||
description="Мігрувати всіх користувачів до бази",
|
||||
guild_ids=[config_get_sync("guild")],
|
||||
guild_ids=[sync_config_get("guild")],
|
||||
)
|
||||
@option(
|
||||
"kind", description="Тип даних, які треба експортувати", choices=["Користувачі"]
|
||||
|
11
cogs/fun.py
11
cogs/fun.py
@@ -1,12 +1,13 @@
|
||||
import logging
|
||||
|
||||
from WaifuPicsPython import WaifuAsync
|
||||
from discord import ApplicationContext, Embed, User, option, slash_command
|
||||
from discord.ext import commands
|
||||
from libbot import config_get
|
||||
from libbot.pycord.classes import PycordBot
|
||||
from WaifuPicsPython import WaifuAsync
|
||||
from libbot.sync import config_get as sync_config_get
|
||||
|
||||
from modules.utils import config_get
|
||||
from modules.utils_sync import config_get_sync, guild_name
|
||||
from modules.utils_sync import guild_name
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -20,12 +21,12 @@ class Fun(commands.Cog):
|
||||
@slash_command(
|
||||
name="action",
|
||||
description="Провести над користувачем РП дію",
|
||||
guild_ids=[config_get_sync("guild")],
|
||||
guild_ids=[sync_config_get("guild")],
|
||||
)
|
||||
@option(
|
||||
"type",
|
||||
description="Тип дії, яку хочете провести з користувачем",
|
||||
choices=config_get_sync("actions").keys(),
|
||||
choices=sync_config_get("actions").keys(),
|
||||
)
|
||||
@option("user", description="Користувач")
|
||||
async def action_cmd(self, ctx: ApplicationContext, type: str, user: User):
|
||||
|
@@ -1,10 +1,10 @@
|
||||
from discord import Member, Message
|
||||
from discord import utils as ds_utils
|
||||
from discord.ext import commands
|
||||
from libbot import config_get
|
||||
from libbot.pycord.classes import PycordBot
|
||||
|
||||
from modules.database import col_users
|
||||
from modules.utils import config_get
|
||||
|
||||
|
||||
class Logger(commands.Cog):
|
||||
|
Reference in New Issue
Block a user