import discord
import json
def get_data():
json_file = open("test.json", "r", encoding="utf-8")
return json.load(json_file)
def main():
# datas
list = get_data()
token = list["token"]
guild_id = int(list["guild_id"])
channel_id = int(list["channel_id"])
# Bot
intents = discord.Intents.all()
client = discord.Client(intents = intents)
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
guild = client.get_guild(guild_id)
print(guild.member_count)
client.run(token, bot=False)
main()