teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

pyファイル追記

2022/09/21 13:52

投稿

ngmg
ngmg

スコア77

title CHANGED
File without changes
body CHANGED
@@ -17,6 +17,22 @@
17
17
  (venv) % python discord.py
18
18
  2022-09-21 17:12:13 INFO discord.client logging in using static token
19
19
  2022-09-21 17:12:14 INFO discord.gateway Shard ID None has connected to Gateway (Session ID: xxxxxxxxxxxxxxxxxxxxxxxxx).
20
+ ```
20
21
 
22
+ ```discord.py
23
+ import discord
24
+ from discord.ext import commands
25
+ from discord.ext import tasks
26
+
27
+ bot = commands.Bot(command_prefix="/",intents=discord.Intents.all())
28
+
29
+
30
+ @bot.command()
31
+ async def sakura(ctx):
32
+ channel_sent = bot.get_channel(1012237139729197256)
33
+ await channel_sent.send("はじめて")
34
+
35
+
36
+ token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx'
37
+ bot.run(token)
21
38
  ```
22
-