try to send accepted information via discord
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
# This example requires the 'message_content' intent.
|
||||
import asyncio
|
||||
|
||||
import discord
|
||||
|
||||
intents = discord.Intents.default()
|
||||
intents.messages = True
|
||||
|
||||
discord_client = discord.Client(intents=intents)
|
||||
|
||||
|
||||
@discord_client.event
|
||||
async def on_ready():
|
||||
print(f'We have logged in as {discord_client.user}')
|
||||
# await send_message("我是机器人")
|
||||
|
||||
|
||||
@discord_client.event
|
||||
async def on_message(message):
|
||||
pass
|
||||
|
||||
|
||||
async def send_message(message):
|
||||
print("will call send")
|
||||
channel = discord_client.get_channel(1149373754053496866)
|
||||
await channel.send(message)
|
||||
|
||||
|
||||
def run_discord():
|
||||
_token = 'MTMxNTI5OTkxODk4MTg5MDExOQ.GKA6lA.wHM4fTFT1luVrptK4YxEtFn_WhUnavtIrla_TE'
|
||||
discord_client.run(_token)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# loop = asyncio.get_event_loop()
|
||||
# loop.run_until_complete(client.start())
|
||||
# client.start()
|
||||
asyncio.run(run_discord())
|
||||
Reference in New Issue
Block a user