-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodes
36 lines (28 loc) · 997 Bytes
/
codes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import discord
from discord.ext import commands
import requests
import json
import asyncio
from numerize import numerize
import config
Api = "123"
client = commands.Bot(command_prefix = '$')
async def status_task():
while True:
getir = requests.get(f"https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey={Api}").text
getir = json.loads(getir)
fast = getir["result"]["SafeGasPrice"]
slow = getir["result"]["SafeGasPrice"]
avar = getir["result"]["ProposeGasPrice"]
await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=f"🐢{slow} | 🦀{avar} | 🚀{fast}"))
for guild in client.guilds:
await guild.me.edit(nick=f"Ethereum Gas")
await asyncio.sleep(2)
try :
@client.event
async def on_ready():
client.loop.create_task(status_task())
print('blockland Etherbot hazir')
except :
False
client.run(config.GAS_TOKEN)