-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
53 lines (41 loc) · 1.29 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import discord
import os
import sys
import asyncio
import time
import json
from discord.ext import commands
from discord.utils import get
TOKEN = ''
BADWORDS = ["лох", "дурак"]
LINKS = ["https", "http", "://", "com", "ru", "net", "org", "shop"]
if not os.path.exists('users.json'):
with open('users.json', 'w') as file:
file.write('{}')
file.close()
intents = discord.Intents.all()
bot = commands.Bot(command_prefix="!", intents = intents)
@bot.event
async def on_ready():
print(f"Бот зашел на сервер. Данные бота:")
print()
print(f"Имя Бота: {bot.user.name}")
print(f"ID Бота: {bot.user.id}")
print(f"Токен бота: {TOKEN}")
print()
for guild in bot.guilds:
for member in guild.members:
with open('users.json', 'r') as file:
data = json.load(file)
file.close()
with open('users.json', 'w') as file:
data[str(member.id)] = {
"WARNS": 0,
"CAPS": 0
}
json.dump(data, file,indent=4)
file.close()
@bot.command()
async def hello(ctx): #!hello
await ctx.send("И снова всем привет, подписчикам и не подписчикам, с вами снова я, Варвар Бот", file = discord.File("varvar.PNG"))
bot.run(TOKEN)