Итаааак! Я покажу вам код, скрины и т.д
import disnake
from disnake.ext import commands
import os
from pymongo import MongoClient
client = commands.Bot(command_prefix = '>', help_command = None, intents = disnake.Intents.all(), activity = disnake.Game('>help | /help', status = disnake.Status.dnd))
cluster = MongoClient("mongodb+srv://Skyship:[email protected]/?retryWrites=true&w=majority")
collection = cluster.cluster0.colldb
@client.event
async def on_ready():
print(f"your {client.user} client online.")
for guild in client.guilds:
for member in guild.members:
post = {
"id": member.id,
"balance": 0,
"bank": 0,
}
if collection.count_documents({
"id": member.id }) == 0:
collection.insert_one(post)
@client.event
async def on_member_join(member):
post = {
"id": 0,
"balance": 0,
"bank": 0
}
if collection.count_documents({
"id": member.id }) == 0:
collection.insert_documents(post)
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
client.load_extension(f"cogs.{filename[:-3]}")
client.run("")
Скриншоты: