55 lines
1.3 KiB
Python
55 lines
1.3 KiB
Python
import discord
|
|
from discord.ext import commands
|
|
from discord import app_commands
|
|
from dotenv import load_dotenv
|
|
import random
|
|
import os
|
|
|
|
|
|
load_dotenv()
|
|
token = os.getenv('TOKEN')
|
|
|
|
description = '''cement'''
|
|
|
|
intents = discord.Intents.all()
|
|
intents.members = True
|
|
intents.message_content = True
|
|
|
|
|
|
bot = commands.Bot(command_prefix='?',
|
|
description=description,
|
|
intents=intents)
|
|
|
|
|
|
libs = ['jishaku',]
|
|
|
|
@bot.event
|
|
async def on_ready():
|
|
|
|
for lib in libs:
|
|
await bot.load_extension(lib)
|
|
print(f'\n[^] Loaded {len(libs)} extensions loaded successfully.')
|
|
|
|
for guild in bot.guilds:
|
|
await bot.tree.sync(guild=discord.Object(id=guild.id))
|
|
print(f'[^] Sync\'d application commands to {len(bot.guilds)} servers')
|
|
|
|
print(f'[*] Logged in as {bot.user} (ID: {bot.user.id})')
|
|
print('------')
|
|
|
|
|
|
@bot.command()
|
|
async def joined(ctx, member: discord.Member):
|
|
"""Says when a member joined."""
|
|
await ctx.send(f'{member.name} joined {discord.utils.format_dt(member.joined_at)}')
|
|
|
|
@bot.group()
|
|
async def cool(ctx):
|
|
if ctx.invoked_subcommand is None:
|
|
await ctx.send(f'No, {ctx.subcommand_passed} is not cool')
|
|
|
|
@bot.hybrid_command(name="first_slash")
|
|
async def first_slash(ctx):
|
|
await ctx.send("You executed the slash command!")
|
|
|
|
bot.run(token) |