Created
February 9, 2021 14:53
-
-
Save Colk-tech/b7a492c8816c27b2dce8fa81a59ae10d to your computer and use it in GitHub Desktop.
@approver のはらちょBOT様DiscordBOTの雛形です
This file contains hidden or 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
import os | |
import discord | |
class MainClient(discord.Client): | |
def __init__(self, token: str): | |
intents = discord.Intents.all() | |
intents.members = True | |
super(MainClient, self).__init__(presences=True, guild_subscriptions=True, intents=intents) | |
self.token = token | |
def launch(self): | |
self.run(self.token) | |
async def on_ready(self): | |
pass | |
async def on_message(self, message: discord.Message): | |
pass | |
async def on_voice_state_update(self, member, before, after): | |
pass | |
async def on_message_edit(self, before, after): | |
pass | |
async def on_message_delete(self, message: discord.Message): | |
pass | |
async def on_guild_role_create(self, role): | |
pass | |
if __name__ == "__main__": | |
TOKEN = os.environ["TOKEN"] | |
MAIN = MainClient(TOKEN) | |
MAIN.launch() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment