更改 discord.py 机器人状态

对我来说可能很难,但我相信 stackoverflow 的力量,

我需要在我的机器人上输入一个数字作为机器人状态。

这里:http : //gamers-control-2.000webhostapp.com/count.txt

http://img3.mukewang.com/6152af8f0001561205950324.jpg

http://img3.mukewang.com/6152af960001b7db05970330.jpg

#time to show status = 在空白网站上创建的文本 = "41"


# http://gamers-control-2.000webhostapp.com/count.txt


#some how,你说我可以输入数字,我说网络中的数字每次都会改变,所以我需要获取该数字以将其显示为机器人状态。


import discord

from discord.ext.commands import Bot

from discord.ext import commands

import asyncio

import time

import random

from discord import Game



Client = discord.client

client = commands.Bot(command_prefix = '!')

Clientdiscord = discord.Client()





@client.event

async def on_ready():


 await client.change_presence(game=discord.Game(name=http://gamers-control-2.000webhostapp.com/count.txt, type=3))


 print('test ready')


client.run("....")

我是 discord.py 的新手


人到中年有点甜
浏览 176回答 3
3回答

jeck猫

这是我使用的async def on_ready():    print(f'We have logged in as {bot.user}')    print('Ready!')    return await bot.change_presence(activity=discord.Activity(type=3, name='Add status here'))```
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python