43 lines
1.0 KiB
Python
43 lines
1.0 KiB
Python
"""
|
|
version 2.0.0
|
|
author 4nima, oce
|
|
description template for discord bot
|
|
requirements
|
|
- discord
|
|
- flask (for keep_alive)
|
|
"""
|
|
|
|
## Imports
|
|
import json
|
|
import logging as log
|
|
import discord
|
|
from bot import client
|
|
#from lib.keep_alive import keep_alive
|
|
|
|
intents = discord.Intents.default()
|
|
intents.message_content = True
|
|
|
|
guild_id = '283156308465811456'
|
|
|
|
bot = client(intents)
|
|
|
|
## Vars
|
|
### Load and set Bot Config
|
|
with open("bot.conf", 'r') as f:
|
|
BOTDATA = json.load(f)
|
|
|
|
### Set logging options
|
|
log.basicConfig(
|
|
filename="bot.log",
|
|
level=log.DEBUG,
|
|
format='%(asctime)s - %(process)d-%(levelname)s: %(message)s',
|
|
datefmt='%Y-%m-%d %H:%M:%S'
|
|
)
|
|
|
|
# run
|
|
# bot defination
|
|
@bot.tree.command(guild = discord.Object(id=guild_id), name = 'tester', description='testing') #guild specific slash command
|
|
async def slash2(interaction: discord.Interaction):
|
|
await interaction.response.send_message(f"I am working! I was made with Discord.py!", ephemeral = True)
|
|
|
|
bot.run(BOTDATA['token']) |