Last active
December 29, 2020 07:25
-
-
Save Colk-tech/b555a7e9b0d617bcc6d4b296903ca721 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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