I am a beginner and I have run a private bot on the Disco program linked in java, how do I make the bot write to me a "hello" message if I write "hi" to it
Related
im having trouble finding a way to create a private text channel using discord.py. right now i have the bot able to create public text channels that every guild member is able to view and message in. ive looked at the readthedocs for the library and cant seem to find any answer.
here is the code for the command im using right now:
if message.content == '!create':
user = (message.author)
await message.guild.create_text_channel(f"{user} - channel")
tried various commands and expected discord bot to create private text channel using discord.py.
Currently I'm working with my telegram python script and I want to modify it so I can send message to multiple chat id or telegram group using python script, as of now my script is working but can only read 1 chat id, can someone help me what I need to modify with my script? Thank you
My script
botToken = "somebot:ID"
chat_id = "someChatID1234"
Send data to telegram
print(files)
url='https://api.telegram.org/botsomeboy:ID/sendMessage?chat_id="&text="{}"'.format(files)
Try this module :
python-telegram-bot
As mentioned in the title I am trying to send a message to a specific channel using a discord bot that I've built using Discord.js and Node.js. I am using the following code to send the message to the specific channel: message.guild.channels.cache.find('CHANNEL_ID').send(someEmbed);. The problem is, whenever I add this piece of code to the file and run it, I get an error message in the console. The error is message is the following: if (fn(val, key, this)) TypeError: fn is not a function, this error message refers to a file that is automatically generated. So my question is if I'm doing something wrong or if it's some sort of bug.
You could also try
message.guild.channels.cache.get("CHANNEL_ID").send(someEmbed);
although your code should run without any problems.
how can I ask my telegram bot user to share his contacts with bot ?
any inline keys or commands?
I want the output to be contacts chat id
$keyboard = json_encode([
'resize_keyboard'=>true,
'keyboard'=>[
[['text'=>"request contact",'request_contact'=>true]]
]
]);
there is a way to get contact of bot user (not user`s contact) with KeyboardButton (request_contact=True)
(is used it in python-telegram-bot v13.13 library)
you can read more in
telegram core bots KeyboardButton
I'm writing a bot for my discord server and I want to send an automatic direct message to anyone who joins the server for the first time. I have looked through the documentation and I can't find anything about how to do this. I am using python 3.5 and discord.py version 0.16.12.
this should work if you are using the discord py rewrite
make sure you have enabled intents for the bot as shown in this picture
intents=discord.Intents.all()
client = commands.Bot(command_prefix= cmd,intents=intents)
#client.event
async def on_member_join(member):
await member.send(f"your welcome message here")
https://discordpy.readthedocs.io/en/latest/api.html#discord.on_member_join
You can do something along the lines of:
await bot.send_message(member, "hello")