【发布时间】:2023-04-04 11:00:02
【问题描述】:
我想创建一个不和谐的评分系统(如社交积分),但它显示默认分数(30),而我写了一个“侮辱”(我应该失去 10 个积分,所以有 20 个)
import discord
import os
import json
client = discord.Client()
insulte = ["noob", "shut up", "ur mom", "ez"]
@client.event
async def on_ready():
print('Je me suis lancé en {0.user}'.format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
score = 30
msg = message.content
if msg.startswith('$cs hello'):
await message.channel.send('hello!')
if msg.startswith('$cs cs'):
await message.channel.send('vous avez ' + str(score))
if any(word in msg for word in insulte):
await message.channel.send('vous avez perdu 10 crédits.')
score = score - 10
client.run(os.getenv('TOKEN'))
有人可以帮助我吗? (是的,我是法国人。)
【问题讨论】:
标签: python python-3.x discord.py