Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Launch the bot #2

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
pre-commit-ci[bot] committed Jan 17, 2024
commit 96bf3fe36215669097392a2f5cd5ec2d240933f9
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
venv
scratch
.vscode
.github
.github
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DISCORD_TOKEN="token"
DISCORD_TOKEN="token"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -3,4 +3,4 @@ venv
__pycache__
.pytest_cache
.env
scratch
scratch
11 changes: 7 additions & 4 deletions bot.py
Original file line number Diff line number Diff line change
@@ -9,16 +9,19 @@

client = discord.Client(intents=intents)


@client.event
async def on_ready():
print(f'We have logged in as {client.user}')
print(f"We have logged in as {client.user}")


@client.event
async def on_message(message):
if message.author == client.user:
return

if message.content.startswith('$hello'):
await message.channel.send('Hello!')
if message.content.startswith("$hello"):
await message.channel.send("Hello!")


client.run(os.getenv("DISCORD_TOKEN"))
client.run(os.getenv("DISCORD_TOKEN"))