Skip to content

Instantly share code, notes, and snippets.

@Colk-tech
Last active December 29, 2020 07:25
Show Gist options
  • Save Colk-tech/b555a7e9b0d617bcc6d4b296903ca721 to your computer and use it in GitHub Desktop.
Save Colk-tech/b555a7e9b0d617bcc6d4b296903ca721 to your computer and use it in GitHub Desktop.
"""
discord botをかんたんに作れるテンプレート
Reference↓
https://discordpy.readthedocs.io/ja/latest/api.html
"""
import asyncio
import os
import sys
import discord
DISCORD_INTENTS = discord.Intents.all()
DISCORD_INTENTS.members = True
client = discord.Client(presences=True, guild_subscriptions=True, intents=DISCORD_INTENTS)
@client.event
async def on_ready():
# 準備完了時に実行したい処理を書く
pass
@client.event
async def on_message(message):
# メッセージを受け取った時に実行したい処理を書く
pass
if __name__ == "__main__":
TOKEN = os.environ["TOKEN"]
client.run(TOKEN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment