discord

How to edit embed messages - discord.py

坚强是说给别人听的谎言 提交于 2021-01-01 09:16:12
问题 How do I edit an embed in discord.py ? I have tried msg.edit(embed = embed) but it just edits the message with <discord.embeds.Embed object at 0x000001824D3F5A68> 回答1: To provide an alternative answer to the one already given, you should be able to edit an embed of a given message like this : from discord import Embed ... first_embed = Embed(title='embed 1') new_embed = Embed(title='embed 2') # send a first message with an embed msg = await ctx.send(embed=first_embed) # edit the embed of the

Is it possible to selft mute a member with discord.js?

夙愿已清 提交于 2021-01-01 06:47:41
问题 Recently with coronavirus, school is cancelled so I made a discord server for my class. People are not very familiar with Discord so I want a command that can selfmute people so that the course can start. I want everyone to be able to unmute if they want to ask a question to the teacher, hence the self-mute and not the server-mute. I have tried this code but it's not working because the .selfmute(true) is made for the bot. const Discord = require('discord.js'); const client = new Discord

Discord.js ban/kick commands available to all users. How can I fix this?

旧街凉风 提交于 2020-12-30 03:40:26
问题 I'm making my own Discord Bot because I don't trust the bigger ones (Dyno, Hime, NosoBot, etc.) And my bot is pretty much done. The only problem is that my code allows all members to use these commands. I only want people to be able to use the functions they have permissions to. The code works, but how can I make it allow only people with permission to kick/ban? if (msg.content.startsWith("$kick ")) { if (msg.mentions.members.first()) { msg.mentions.members.first.kick().then((member) => { msg

Deleting all messages in discord.js text channel

爷,独闯天下 提交于 2020-12-29 06:39:49
问题 Ok, so I searched for a while, but I couldn't find any information on how to delete all messages in a discord channel. And by all messages I mean every single message ever written in that channel. Any clues? 回答1: Try this async () => { let fetched; do { fetched = await channel.fetchMessages({limit: 100}); message.channel.bulkDelete(fetched); } while(fetched.size >= 2); } 回答2: Discord does not allow bots to delete more than 100 messages, so you can't delete every message in a channel. You can

Make Discord bot send picture with message with NodeJS

别等时光非礼了梦想. 提交于 2020-12-29 06:38:33
问题 I have a few pictures, all on imgur with direct image link (format: https://i.imgur.com/XXXXXX.jpg), and a Discord bot made with NodeJS. I send messages like this: bot.sendMessage({ to: channelID, message: "My Bot's message" }); I have tried this: bot.sendMessage({ to: channelID, message: "My Bot's message", file: "https://i.imgur.com/XxxXxXX.jpg" }); but I only get the text. I have looked it up, and this question was the only one to even come close to saying what I need to do, and it didn't

Discord.py on_message isnt a @bot.event?

痞子三分冷 提交于 2020-12-27 06:53:31
问题 import datetime import discord from discord import message, ActivityType from discord.ext import commands import asyncio intents = discord.Intents().all() bot = commands.Bot(command_prefix='.', intents=intents) guild = 'SwiftNetwork' time = datetime.date.today() badword = ['bw', 'bw1', 'bw2', 'bw3'] @bot.event async def on_ready(): print('Wir sind als {1} auf {0} eingeloggt Vers: {2}'.format(guild, bot.user.name, discord.__version__)) channel = bot.get_channel(id=697572461629407305) await

Discord.py rewrite get_member() function returning None for all users except bot

谁说我不能喝 提交于 2020-12-27 06:14:27
问题 I made a stupid discord bot a few months ago to change my friends name every minute, but I updated it today and now the get_member function is returning none. @client.event async def on_ready(): print('bot is ready!') status = discord.Activity(name="Sam be a loser", type=discord.ActivityType.watching) await client.change_presence(activity=status) name_change.start() @tasks.loop(minutes=1) async def name_change(): server = client.get_guild(id=584112137132048387) user = server.get_member

Discord.py rewrite get_member() function returning None for all users except bot

不想你离开。 提交于 2020-12-27 06:11:50
问题 I made a stupid discord bot a few months ago to change my friends name every minute, but I updated it today and now the get_member function is returning none. @client.event async def on_ready(): print('bot is ready!') status = discord.Activity(name="Sam be a loser", type=discord.ActivityType.watching) await client.change_presence(activity=status) name_change.start() @tasks.loop(minutes=1) async def name_change(): server = client.get_guild(id=584112137132048387) user = server.get_member

Discord.py rewrite get_member() function returning None for all users except bot

狂风中的少年 提交于 2020-12-27 06:11:13
问题 I made a stupid discord bot a few months ago to change my friends name every minute, but I updated it today and now the get_member function is returning none. @client.event async def on_ready(): print('bot is ready!') status = discord.Activity(name="Sam be a loser", type=discord.ActivityType.watching) await client.change_presence(activity=status) name_change.start() @tasks.loop(minutes=1) async def name_change(): server = client.get_guild(id=584112137132048387) user = server.get_member

How do I make my Python discord bot give roles on join?

怎甘沉沦 提交于 2020-12-27 05:54:14
问题 I have a bot that I'm trying to make better. It's called moderator bot and I'm working on adding new commands. I just can't find the code anywhere. How do I get moderator bot to give user roles when they join the server. And how do I make it configurable by the server owner so that the bot can be used over different servers? I also want it to DM the owner commands so they can see it along with only owner-set roles being able to access that command. It sounds advanced and probably is, but can