bots

Making a discord bot that takes a screenshot every 5 minutes and posts it to a specific channel. I'm newer and not really sure what to do next

☆樱花仙子☆ 提交于 2021-01-29 08:08:10
问题 I'm making a discord bot that would take a screenshot of my screen, then post it to discord, and repeat this task every 5 minutes. It seems pretty simple, but I'm pretty new, and have been doing research and not really sure at this point what I've done wrong. import discord import pyautogui import time import datetime class MyClient(discord.Client): async def on_ready(self): print('Logged on as', self.user) if datetime.datetime.now().minute % 5 == 0: myScreenshot = pyautogui.screenshot()

How to Fix issues related to DirectLineChannel prompt choice options not displayed in chat bot window developed using V4 SDK in C#?

时光总嘲笑我的痴心妄想 提交于 2021-01-29 07:18:18
问题 I am trying to create a chatbot which is having multiple waterfall dialog classes using C# and BOT SDK V4. I have created a HTML page and placed the DirectLine channel Secret Key Iframe data into it and published it to Azure successfully and opened it in the browser. The browser opens with a in-built welcome message something like: Hi bot name type Hi to continue. If i have Choice options done through prompt options to be displayed as buttons but these are not displayed through direct line

Command cooldown in discord.py

我的未来我决定 提交于 2021-01-29 06:36:01
问题 I want commands for my discord bot to have cooldowns. I've tried other methods, but none of them seemed to work for what I have. @client.event async def on_message(message): if message.content == 'shear sheep': await message.channel.send('you sheared your sheep, gaining 1 wool.') #cooldown? 回答1: I would suggest using a variable to track weather the command has been used or before the cooldown. import time cooldown = True @client.event async def on_message(message): global cooldown if message

Telegram bot api not able to restrict user for 24 hours

你离开我真会死。 提交于 2021-01-29 05:58:39
问题 Looking for solution to restrict chat member with restrictChatMember() but unfortunately it still restrict the user forever not for 24 hours. const { date:joinDate } = ctx.message; const releaseDate = moment.unix(joinDate).add(1, 'day'); ctx.telegram.restrictChatMember( ctx.chat.id, memberID, releaseDate, false, false, false, false ); Reference: https://core.telegram.org/bots/api#restrictchatmember 回答1: You're passing a moment object back into the function, not an UNIX timestamp like the docs

bot counting command discord

ぃ、小莉子 提交于 2021-01-29 04:56:05
问题 I have a private bot on discord, i've been trying to make him count a command and adding '+1' everytime I write that one command but it stays at 1 and can't go further : like this I think what I want to do is to make it save the number of time the command has been writen and add +1 to this number ; Should I do a loop or something ? Basically what I want is something like this in python for a discord bot : https://docs.nightbot.tv/commands/variables/count 回答1: You're resetting your counter

Retrieve Teams User ID based on AAD ID

若如初见. 提交于 2021-01-29 01:36:22
问题 I am trying to start a scheduled proactive conversation (the bot initiates the conversation on scheduled time). I managed to get the User's AAD ID based on Graph API, but it doesn't match the Teams user ID. Tried for over 2 hours to obtain the right id, but I can't figure it out how. What would be the best approach I should take? 回答1: I'm curious how you tried to "match" these? In any case, I don't think they're intended to match up in any way (the aadObjectId Guid and the "29:..." user id).

Bot Framework Emulator - Taking longer than usual to connect

时光总嘲笑我的痴心妄想 提交于 2021-01-28 22:57:33
问题 I have this issue since yesterday. In the Welcome -Tab I click on Open Bot . Then I type http://localhost:3978/api/messages into Bot URL or .bot file location . Then I click on Connect . My problem is that I cannot send any messages. Also there is the warning Taking longer than usual to connect. This is the screen I'm looking at: The thing is that it worked 2 days ago. Yesterday I got the issue and I just hoped that it would work the next day (so today). But the issue still remains. How can I

(discord.py) How do I get my bot to read DM's that are sent to it and either print them or send them to a specific channel

和自甴很熟 提交于 2021-01-28 19:28:28
问题 So I recently created a discord bot with various meme commands and moderating commands. I am relatively new to python but I understand the gist of it. I have already created a command that lets me(only me) DM a user through the bot. I now want to try and make the bot be able to read the messages that are sent back to it and send them to me, whether its printed in shell or sent to a specific channel/me I don't care, I just want to be able to see what is sent to it. I did some reading around

Making a bot delete its own message after a timeout

时光总嘲笑我的痴心妄想 提交于 2021-01-28 08:23:21
问题 I am looking to have my bot send a message, confirming that it executed the command, and then delete that confirmation message after a timeout; so as not to clutter the chat. Here is a code sample of my current command I would like to have it applied to: exports.auth = 1 exports.run = (client, message, args) => { let num = parseInt(args); message.channel.bulkDelete(num+1) .then(messages => console.log(`Bulk deleted ${num} messages`)) .catch(console.error); message.channel.send(`Deleted ${num}

make an autorole for discord.js v12

核能气质少年 提交于 2021-01-28 07:32:55
问题 I wanna make my bot give automatically role when my friends join for first time to my server: I have tried this one my VPS node version: 12.19.0v :? client.on('guildMemberAdd', member => { console.log('User @' + member.user.tag + ' has joined the server!'); var role = member.guild.roles.cache.find(role => role.name == "Newbie") let user = member.user user.roles.add(role); }); but nothing is working ! help me pls 回答1: Discord is now enforcing privileged intents. The GUILD_MEMBERS intent is