有没有办法使用 discord.py(自我机器人)自动兑换 Nitro 礼物?



我需要知道如何自动声明 Discord Nitro。

import discord
token = 'mytoken'
client = discord.Client()
@client.event
async def on_ready():
print("Logged In!")
@client.event
async def on_message(message):
if message.content.startwith("discord.gift/" + 13):
#example to claim if there are option
else:
print("Invalid Code!")
client.run(token, bot=False)

如果你知道什么,请帮助我。

是的,正如其他人已经提到的那样,这样做是很有可能的,而且很容易做到。这可能会使您的帐户被禁用,因此请自行承担风险。 所以,让我们进入它; 用python制作一个是一个愚蠢的想法,因为大多数硝基"狙击手"必须很快,因为总是会有竞争。我建议进入节点js并用它或硝基狙击手等制作一个自我机器人。如果你有一个客户端注入的方法,Node JS如果是迄今为止最快的,但让我们现实一点。我会为你写一些python伪代码,应该很容易理解:

import discord
import requests
import json
token = 'token'
client = discord.Client()
@client.event
async def on_ready():
print('Online')
@client.event
async def on_message(message):
if message.content.startwith("discord.gift/" + 13):
"""
make it store the code after the discord.gift/ part, but note most 
gifts come in the https://discord.gift/ format, you should either use 
regex for this opertaion or just set two variables so if the message 
content includes https and discord.gift it stores it as a different 
variable.
"""
redeemheaders = {
'Authorization': token, #dont replace this.
'content-type': 'application/json',
'payment_source_id': 'null'
}
r = requests.post('https://ptb.discordapp.com/api/v6/entitlements/gift-codes/'+ codevariable + '/redeem', headers=redeemheaders)
r = r.text.json()
print(r)

client.run(token, bot=False)

这不是 Discord 的 API 公开的东西。
此外,现在禁止用户帐户上的自我机器人,并且您有可能终止您的帐户,尤其是出于此类目的。

最新更新