discord_intro_quiz_bot/bot/bot.py

25 lines
533 B
Python
Raw Normal View History

2024-08-03 10:29:46 +00:00
import discord
from discord.ext import commands
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
intents = discord.Intents.default()
intents.messages = True
intents.guilds = True
intents.voice_states = True
intents.message_content = True
intents.reactions = True
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.event
async def on_ready():
logger.info(f'{bot.user.name} がログインしました')
def run_bot(token):
bot.run(token)
def get_bot():
return bot