How to Make Search Bots Ignore Certain Text

Is there a way to make search bots ignore certain text?

There is a simple way to tell google to not index parts of your documents, that is using googleon and googleoff:

<p>This is normal (X)HTML content that will be indexed by Google.</p>

<!--googleoff: index-->

<p>This (X)HTML content will NOT be indexed by Google.</p>

<!--googleon: index-->

In this example, the second paragraph will not be indexed by Google. Notice the “index” parameter, which may be set to any of the following:

  • index — content surrounded by “googleoff: index” will not be indexed
    by Google

    anchor — anchor text for any links within a “googleoff: anchor” area
    will not be associated with the target page

    snippet — content surrounded by “googleoff: snippet” will not be used
    to create snippets for search results

    all — content surrounded by “googleoff: all” are treated with all

source

How to tell google bot to skip part of HTML?

Maybe a base64 encoding server side and then decoding on the client side could work?

Code:

<!-- visible to Google -->
<p> Hi, Google Bot! </p>

<!-- not visible from here on -->
<script type="text/javascript">
document.write ("<?php echo base64_encode('<b>hey there, user</b>'); ?>");
</script>

How it looks to the bot:

<!-- visible to Google -->
<p> Hi, Google Bot! </p>

<!-- not visible from here on -->
<script type="text/javascript">
document.write (base64_decode("B9A985350099BC8913=="));
</script>

How to make a bot ignore certain channels in discord.py?

Simply add a check to your on_message event to return if the message.channel.id is equal to the id of #commands.

@client.event
async def on_message(message):
#Ignore messages sent in channel with id 1234567890 (#commands channel)
if message.channel.id == 1234567890:
return

#Ignore messages sent by the bot
if message.author == client.user:
return

Discord.js how to ignore a specific text and send the rest

You can use String.split() and Array.slice() to dynamically remove the command portion of message.content. Then use Array.join() to join the array back into a string.

case 'madiamond' :
case 'mashiningdiamond' :
const filteredContent = message.content.split(' ').slice(1).join(' ');
message.channel.send(`**${message.author.tag}** : <a:shiningdiamond:725331059369181284> ${filteredContent}`);
message.delete({timeout: 10});
break;

How to make bots ignore each other's messages with Discord.py library

You are preventing the bots from reacting to their own messages but you are not stating anything that prevents them from reacting to each other's message.

You can easily fix this with an additional condition in your first if block:

if message.author.id in [client.user.id, other_bot_id_here]:
return

(I'm assuming that "Hey!" belongs to the common_Greetings_List).
If you want your bots to keep reacting to each other's message except for the greetings, you can change the bot's reply in some string that doesn't belong to the greetings list.

Telegram bot: ignore text-only messages

It is possible to some extend through the allowed_updates parameter of the https://core.telegram.org/bots/api#setwebhook method:

List the types of updates you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used.

Very sadly though it is not possible to receive only updates with urls, since this is text.

If you want to reduce the amount of requests made, than you could attempt to use the getUpdates method. Sorry :/



Related Topics



Leave a reply



Submit