This commit is contained in:
+8
-10
@@ -197,8 +197,7 @@ class Cryptocoin(commands.Cog):
|
|||||||
#user functions below
|
#user functions below
|
||||||
|
|
||||||
@commands.command(pass_context=True)
|
@commands.command(pass_context=True)
|
||||||
@asyncio.coroutine
|
async def coinprice(self, ctx, coinId: str, currencyId: str="USD"):
|
||||||
def coinprice(self, ctx, coinId: str, currencyId: str="USD"):
|
|
||||||
"""Geeft de huidige prijs van de desbetreffende crypto currency
|
"""Geeft de huidige prijs van de desbetreffende crypto currency
|
||||||
Bijv:
|
Bijv:
|
||||||
!coinprice BTC
|
!coinprice BTC
|
||||||
@@ -211,20 +210,19 @@ class Cryptocoin(commands.Cog):
|
|||||||
currencyId = currencyId.upper()
|
currencyId = currencyId.upper()
|
||||||
|
|
||||||
if (currencyId not in allowedCurrencies):
|
if (currencyId not in allowedCurrencies):
|
||||||
yield from ctx.channel.send("Valuta " + currencyId + " ken ik niet. :disappointed: ")
|
await ctx.channel.send("Valuta " + currencyId + " ken ik niet. :disappointed: ")
|
||||||
return
|
return
|
||||||
|
|
||||||
price = self.getCoinPrice(coinId, currencyId)
|
price = self.getCoinPrice(coinId, currencyId)
|
||||||
|
|
||||||
if (price == -1):
|
if (price == -1):
|
||||||
yield from ctx.channel.send("Die cryptocoin ken ik niet... :frowning2: ")
|
await ctx.channel.send("Die cryptocoin ken ik niet... :frowning2: ")
|
||||||
return
|
return
|
||||||
|
|
||||||
yield from ctx.channel.send(coinId + " is nu " + str(price) + " " + currencyId + " waard.")
|
await ctx.channel.send(coinId + " is nu " + str(price) + " " + currencyId + " waard.")
|
||||||
|
|
||||||
@commands.command(pass_context=True)
|
@commands.command(pass_context=True)
|
||||||
@asyncio.coroutine
|
async def coinadvice(self, ctx, coinId: str=""):
|
||||||
def coinadvice(self, ctx, coinId: str=""):
|
|
||||||
"""Voor al uw adviezen in monopolygeld
|
"""Voor al uw adviezen in monopolygeld
|
||||||
Vraag Stroop's mening over een specifieke coin:
|
Vraag Stroop's mening over een specifieke coin:
|
||||||
!coinadvice NLG
|
!coinadvice NLG
|
||||||
@@ -237,7 +235,7 @@ class Cryptocoin(commands.Cog):
|
|||||||
|
|
||||||
#Geen specieke coin? Doe random.
|
#Geen specieke coin? Doe random.
|
||||||
if(coinId == ""):
|
if(coinId == ""):
|
||||||
yield from ctx.channel.send( self.getRandomCoinAdvice() )
|
await ctx.channel.send( self.getRandomCoinAdvice() )
|
||||||
return
|
return
|
||||||
|
|
||||||
coinId = coinId.upper()
|
coinId = coinId.upper()
|
||||||
@@ -245,7 +243,7 @@ class Cryptocoin(commands.Cog):
|
|||||||
growPercentage, coinStability, dummy = self.analyseCoin(coinId)
|
growPercentage, coinStability, dummy = self.analyseCoin(coinId)
|
||||||
|
|
||||||
if (growPercentage == 0 and coinStability == 1.0): #aanname. anders moet je weer een extra call doen.
|
if (growPercentage == 0 and coinStability == 1.0): #aanname. anders moet je weer een extra call doen.
|
||||||
yield from ctx.channel.send("Die cryptocoin ken ik niet... :frowning2: ")
|
await ctx.channel.send("Die cryptocoin ken ik niet... :frowning2: ")
|
||||||
return
|
return
|
||||||
|
|
||||||
time.sleep(0.1) #don't overload the API
|
time.sleep(0.1) #don't overload the API
|
||||||
@@ -302,5 +300,5 @@ class Cryptocoin(commands.Cog):
|
|||||||
if (coinStability < 0.3):
|
if (coinStability < 0.3):
|
||||||
message += "Denk ik?"
|
message += "Denk ik?"
|
||||||
|
|
||||||
yield from ctx.channel.send(message)
|
await ctx.channel.send(message)
|
||||||
|
|
||||||
Reference in New Issue
Block a user