在 py-rewrite 中创建城市字典命令?
Creating an urban dictionary command in py-rewrite?
我想知道如何使用 discord.py 重写来创建城市词典命令。类似于 mee6 机器人的那个。谢谢!
我试图找到一些 API 的城市词典,但没有成功。非常感谢任何帮助。谢谢大家!
我找到了一个可以用于 Urban Dictionary 的 API,API is here 上面有示例代码,但是你可以做一些像这样简单的事情:
import requests
def uddef(word):
url = "https://mashape-community-urban-dictionary.p.rapidapi.com/define"
querystring = {"term":word}
headers = {
'x-rapidapi-host': "mashape-community-urban-dictionary.p.rapidapi.com",
'x-rapidapi-key': "yourkey"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
uddef("test");
我想知道如何使用 discord.py 重写来创建城市词典命令。类似于 mee6 机器人的那个。谢谢!
我试图找到一些 API 的城市词典,但没有成功。非常感谢任何帮助。谢谢大家!
我找到了一个可以用于 Urban Dictionary 的 API,API is here 上面有示例代码,但是你可以做一些像这样简单的事情:
import requests
def uddef(word):
url = "https://mashape-community-urban-dictionary.p.rapidapi.com/define"
querystring = {"term":word}
headers = {
'x-rapidapi-host': "mashape-community-urban-dictionary.p.rapidapi.com",
'x-rapidapi-key': "yourkey"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
uddef("test");