This repository has been archived by the owner on May 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pixeldeee
committed
Aug 31, 2023
1 parent
2dce7b9
commit 70e79a4
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |