From 2c6dba322a80cdcff7641932dff718182084c907 Mon Sep 17 00:00:00 2001 From: ShowhyT <109768004+ShowhyT@users.noreply.github.com> Date: Mon, 24 Apr 2023 19:36:49 +0300 Subject: [PATCH 1/4] Update main.py --- discord/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discord/main.py b/discord/main.py index d88bf7a..46578b7 100644 --- a/discord/main.py +++ b/discord/main.py @@ -31,6 +31,9 @@ async def load(): for filename in os.listdir(path_to_file): if filename.endswith(".py"): await bot.load_extension(f"cogs.{filename[:-3]}") + @tree.command(name="ping", description="Команда для проверки сервера") + async def google(inter:discord.Interaction): + await inter.response.send_message(f"Ping! `{int(self.bot.latency * 1000)}` ms ", ephemeral=True) # И запуск бота с использованием .env bot.run(os.getenv("TOKEN")) From 97be1248de1ecc4f07e24972938343740aaecaa7 Mon Sep 17 00:00:00 2001 From: ShowhyT <109768004+ShowhyT@users.noreply.github.com> Date: Mon, 24 Apr 2023 19:42:03 +0300 Subject: [PATCH 2/4] Update main.py --- discord/main.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/discord/main.py b/discord/main.py index 46578b7..eefdabe 100644 --- a/discord/main.py +++ b/discord/main.py @@ -27,13 +27,10 @@ async def on_ready(): print(f"{len(bot.guilds)} servers, {len(bot.users)} users \nБот запущен!" ) # Метод load нужен для быстрой загрузки файлов из папки cogs async def load(): - path_to_file = os.path.join("cogs") + path_to_file = os.path.join("/discord/cogs") for filename in os.listdir(path_to_file): if filename.endswith(".py"): await bot.load_extension(f"cogs.{filename[:-3]}") - @tree.command(name="ping", description="Команда для проверки сервера") - async def google(inter:discord.Interaction): - await inter.response.send_message(f"Ping! `{int(self.bot.latency * 1000)}` ms ", ephemeral=True) # И запуск бота с использованием .env bot.run(os.getenv("TOKEN")) From 5a0a1a8971010d1c3ba76a74d18d506f4d9b08da Mon Sep 17 00:00:00 2001 From: ShowhyT <109768004+ShowhyT@users.noreply.github.com> Date: Mon, 24 Apr 2023 19:44:02 +0300 Subject: [PATCH 3/4] Update main.py --- discord/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/main.py b/discord/main.py index eefdabe..2ced352 100644 --- a/discord/main.py +++ b/discord/main.py @@ -27,7 +27,7 @@ async def on_ready(): print(f"{len(bot.guilds)} servers, {len(bot.users)} users \nБот запущен!" ) # Метод load нужен для быстрой загрузки файлов из папки cogs async def load(): - path_to_file = os.path.join("/discord/cogs") + path_to_file = os.path.join("~/discord/cogs") for filename in os.listdir(path_to_file): if filename.endswith(".py"): await bot.load_extension(f"cogs.{filename[:-3]}") From 002938a35a34065e8f86a7018d4d255597f903d0 Mon Sep 17 00:00:00 2001 From: ShowhyT <109768004+ShowhyT@users.noreply.github.com> Date: Mon, 24 Apr 2023 19:45:04 +0300 Subject: [PATCH 4/4] Update main.py --- discord/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/main.py b/discord/main.py index 2ced352..d88bf7a 100644 --- a/discord/main.py +++ b/discord/main.py @@ -27,7 +27,7 @@ async def on_ready(): print(f"{len(bot.guilds)} servers, {len(bot.users)} users \nБот запущен!" ) # Метод load нужен для быстрой загрузки файлов из папки cogs async def load(): - path_to_file = os.path.join("~/discord/cogs") + path_to_file = os.path.join("cogs") for filename in os.listdir(path_to_file): if filename.endswith(".py"): await bot.load_extension(f"cogs.{filename[:-3]}")