Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit 6b2ad7e

Browse files
committed
fixed
1 parent 90eae71 commit 6b2ad7e

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.__pycache__
2+
.venv

main.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import discord
2+
import os
3+
from discord.ext import commands
4+
5+
client = commands.Bot(command_prefix='.s')
6+
client.remove_command('help')
7+
8+
9+
@client.event
10+
async def on_ready():
11+
activity = discord.Game(name="https://kosuhin.space")
12+
await client.change_presence(status=discord.Status.do_not_disturb, activity=activity)
13+
print(f'{client.user.name} is started')
14+
15+
16+
@client.command()
17+
async def reload(ctx, extensions):
18+
try:
19+
client.unload_extension(f'commands.{extensions}')
20+
client.load_extension(f'commands.{extensions}')
21+
print('Successfully')
22+
await ctx.send("Reload successfully")
23+
except Exception as ex:
24+
print(f'Load Error: {ex}')
25+
26+
27+
for filename in os.listdir('./commands'):
28+
if filename.endswith('.py'):
29+
client.load_extension(f'commands.{filename[:-3]}')
30+
print(f'+ {filename}')
31+
32+
client.run('')

0 commit comments

Comments
 (0)