Skip to content

Commit

Permalink
例追加
Browse files Browse the repository at this point in the history
  • Loading branch information
sonyakun committed Apr 28, 2024
1 parent ea5eaf5 commit 9f087a6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions example/listen_timeline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import misspy

bot = misspy.Bot("misskey.example.com", "TOKEN")

@bot.event("ready")
async def on_ready():
print("logged in: @" + bot.user.username)
await bot.connect(misspy.localTimeline)


@bot.event("note")
async def on_note(note: misspy.Context):
if note.text is not None:
name = note.user.username
if note.user.name:
name = note.user.name
print("----------")
print(name + ": " + note.text)

bot.run()

0 comments on commit 9f087a6

Please sign in to comment.