import discord
import asyncio

# token.txtファイルからTOKENの読み込み
with open("token.txt") as f:
    TOKEN = f.read()

client = discord.Client()

@client.event
async def on_ready():
    print("logged in\n")
    asyncio.ensure_future(greeting_gm())

async def greeting_gm():
    while True:
        content = input("送信メッセージを入力: ")
        CHANNEL_ID = input("送信チャンネルIDを入力: ")

        try:
            channel = client.get_channel(int(CHANNEL_ID))
            await channel.send(content)
        except:
            print("送信失敗\n")

        await asyncio.sleep(1)

if __name__ == "__main__":
    client.run(TOKEN)
ec78e68fbe5c22f99baafc5cc0ff1c18bf66b8d0
<mask token>

<mask token>
with open('token.txt') as f:
    TOKEN = f.read()
<mask token>


@client.event
async def on_ready():
    print('logged in\n')
    asyncio.ensure_future(greeting_gm())


async def greeting_gm():
    while True:
        content = input('送信メッセージを入力: ')
        CHANNEL_ID = input('送信チャンネルIDを入力: ')
        try:
            channel = client.get_channel(int(CHANNEL_ID))
            await channel.send(content)
        except:
            print('送信失敗\n')
        await asyncio.sleep(1)


if __name__ == '__main__':
    client.run(TOKEN)

<mask token>
with open('token.txt') as f:
    TOKEN = f.read()
client = discord.Client()


@client.event
async def on_ready():
    print('logged in\n')
    asyncio.ensure_future(greeting_gm())


async def greeting_gm():
    while True:
        content = input('送信メッセージを入力: ')
        CHANNEL_ID = input('送信チャンネルIDを入力: ')
        try:
            channel = client.get_channel(int(CHANNEL_ID))
            await channel.send(content)
        except:
            print('送信失敗\n')
        await asyncio.sleep(1)


if __name__ == '__main__':
    client.run(TOKEN)

import discord
import asyncio
with open('token.txt') as f:
    TOKEN = f.read()
client = discord.Client()


@client.event
async def on_ready():
    print('logged in\n')
    asyncio.ensure_future(greeting_gm())


async def greeting_gm():
    while True:
        content = input('送信メッセージを入力: ')
        CHANNEL_ID = input('送信チャンネルIDを入力: ')
        try:
            channel = client.get_channel(int(CHANNEL_ID))
            await channel.send(content)
        except:
            print('送信失敗\n')
        await asyncio.sleep(1)


if __name__ == '__main__':
    client.run(TOKEN)

import discord
import asyncio

# token.txtファイルからTOKENの読み込み
with open("token.txt") as f:
    TOKEN = f.read()

client = discord.Client()

@client.event
async def on_ready():
    print("logged in\n")
    asyncio.ensure_future(greeting_gm())

async def greeting_gm():
    while True:
        content = input("送信メッセージを入力: ")
        CHANNEL_ID = input("送信チャンネルIDを入力: ")

        try:
            channel = client.get_channel(int(CHANNEL_ID))
            await channel.send(content)
        except:
            print("送信失敗\n")

        await asyncio.sleep(1)

if __name__ == "__main__":
    client.run(TOKEN)