mirror of
https://github.com/Fluffy-Bean/Lynxie.git
synced 2025-05-29 14:53:15 +00:00
Move back to Python
This commit is contained in:
parent
c2e3982cc5
commit
640351e5bf
16 changed files with 893 additions and 1789 deletions
22
lynxie/__main__.py
Normal file
22
lynxie/__main__.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
import discord
|
||||
from discord.ext import commands
|
||||
from discord import app_commands
|
||||
from config import DISCORD_TOKEN, DISCORD_GUILD_ID
|
||||
from commands import hello
|
||||
|
||||
|
||||
bot = commands.Bot(intents=discord.Intents.all(), command_prefix=":")
|
||||
bot.add_cog(hello.Hello(bot))
|
||||
|
||||
|
||||
@bot.event
|
||||
async def on_ready():
|
||||
user = bot.user
|
||||
guild = bot.guilds[0]
|
||||
|
||||
print(f"Logged in as {user} (ID: {user.id})")
|
||||
print(f"Guild: {guild} (ID: {guild.id})")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
bot.run(DISCORD_TOKEN)
|
0
lynxie/commands/__init__.py
Normal file
0
lynxie/commands/__init__.py
Normal file
12
lynxie/commands/hello.py
Normal file
12
lynxie/commands/hello.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
import discord
|
||||
from discord.ext import commands
|
||||
|
||||
|
||||
class Hello(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
@commands.command()
|
||||
async def hello(self, interaction: discord.Interaction):
|
||||
"""Says hello!"""
|
||||
await interaction.response.send_message(f"Balls, {interaction.user.mention}")
|
10
lynxie/config.py
Normal file
10
lynxie/config.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
import dotenv
|
||||
from discord import Object
|
||||
|
||||
try:
|
||||
DISCORD_TOKEN = dotenv.dotenv_values(".env")["DISCORD_TOKEN"]
|
||||
except KeyError:
|
||||
print("DISCORD_TOKEN not found in .env file")
|
||||
exit(1)
|
||||
|
||||
DISCORD_GUILD_ID = Object(id=1040757387033849976)
|
Loading…
Add table
Add a link
Reference in a new issue