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:
|
if message.author.bot:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if isinstance(message.channel, discord.DMChannel):
|
||||||
|
await message.channel.send("DMを確認")
|
||||||
|
|
||||||
if message.content == "/hello":
|
if message.content == "/hello":
|
||||||
await message.channel.send("こんにちは!!!!")
|
await message.channel.send("こんにちは!!!!")
|
||||||
|
|
||||||
|
@ -39,25 +42,39 @@ class Cert():
|
||||||
elif result[0][1] == username and result[0][2] == password:
|
elif result[0][1] == username and result[0][2] == password:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
class Web(flask.Flask):
|
#cert = Cert()
|
||||||
async def temp(self):
|
|
||||||
print("")
|
|
||||||
|
|
||||||
|
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()
|
db_config = {
|
||||||
print(cert.get_username("suti7", "0126"))
|
"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_dir_path + "bot.json"
|
||||||
bot_config_path = "./config/bot.json"
|
|
||||||
if not os.path.isfile(bot_config_path):
|
if not os.path.isfile(bot_config_path):
|
||||||
|
if not os.path.isdir(config_dir_path):
|
||||||
|
os.mkdir(config_dir_path)
|
||||||
|
|
||||||
bot_config = {
|
bot_config = {
|
||||||
"token": ""
|
"token": "TYPE HERE BOTS TOKEN KEY"
|
||||||
}
|
}
|
||||||
with open(bot_config_path, "w") as w:
|
with open(bot_config_path, "w") as w:
|
||||||
json.dump(bot_config, w, indent=4)
|
json.dump(bot_config, w, indent=4)
|
||||||
|
|
||||||
elif os.path.isfile(bot_config_path):
|
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)
|
bot_config = json.load(r)
|
||||||
|
|
||||||
intents = discord.Intents.default()
|
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