WIP: libbot 4.0.0 adoption
This commit is contained in:
10
cogs/data.py
10
cogs/data.py
@@ -9,9 +9,7 @@ from discord import ApplicationContext, Embed, File, option, Role, TextChannel
|
||||
from discord import utils as ds_utils
|
||||
from discord.commands import SlashCommandGroup
|
||||
from discord.ext import commands
|
||||
from libbot import config_get
|
||||
from libbot.sync import config_get as sync_config_get
|
||||
from libbot.sync import json_write as sync_json_write
|
||||
from libbot.utils import config_get, json_write
|
||||
|
||||
from classes.holo_bot import HoloBot
|
||||
from classes.holo_user import HoloUser
|
||||
@@ -31,7 +29,7 @@ class Data(commands.Cog):
|
||||
@data.command(
|
||||
name="export",
|
||||
description="Експортувати дані",
|
||||
guild_ids=[sync_config_get("guild")],
|
||||
guild_ids=[config_get("guild")],
|
||||
)
|
||||
@option(
|
||||
"kind", description="Тип даних, які треба експортувати", choices=["Користувачі"]
|
||||
@@ -94,14 +92,14 @@ class Data(commands.Cog):
|
||||
}
|
||||
)
|
||||
|
||||
sync_json_write(users, Path(f"tmp/{uuid}"))
|
||||
json_write(users, Path(f"tmp/{uuid}"))
|
||||
|
||||
await ctx.respond(file=File(Path(f"tmp/{uuid}"), filename="users.json"))
|
||||
|
||||
@data.command(
|
||||
name="migrate",
|
||||
description="Мігрувати всіх користувачів до бази",
|
||||
guild_ids=[sync_config_get("guild")],
|
||||
guild_ids=[config_get("guild")],
|
||||
)
|
||||
@option(
|
||||
"kind", description="Тип даних, які треба експортувати", choices=["Користувачі"]
|
||||
|
Reference in New Issue
Block a user