Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb3406c8

Browse files
author
appositum
committed
Add bot
1 parentd0ab722 commitb3406c8

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

‎bot.py‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env python3
2+
3+
importos
4+
5+
fromdiscord.ext.commandsimportBot
6+
7+
8+
bot=Bot(command_prefix="plot ")
9+
TOKEN=os.environ.get("TOKEN")
10+
11+
12+
@bot.event
13+
asyncdefon_ready():
14+
me=f'{bot.user.name}#{bot.user.discriminator} <@{bot.user.id}>'
15+
print(f'Logged in as{me}')
16+
print('Bot ready!')
17+
18+
19+
@bot.command(aliases=['test'])
20+
asyncdefhello(*args):
21+
returnawaitbot.say('Hello world!')
22+
23+
24+
bot.run(TOKEN)ifTOKENelseprint('TOKEN environment variable not set!')

‎requirements.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
discord.py

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp