@@ -0,0 +1,1249 @@
+from discord.ext import commands%0A%0Aimport discord%0Afrom urllib.parse import quote_plus%0A%0Aclass GoogleBot(commands.Bot):%0A    def __init__(self):%0A        super().__init__(command_prefix=commands.when_mentioned_or('$'))%0A%0A    async def on_ready(self):%0A        print(f'Logged in as %7Bself.user%7D (ID: %7Bself.user.id%7D)')%0A        print('------')%0A%0A%0A# Define a simple View that gives us a google link button.%0A# We take in %60query%60 as the query that the command author requests for%0Aclass Google(discord.ui.View):%0A    def __init__(self, query: str):%0A        super().__init__()%0A        # we need to quote the query string to make a valid url. Discord will raise an error if it isn't valid.%0A        query = quote_plus(query)%0A        url = f'https://www.google.com/search?q=%7Bquery%7D'%0A%0A        # Link buttons cannot be made with the decorator%0A        # Therefore we have to manually create one.%0A        # We add the quoted url to the button, and add the button to the view.%0A        self.add_item(discord.ui.Button(label='Click Here', url=url))%0A%0A%0Abot = GoogleBot()%0A%0A%0A@bot.command()%0Aasync def google(ctx: commands.Context, *, query: str):%0A    %22%22%22Returns a google link for a query%22%22%22%0A    await ctx.send(f'Google Result for: %60%7Bquery%7D%60', view=Google(query))%0A%0A%0Abot.run('token')%0A

Add a new view example for link buttons