Spaces:
Runtime error
Runtime error
Upload 2 files
Browse files- Botclient/CLient.py +48 -0
- Botclient/__init__.py +22 -0
Botclient/CLient.py
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import setting
|
| 2 |
+
import discord
|
| 3 |
+
from discord.ext import commands, bridge
|
| 4 |
+
from logging import getLogger
|
| 5 |
+
import logging
|
| 6 |
+
#import bot_web
|
| 7 |
+
from gra import keep_alive
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def make_log():
|
| 11 |
+
logger = getLogger(__name__)
|
| 12 |
+
logger.setLevel(logging.INFO)
|
| 13 |
+
streamHandler = logging.StreamHandler()
|
| 14 |
+
logger.addHandler(streamHandler)
|
| 15 |
+
|
| 16 |
+
return logger
|
| 17 |
+
|
| 18 |
+
log = make_log()
|
| 19 |
+
|
| 20 |
+
class clients(bridge.AutoShardedBot):
|
| 21 |
+
|
| 22 |
+
def __init__(self):
|
| 23 |
+
super().__init__(
|
| 24 |
+
#activity=discord.Activity(#competing
|
| 25 |
+
# type=discord.ActivityType.playing, name=f"๋ธ๋๋ฆฌ์คํธ ์ถ๊ฐ"
|
| 26 |
+
#),
|
| 27 |
+
allowed_mentions=discord.AllowedMentions.none(),
|
| 28 |
+
chunk_guilds_at_startup=False,
|
| 29 |
+
command_prefix="m.",
|
| 30 |
+
help_command=None,
|
| 31 |
+
intents=discord.Intents.all(),
|
| 32 |
+
owner_ids=[1096254561674592256],
|
| 33 |
+
)
|
| 34 |
+
|
| 35 |
+
async def on_ready(self):
|
| 36 |
+
log.info("๋ด์ด ์คํ์ค์
๋๋ค.")
|
| 37 |
+
self._bot.persistent_views_added = False
|
| 38 |
+
#return bot_web.ui()
|
| 39 |
+
return keep_alive()
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def run(self):
|
| 43 |
+
if setting.Debug.debug:
|
| 44 |
+
log.info("ํ
์คํธ ๋ชจ๋๊ฐ ์คํ๋์์ต๋๋ค.")
|
| 45 |
+
TOKEN = setting.Debug.token
|
| 46 |
+
else:
|
| 47 |
+
TOKEN = setting.Settings.token
|
| 48 |
+
super().run(TOKEN, reconnect=True)
|
Botclient/__init__.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from discord.ext import commands
|
| 2 |
+
|
| 3 |
+
from .CLient import clients
|
| 4 |
+
from .http import user_infos
|
| 5 |
+
from .database import mongo
|
| 6 |
+
|
| 7 |
+
__all__ = (
|
| 8 |
+
"clients",
|
| 9 |
+
"Cog",
|
| 10 |
+
"mongo",
|
| 11 |
+
# "server",
|
| 12 |
+
"user_infos",
|
| 13 |
+
# "user",
|
| 14 |
+
# "server",
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
class Cog(commands.Cog):
|
| 19 |
+
"""Base class for all cogs"""
|
| 20 |
+
|
| 21 |
+
def __init__(self, bot: clients) -> None:
|
| 22 |
+
self.bot = bot
|