Files
cogs
utils
bot.py
config.json
README.md
requirements.txt
SETUP.md
Code
8 716
bot.py
import discord
from discord.ext import commands
import os
import json
from dotenv import load_dotenv
load_dotenv()
class LitecoinBot(commands.Bot):
def __init__(self):
intents = discord.Intents.default()
intents.message_content = True
super().__init__(
command_prefix='!',
intents=intents,
help_command=None
)
async def setup_hook(self):
await self.load_extension('cogs.wallet_commands')
await self.tree.sync()
print("Commands synced!")
async def on_ready(self):
print(f'Bot is ready! Logged in as {self.user.name} ({self.user.id})')
print(f'Connected to {len(self.guilds)} guilds')
await self.change_presence(
activity=discord.Activity(
type=discord.ActivityType.watching,
name="LTC Wallets | /bal"
),
status=discord.Status.online
)
def main():
if not os.path.exists('data'):
os.makedirs('data')
if not os.path.exists('data/wallets.json'):
with open('data/wallets.json', 'w') as f:
json.dump({}, f)
bot = LitecoinBot()
token = os.getenv('DISCORD_TOKEN')
if not token:
print("ERROR: DISCORD_TOKEN not found in .env file!")
return
bot.run(token)
if __name__ == '__main__':
main()