Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.

Commit

Permalink
new examples!
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeldeee committed Aug 31, 2023
1 parent 2dce7b9 commit 70e79a4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
10 changes: 9 additions & 1 deletion examples/events/message.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
from pytecord import Client, Message
from pytecord import Client, Message, MessageDeleteEvent

client = Client('YOUR_TOKEN')

@client.listen()
async def message_create(message: Message): # also you can use async def message():
await message.reply(f'Hello, {message.author}!') # str(message.author) == message.author.mention

@client.listen()
async def message_update(message: Message):
await message.reply('This message has been updated!')

@client.listen()
async def message_delete(event: MessageDeleteEvent):
await event.channel.send('Message has been deleted in this channel!')

client.run()
13 changes: 13 additions & 0 deletions examples/timers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from pytecord import Client

client = Client('YOUR_TOKEN')

@client.timer(seconds=1)
async def message_every_second():
print("I'll send this message to your console every 1 second!")

@client.timer(days=1)
async def good_morning():
print('Good morning!')

client.run()

0 comments on commit 70e79a4

Please sign in to comment.