bots

Save JSON file to grab other data from it later

若如初见. 提交于 2021-02-19 06:04:27
问题 I want to be able to save my json file with new data and then call upon that data so that I can save new data again. Right now all it is doing is it is, when I call upon any part of the JSON file's data, staying the same the last time I manually saved it. (I did edit some code and a better description of my problem) Thank you in advance! Here is my code there is no error log: const Discord = require('discord.js'); const botconfig = require("./botconfig.json"); const fs = require("fs"); const

Automatically make changes to a github file

家住魔仙堡 提交于 2021-02-18 18:13:04
问题 I’ve Made an app whith a whitelist, the withelist is on a github repo ( with just one file that is the withelist ), Each time that a user that downloads my app want to be allowed to use the app has to send me a message for be inserted in the white list. Right now this process is really slow and I want to speed it up but I’m trying to figure out how. I’m sesrching a way for Let the users send me a message Read the message ( with a bot or something that automate this process ) Make the bot add

Automatically make changes to a github file

痴心易碎 提交于 2021-02-18 18:11:44
问题 I’ve Made an app whith a whitelist, the withelist is on a github repo ( with just one file that is the withelist ), Each time that a user that downloads my app want to be allowed to use the app has to send me a message for be inserted in the white list. Right now this process is really slow and I want to speed it up but I’m trying to figure out how. I’m sesrching a way for Let the users send me a message Read the message ( with a bot or something that automate this process ) Make the bot add

Automatizing web browser form filling in Python

百般思念 提交于 2021-02-17 14:50:47
问题 Question: Hi. I am a beginner trying to learn Python, and for one of my first projects I want to write a script that will fill out a survey automatically for me . I am familiar with coding, and I have most of the code written to solve this problem. What I am struggling is to write a method that will hit button #1 in question #1, or that will push any given button. One way I've realized I can do this, is perhaps by writing a script to press tab-> up-> down-> tab-> up -> down in the order

How to get user's IP address in a bot with node.js?

主宰稳场 提交于 2021-02-17 05:28:08
问题 I am writing a bot in node.js. May I know how can I insert code to console.log the IP address of message sender please? I need the IP address to perform some auto-log in. Many Thanks!! 回答1: You can get ip address from request object by request.connection.remoteAddress 回答2: To get the Ip address of your User var app = require('express')(); app.get("/ip", (req, res) => { console.log(req.ip) // "::ffff:127.0.0.1" ::ffff: is a subnet prefix for IPv4 (32 bit) let ip = req.ip.split(':'); console

How to get user's IP address in a bot with node.js?

女生的网名这么多〃 提交于 2021-02-17 05:27:43
问题 I am writing a bot in node.js. May I know how can I insert code to console.log the IP address of message sender please? I need the IP address to perform some auto-log in. Many Thanks!! 回答1: You can get ip address from request object by request.connection.remoteAddress 回答2: To get the Ip address of your User var app = require('express')(); app.get("/ip", (req, res) => { console.log(req.ip) // "::ffff:127.0.0.1" ::ffff: is a subnet prefix for IPv4 (32 bit) let ip = req.ip.split(':'); console

I would like to have a message sent in a certain channel that the bot is turning off or on

此生再无相见时 提交于 2021-02-11 14:39:44
问题 So I'm new to making bots and coding and stuff and this might be a newbie question but anyway, I don't have a hosting server for my bot so i was thinking that maybe when the bot turned off it would send a message in a channel But I have no clue how to do that or if its possible. I was able to get it to happen when the bot turns on but I don't know how to have it occur when the bot turns off. I don't even know where to start. What I have so far is when I type node . in the terminal the bot

Pretending that telegram bot is typing?

自闭症网瘾萝莉.ら 提交于 2021-02-11 14:12:09
问题 How can I make a bot to pretend that it is typing a message? The following text appears in the chat when the bot pretend to type: I use the python aiogram framework but a suggestion for the native Telegram API would be also helpful. 回答1: I seriously suggest using the python-telegram-bot library which has an extensive Wiki. The solution for what you want is described in code snippets. You can manually send the action: bot.send_chat_action(chat_id=chat_id, action=telegram.ChatAction.TYPING) Or

Make discord bot (js) echo message, but removing the command from the message?

末鹿安然 提交于 2021-02-11 13:50:33
问题 So what I want in the end is this: user: "*cmd hello" bot: "hello" I tried replacing it, searched different ways to edit it, but nothing worked so far. if (receivedMessage.content.includes("*cmd")) { receivedMessage.content.replace('*cmd', ' '); receivedMessage.channel.send(receivedMessage.content); receivedMessage.channel.send("s/*cmd/-"); } (^found out that you can edit stuff by typing s/oldtext/newtext, but sadly it doesn't seem to work with the bot. Replacing didn't work, either.) if

Making discord bot mention someone

不打扰是莪最后的温柔 提交于 2021-02-11 12:40:22
问题 How do I make my bot mention someone on the server? module.exports = { name: 'mention', description: 'this is a mention command!', execute(message) { mention = message.mentions.users.first(); message.channel.send('Hello' + mention); }, }; I thought it would work but it doesn't. Is there another way to mention someone? 回答1: message.mentions.users.first() returns an object, which is why it's not working. This is the correct way to mention someone: mention = message.mentions.users.first();