Telegram inline bot - can it be restricted to one supergroup? - inline

Can a Telegram inline bot be restricted to one supergroup? In other words, we only want this bot to be used in one supergroup - nowhere else. Is this possible?
Thanks!

No, the inline mode works in every chat.
You can allow to use the inline bot to a ristrect number of people simply checking user's id.
$inline_user_id = $update[inline_query][from][id]

Related

How to call multiple intents at once when the slot value is shared by multiple intents?

For example, I have a skill that tells the user about food interactions with medications. The user tells Alexa which medication they want to know about.
Each intent corresponds to a different medication interaction (e.g., grapefruit juice, antacids, etc.). Under the GrapefruitDrugs slot-type, I have several slot values (all of them are drug names). When the GrapefruitIntent is called, it gives the user a warning about this interaction. The problem is that I have other slot-types that share the same drugs and their warnings also need to be communicated to the user.
'Drug X', however, will interact with both grapefruit juice AND antacids. So the slot-type AntacidDrugs also has 'Drug X' listed as a slot value. I want both intents to be called.
How do I make sure that both intents get called? I've looked into chaining intents, however I have yet to see an example other than one that links an intent to the LaunchRequest.
Intents are here just to point out what kind of sentence you have received on your webhook. Webhook can be on lambda or can be your custom server (e.g. Java, PHP, NodeJs …). In any case, here is your code and logic. Here you know at what state your conversation is and how should given intent be interpreted.
So in some conversation states you will react the same for two intents, while in some cases you might interpret the same intent in two different ways.

Custom status using discord.py rewrite

This is my code
activity=discord.Game(name="Padamine", type=1)
Don’t worry, I put it in a #bot.event function. The problem is that my bot don’t put the custom status in his status. Can you help me?
Use change_presence() method to change bot status:
await bot.change_presence(activity=discord.Game("Padamine"))
If it's a static status (a status that won't change), it is recommended to use the activity keyword argument inside the bot constructor. If you want to make a dynamic status (a status that changes every now and then), use #tasks.loop of discord.ext.tasks (you can find more about tasks here)
# depending on what you name your variable, client/bot
client/bot = commands.Bot(command_prefix="yourprefix", activity=discord.Game("Padamine")) # removed type because there is no such key word argument
Also, it is recommended to not use await bot.change_presence() inside your on_ready event, I am mentioning this because many people do it and it's not good:
Discord has a high chance to completely disconnect you during the READY or GUILD_CREATE events (1006 close code) and there is nothing you can do to prevent it. As noted in the docs, on_ready is also triggered multiple times, not just once.
Basically: don't do anything in on_ready. (except printing that it came online obviously)

Discord bot that moves people based on game activity

Hello everyone I'm new to coding but I want to code the bot mentioned in the title so my questions are:
-Is there a command that reads the game activity?
-What is the command that makes the bot move someone?
I set the basics up but don't really know where to go from here:
const Discord = require('discord.js');
const client = new Discord.Client();
client.once('ready', () => {
console.log('Online');
});
client.login('*the token*');
All of a user's game activities are stored as an array, activities, within the presence property of your user object.
For example, if you want to get the game statuses of the author of a message, you can use <message>.author.presence.activities to get that array. However, since a user may have multiple statuses (custom statuses, games, Rich Presences, etc), you'll generally want to get a specific activity.
If you need to check if the name of the status is a certain one, you'll need to get the specific index first, such as <message>.author.presence.activities[0].name. If you want to check each status and see if any of them align with a needed name, you can use a for...of loop.
For more information, here is the documentation on the presence of a user.
As for "moving someone," you are not giving any more explanation as to what you mean, so that should be implemented once your bot can properly detect certain games.
In the meantime, try following a guide on how to turn user input into actual commands, and then this may make more sense if you are still facing issues.

Making a verification bot in Discord.py

I am in progress of making a Discord bot. I would like the bot to send a direct message to newly joined members including their username and avatar. Then finding if the account is too new, as an anti raiding system in my Bot.
Your criteria is not possible in Discord. Getting personal data (Users email address) from a Discord user is not possible what so ever. Discord would never let any user have access to private data in their API.
Fortunately, a much easier way of creating this is to check if the account was recently made. Using member.created_at.strftime("%a, %#d %B %Y, %I:%M %p UTC")) will simply get the time and date the joined user created their account at. I'll leave it up to you when you want to set a threshold of how early a user can join.
You can also check when the user joined a server with, also remember to define the member as the Discord user who joined. I am leaving the rest for you to complete but hoping this helps get you farther in your progress. Next time, remember to include your trialed attempt and please don't always rely on the community to give you a whole code of answers.
member.joined_at.strftime("%a, %#d %B %Y, %I:%M %p UTC"))

Watson Assistant - entity reference in Intents - I need to understand what I'm missing

I'm using watson assistant (plus) and I'm actually fighting with the correct usage of entity usage inside intent examples. First of all, inside the webUI I can't find trace of what mentioned in the documentation about entity suggestions, entity annotation inside intents examples..(we are on frankfurt server).
I have many intents in one skill and I decided to use entity mentions in intents examples. Having no trace of simplified way to add entity inside the single example, I directly wrote it inside the phrase.
From "What I need to activate MySpecificService ABC ?" to "What I need to activate #services:(MySpecificService ABC)", the same syntax used in dialog nodes.
I have used this method diffusely on my skill, according the documentation.
My problems starts here. Assistant refuse to detect the right intent when I try it.
If I ask "What I need to activate MyService Name?" the assistant detect a totally wrong intent, with low confidence (0.40 or less), and the correct intent does not appear neither as 2nd or 3rd intent (it correctly detect the entity).
No similar examples using exaclty #services:(MySpecificService ABC) in other intents, but I used other references to #services or #services:(otherservice name) in other intents.
I read documentation many times, I googled around, watched videos.. but nothing. Evidently I've misunderstood something.
Can You help me?
Intents are the actions/verbs that the user is trying to achieve. In this case, an intent could be the activation itself (no matter what is he trying to activate).
So you should write different examples of an activation question:
"How can I activate my service?", "I need to activate this service", etc.
The entities are the objects/substantives. In your case, services.
So in your dialog, if you are need the assistant to detect the intent+entity. So create a node with the condition #activation && #service:MySpecificService
Be aware that if you have several nodes in your dialog, their order will impact the way that your assistant analyzes the input. If the #activation && #service node is before the #activation && #service:MySpecificService node; the first one will be triggered as "MySpecificService" is one of the #services.
Hope that this helps!
im dealing with entities in intents as well and i think we're also on the frankfurt server.
Since youre on the frankfurt server im pretty sure the reason youre not seeing the annotation options is that youre using german language.
Annotations as mentioned in the documentation is only available for english language (unfortunately)
kr

Resources