mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
This commit is contained in:
parent
5b78840477
commit
3a6e57db73
4 changed files with 62 additions and 1 deletions
26
cogs/google.py
Normal file
26
cogs/google.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import discord
|
||||
from discord.ext import commands
|
||||
from decorators import help
|
||||
from enums.help_categories import Category
|
||||
from functions.scraping import google_search
|
||||
|
||||
|
||||
class Google(commands.Cog):
|
||||
def __init__(self, client):
|
||||
self.client = client
|
||||
|
||||
# Don't allow any commands to work when locked
|
||||
def cog_check(self, ctx):
|
||||
return not self.client.locked
|
||||
|
||||
@commands.command(name="Google", aliases=["Gtfm", "Search"])
|
||||
@help.Category(Category.Other)
|
||||
async def google(self, ctx, *query):
|
||||
results, status = google_search(" ".join(query))
|
||||
|
||||
if results is None:
|
||||
return await ctx.send("Er ging iets fout (Response {})".format(status))
|
||||
|
||||
|
||||
def setup(client):
|
||||
client.add_cog(Google(client))
|
||||
|
|
@ -105,7 +105,7 @@ class Oneliners(commands.Cog):
|
|||
async def todo(self, ctx, *args):
|
||||
await ctx.send("https://trello.com/b/PdtsAJea/didier-to-do-list")
|
||||
|
||||
@commands.command(name="LMGTFY", aliases=["Dsfr", "Gtfm", "Google"], usage="[Query]")
|
||||
@commands.command(name="LMGTFY", aliases=["Dsfr"], usage="[Query]")
|
||||
@help.Category(category=Category.Other)
|
||||
async def lmgtfy(self, ctx, *, query=None):
|
||||
if query:
|
||||
|
|
|
|||
|
|
@ -84,6 +84,9 @@ class Store(commands.Cog):
|
|||
item_tuple = item
|
||||
break
|
||||
|
||||
if amount.lower() == "all":
|
||||
amount = int(item_tuple[2])
|
||||
|
||||
if int(item_tuple[2]) < amount:
|
||||
return await ctx.send("Je hebt niet zoveel {}s.".format(item_tuple[1]))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue