-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
282 lines (233 loc) · 12.7 KB
/
main.py
File metadata and controls
282 lines (233 loc) · 12.7 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
import asyncio
import discord
import requests
import secrets
from bs4 import BeautifulSoup
from discord.ext import commands
print("Bot starts")
client = commands.Bot(command_prefix="?", help_command=None, intents=discord.Intents.all())
client.remove_command("help")
@client.event
async def on_ready():
print("Bot is started and ready for use")
client.loop.create_task(status_task())
async def status_task():
while True:
await client.change_presence(activity=discord.Game("?help"), status=discord.Status.online)
await asyncio.sleep(10)
response = requests.get("https://www.bitcoin.de")
soup = BeautifulSoup(response.content, 'html.parser')
btc_price = soup.find(id="ticker_price").text
await client.change_presence(activity=discord.Game("BTC-Price: " + btc_price), status=discord.Status.online)
await asyncio.sleep(10)
response = requests.get("https://www.bitcoin.de/de/etheur/market")
soup = BeautifulSoup(response.content, 'html.parser')
ether_price = soup.find(id="ticker_price").text
await client.change_presence(activity=discord.Game("Ether-Price: " + ether_price), status=discord.Status.online)
await asyncio.sleep(10)
response = requests.get("https://www.bitcoin.de/de/ltceur/market")
soup = BeautifulSoup(response.content, 'html.parser')
ltc_price = soup.find(id="ticker_price").text
await client.change_presence(activity=discord.Game("LTC-Price: " + ltc_price), status=discord.Status.online)
await asyncio.sleep(10)
@client.command()
async def help(ctx):
embed = discord.Embed(title="Help Menu", description="Need some help?")
embed.add_field(name="?help", value="Shows this menu", inline=False)
embed.add_field(name="?invite", value="Invite the bot to your server", inline=False)
embed.add_field(name="?join", value="Join the support server", inline=False)
embed.add_field(name="?github", value="Shows the link to the github repository of ths open source bot", inline=False)
embed.add_field(name="?ping", value="Shows the bot latency", inline=False)
embed.add_field(name="?btc or ?bitcoin", value="Shows some information and the course of Bitcoin", inline=False)
embed.add_field(name="?bch or ?bitcoincash", value="Shows some information and the course of Bitcoin", inline=False)
embed.add_field(name="?btg or ?bitcoingolf", value="Shows some information and the course of Bitcoin Gold", inline=False)
embed.add_field(name="?bsv or ?bitcoinsv", value="Shows some information and the course of Bitcoin SV", inline=False)
embed.add_field(name="?ltc or ?litcoin", value="Shows some information and the course of Litcoin", inline=False)
embed.add_field(name="?ether or ?ethereum", value="Shows some information and the course of Ethereum", inline=False)
embed.add_field(name="?ripple or ?xrp", value="Shows some information and the course of Ripple", inline=False)
embed.set_footer(text="Powered by Noddac#4399")
await ctx.send(embed=embed)
@client.command()
async def ping(ctx):
await ctx.send('Pong! {0} seconds'.format(round(client.latency, 1)))
response = requests.get("https://www.bitcoin.de")
soup = BeautifulSoup(response.content, 'html.parser')
btc_price = soup.find(id="ticker_price").text
response = requests.get("https://www.bitcoin.de/de/etheur/market")
soup = BeautifulSoup(response.content, 'html.parser')
ether_price = soup.find(id="ticker_price").text
response = requests.get("https://www.bitcoin.de/de/bcheur/market")
soup = BeautifulSoup(response.content, 'html.parser')
bch_price = soup.find(id="ticker_price").text
response = requests.get("https://www.bitcoin.de/de/btgeur/market")
soup = BeautifulSoup(response.content, 'html.parser')
btg_price = soup.find(id="ticker_price").text
response = requests.get("https://www.bitcoin.de/de/bsveur/market")
soup = BeautifulSoup(response.content, 'html.parser')
bsv_price = soup.find(id="ticker_price").text
response = requests.get("https://www.bitcoin.de/de/ltceur/market")
soup = BeautifulSoup(response.content, 'html.parser')
ltc_price = soup.find(id="ticker_price").text
response = requests.get("https://www.bitcoin.de/de/xrpeur/market")
soup = BeautifulSoup(response.content, 'html.parser')
xrp_price = soup.find(id="ticker_price").text
@client.command()
async def invite(ctx):
await ctx.send("https://discord.com/api/oauth2/authorize?client_id=827437359036760064&permissions=8&scope=bot")
@client.command()
async def join(ctx):
await ctx.send("https://discord.com/invite/Q9stTbAHNF")
@client.command()
async def github(ctx):
await ctx.send("Repository: https://github.com/noddac/Crypto-Helper-Bot \r\n Clone: https://github.com/noddac/Crypto-Helper-Bot.git")
@client.command()
async def btc(ctx):
embed = discord.Embed(title="Bitcoins")
embed.add_field(name="Name", value="Bitcoin or BTC", inline=False)
embed.add_field(name="Founder", value="Satoshi Nakamoto", inline=False)
embed.add_field(name="Publication", value="2009", inline=False)
embed.add_field(name="Limit", value="20.999.999,97690000", inline=False)
embed.add_field(name="Mining", value="SHA-256", inline=False)
embed.add_field(name="Blockchain", value="340 GB", inline=False)
embed.add_field(name="Price per Bitcoin", value=btc_price, inline=False)
embed.set_footer(text="Powered by Noddac#4399")
await ctx.send(embed=embed)
@client.command()
async def bitcoin(ctx):
embed = discord.Embed(title="Bitcoins")
embed.add_field(name="Name", value="Bitcoin or BTC", inline=False)
embed.add_field(name="Founder", value="Satoshi Nakamoto", inline=False)
embed.add_field(name="Publication", value="2009", inline=False)
embed.add_field(name="Limit", value="20.999.999,97690000", inline=False)
embed.add_field(name="Mining", value="SHA-256", inline=False)
embed.add_field(name="Blockchain", value="340 GB", inline=False)
embed.add_field(name="Price per Bitcoin", value=btc_price, inline=False)
embed.set_footer(text="Powered by Noddac#4399")
await ctx.send(embed=embed)
@client.command()
async def bitcoincash(ctx):
embed = discord.Embed(title="Bitcoin Cash")
embed.add_field(name="Name", value="Bitcoin Cash or BCH", inline=False)
embed.add_field(name="Publication", value="2017", inline=False)
embed.add_field(name="Based on", value="Bitcoin", inline=False)
embed.add_field(name="Mining", value="SHA-256", inline=False)
embed.add_field(name="Blockchain", value="167 GB", inline=False)
embed.add_field(name="Price per Bitcoin", value=bch_price, inline=False)
embed.set_footer(text="Powered by Noddac#4399")
await ctx.send(embed=embed)
@client.command()
async def bch(ctx):
embed = discord.Embed(title="Bitcoin Cash")
embed.add_field(name="Name", value="Bitcoin Cash or BCH", inline=False)
embed.add_field(name="Publication", value="2017", inline=False)
embed.add_field(name="Based on", value="Bitcoin", inline=False)
embed.add_field(name="Mining", value="SHA-256", inline=False)
embed.add_field(name="Blockchain", value="167 GB", inline=False)
embed.add_field(name="Price per Bitcoin", value=bch_price, inline=False)
embed.set_footer(text="Powered by Noddac#4399")
await ctx.send(embed=embed)
@client.command()
async def bitcoinsv(ctx):
embed = discord.Embed(title="Bitcoins SV")
embed.add_field(name="Name", value="Bitcoin SV or BSV", inline=False)
embed.add_field(name="Founder", value="Satoshi Nakamoto", inline=False)
embed.add_field(name="Mining", value="SHA-256", inline=False)
embed.add_field(name="Blockchain", value="229 GB", inline=False)
embed.add_field(name="Price per Bitcoin", value=bsv_price, inline=False)
embed.set_footer(text="Powered by Noddac#4399")
await ctx.send(embed=embed)
@client.command()
async def bsv(ctx):
embed = discord.Embed(title="Bitcoins SV")
embed.add_field(name="Name", value="Bitcoin SV or BSV", inline=False)
embed.add_field(name="Founder", value="Satoshi Nakamoto", inline=False)
embed.add_field(name="Mining", value="SHA-256", inline=False)
embed.add_field(name="Blockchain", value="229 GB", inline=False)
embed.add_field(name="Price per Bitcoin", value=bsv_price, inline=False)
embed.set_footer(text="Powered by Noddac#4399")
await ctx.send(embed=embed)
@client.command()
async def bitcoingolf(ctx):
embed = discord.Embed(title="Bitcoin Gold")
embed.add_field(name="Name", value="Bitcoin Gold or BTG", inline=False)
embed.add_field(name="Based on", value="Bitcoin", inline=False)
embed.add_field(name="Codebase", value="C++ & QT", inline=False)
embed.add_field(name="Price per Bitcoin", value=btg_price, inline=False)
embed.set_footer(text="Powered by Noddac#4399")
await ctx.send(embed=embed)
@client.command()
async def btg(ctx):
embed = discord.Embed(title="Bitcoin Gold")
embed.add_field(name="Name", value="Bitcoin Gold or BTG", inline=False)
embed.add_field(name="Based on", value="Bitcoin", inline=False)
embed.add_field(name="Codebase", value="C++ & QT", inline=False)
embed.add_field(name="Price per Bitcoin", value=btg_price, inline=False)
embed.set_footer(text="Powered by Noddac#4399")
await ctx.send(embed=embed)
@client.command()
async def ltc(ctx):
embed = discord.Embed(title="Litcoin")
embed.add_field(name="Name", value="Litcoin or LTC", inline=False)
embed.add_field(name="Founder", value="Charlie Lee", inline=False)
embed.add_field(name="Publication", value="2011", inline=False)
embed.add_field(name="Mining", value="Scrypt", inline=False)
embed.add_field(name="Blockchain", value="33 GB", inline=False)
embed.add_field(name="Price per Litcoin", value=ltc_price, inline=False)
embed.set_footer(text="Powered by Noddac#4399")
await ctx.send(embed=embed)
@client.command()
async def litcoin(ctx):
embed = discord.Embed(title="Litcoin")
embed.add_field(name="Name", value="Litcoin or LTC", inline=False)
embed.add_field(name="Founder", value="Charlie Lee", inline=False)
embed.add_field(name="Publication", value="2011", inline=False)
embed.add_field(name="Mining", value="Scrypt", inline=False)
embed.add_field(name="Blockchain", value="33 GB", inline=False)
embed.add_field(name="Price per Litcoin", value=ltc_price, inline=False)
embed.set_footer(text="Powered by Noddac#4399")
await ctx.send(embed=embed)
@client.command()
async def ether(ctx):
embed = discord.Embed(title="Ethereum")
embed.add_field(name="Name", value="Ethereum or Ether", inline=False)
embed.add_field(name="Founder", value="Vitalik Buterin, Gavin Wood & Jeffrey Wilcke", inline=False)
embed.add_field(name="Publication", value="30. Juli 2015", inline=False)
embed.add_field(name="Codebase", value="Solidity", inline=False)
embed.add_field(name="Mining", value="Ethash", inline=False)
embed.add_field(name="Blockchain", value="337 GB", inline=False)
embed.add_field(name="Price per Ethereum", value=ether_price, inline=False)
embed.set_footer(text="Powered by Noddac#4399")
await ctx.send(embed=embed)
@client.command()
async def ethereum(ctx):
embed = discord.Embed(title="Ethereum")
embed.add_field(name="Name", value="Ethereum or Ether", inline=False)
embed.add_field(name="Founder", value="Vitalik Buterin, Gavin Wood & Jeffrey Wilcke", inline=False)
embed.add_field(name="Publication", value="30. Juli 2015", inline=False)
embed.add_field(name="Codebase", value="Solidity", inline=False)
embed.add_field(name="Mining", value="Ethash", inline=False)
embed.add_field(name="Blockchain", value="337 GB", inline=False)
embed.add_field(name="Price per Ethereum", value=ether_price, inline=False)
embed.set_footer(text="Powered by Noddac#4399")
await ctx.send(embed=embed)
@client.command()
async def ripple(ctx):
embed = discord.Embed(title="Ripple")
embed.add_field(name="Name", value="Ripple or XRP", inline=False)
embed.add_field(name="Founder", value="Chris Larsen", inline=False)
embed.add_field(name="Developer", value="Chris Larsen & Brad Garlinghouse", inline=False)
embed.add_field(name="Codebase", value="C++", inline=False)
embed.add_field(name="Price per Ripple", value=xrp_price, inline=False)
embed.set_footer(text="Powered by Noddac#4399")
await ctx.send(embed=embed)
@client.command()
async def xrp(ctx):
embed = discord.Embed(title="Ripple")
embed.add_field(name="Name", value="Ripple or XRP", inline=False)
embed.add_field(name="Founder", value="Chris Larsen", inline=False)
embed.add_field(name="Developer", value="Chris Larsen & Brad Garlinghouse", inline=False)
embed.add_field(name="Codebase", value="C++", inline=False)
embed.add_field(name="Price per Ripple", value=xrp_price, inline=False)
embed.set_footer(text="Powered by Noddac#4399")
await ctx.send(embed=embed)
client.run(secrets.TOKEN)