Compare commits
2 commits
68bd6ca282
...
61219d52ef
Author | SHA1 | Date | |
---|---|---|---|
61219d52ef | |||
05f17d6d68 |
2 changed files with 30 additions and 9 deletions
35
dislocker.py
35
dislocker.py
|
@ -11,6 +11,9 @@ class Bot(discord.Client):
|
|||
if message.author.bot:
|
||||
return
|
||||
|
||||
if isinstance(message.channel, discord.DMChannel):
|
||||
await message.channel.send("DMを確認")
|
||||
|
||||
if message.content == "/hello":
|
||||
await message.channel.send("こんにちは!!!!")
|
||||
|
||||
|
@ -39,25 +42,39 @@ class Cert():
|
|||
elif result[0][1] == username and result[0][2] == password:
|
||||
return 0
|
||||
|
||||
class Web(flask.Flask):
|
||||
async def temp(self):
|
||||
print("")
|
||||
#cert = Cert()
|
||||
|
||||
config_dir_path = "./confg/"
|
||||
db_config_path = config_dir_path + "db.json"
|
||||
if not os.path.isfile(db_config_path):
|
||||
if not os.path.isdir(config_dir_path):
|
||||
os.mkdir(config_dir_path)
|
||||
|
||||
cert = Cert()
|
||||
print(cert.get_username("suti7", "0126"))
|
||||
db_config = {
|
||||
"host": "localhost",
|
||||
"db": "dislocker",
|
||||
"username": "user",
|
||||
"password": "example_pass"
|
||||
}
|
||||
with open(db_config_path, "w") as w:
|
||||
json.dump(db_config, w, indent=4)
|
||||
elif os.path.isfile(db_config_path):
|
||||
with open(db_config_path, "r") as r:
|
||||
db_config = json.load(r)
|
||||
|
||||
|
||||
bot_config_path = "./config/bot.json"
|
||||
bot_config_path = config_dir_path + "bot.json"
|
||||
if not os.path.isfile(bot_config_path):
|
||||
if not os.path.isdir(config_dir_path):
|
||||
os.mkdir(config_dir_path)
|
||||
|
||||
bot_config = {
|
||||
"token": ""
|
||||
"token": "TYPE HERE BOTS TOKEN KEY"
|
||||
}
|
||||
with open(bot_config_path, "w") as w:
|
||||
json.dump(bot_config, w, indent=4)
|
||||
|
||||
elif os.path.isfile(bot_config_path):
|
||||
with open("./config/bot.json", "r") as r:
|
||||
with open(bot_config_path, "r") as r:
|
||||
bot_config = json.load(r)
|
||||
|
||||
intents = discord.Intents.default()
|
||||
|
|
4
requirements.txt
Normal file
4
requirements.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
discord.py
|
||||
flask
|
||||
flask-login
|
||||
psycopg2
|
Loading…
Reference in a new issue