discord

Discord Music bot - the song i play stopped 10-20 seconds before the end so i added highWaterMark and now the song barely plays at all

放肆的年华 提交于 2020-08-06 02:18:49
问题 So basically i had this issue and i got given a "solution" but it didn't work, so i found a fix and that was adding highWaterMark to my code so the stream stays open longer or whatever idk, so this is what my code looks like currently const dispatcher = serverQueue.connection.play(ytdl(song.url, { filter:"audioonly", highWaterMark: 1<<25 }) .on("finish", () => { const shiffed = serverQueue.songs.shift(); if (serverQueue.loop === true) { serverQueue.songs.push(shiffed); }; play(guild,

Discord Music bot - the song i play stopped 10-20 seconds before the end so i added highWaterMark and now the song barely plays at all

☆樱花仙子☆ 提交于 2020-08-06 02:16:28
问题 So basically i had this issue and i got given a "solution" but it didn't work, so i found a fix and that was adding highWaterMark to my code so the stream stays open longer or whatever idk, so this is what my code looks like currently const dispatcher = serverQueue.connection.play(ytdl(song.url, { filter:"audioonly", highWaterMark: 1<<25 }) .on("finish", () => { const shiffed = serverQueue.songs.shift(); if (serverQueue.loop === true) { serverQueue.songs.push(shiffed); }; play(guild,

Discord Music bot - the song i play stopped 10-20 seconds before the end so i added highWaterMark and now the song barely plays at all

别等时光非礼了梦想. 提交于 2020-08-06 02:16:19
问题 So basically i had this issue and i got given a "solution" but it didn't work, so i found a fix and that was adding highWaterMark to my code so the stream stays open longer or whatever idk, so this is what my code looks like currently const dispatcher = serverQueue.connection.play(ytdl(song.url, { filter:"audioonly", highWaterMark: 1<<25 }) .on("finish", () => { const shiffed = serverQueue.songs.shift(); if (serverQueue.loop === true) { serverQueue.songs.push(shiffed); }; play(guild,

Change the permissions of a discord text channel with discord.py

最后都变了- 提交于 2020-07-28 04:05:08
问题 I would have liked to make a command that allows to modify the permissions of a particular text channel discord with discord.py. For example, disable sending messages in a specific channel. I looked at the documentation of discord.py and I saw that there is a PermissionOverwrite class (https://discordpy.readthedocs.io/en/latest/api.html?highlight=app#permissionoverwrite) allowing to do some things at the level of the permissions (notably with the function update) @client.command() async def

Change the permissions of a discord text channel with discord.py

你说的曾经没有我的故事 提交于 2020-07-28 04:02:27
问题 I would have liked to make a command that allows to modify the permissions of a particular text channel discord with discord.py. For example, disable sending messages in a specific channel. I looked at the documentation of discord.py and I saw that there is a PermissionOverwrite class (https://discordpy.readthedocs.io/en/latest/api.html?highlight=app#permissionoverwrite) allowing to do some things at the level of the permissions (notably with the function update) @client.command() async def

Send a Discord Embed via Webhook C#

时间秒杀一切 提交于 2020-07-22 08:07:41
问题 I have this code that I want to send to a discord webhook via an embedded message: var builder = new EmbedBuilder(); builder.WithTitle("Ice Wizard Stats"); builder.AddField("Hit Speed", "1.5sec", true); // True for inline builder.WithThumbnailUrl("https://i.ibb.co/rc66Lq8/logonew.png"); builder.WithColor(Color.Red); How am I supposed to send that? 回答1: public class dWebHook: IDisposable { private readonly WebClient dWebClient; private static NameValueCollection discord = new

My Discord music bot stops songs 20 seconds before it is meant to

你离开我真会死。 提交于 2020-07-22 06:04:07
问题 Now i'm not that good at Javascript, i consider myself still a learner as i still make quite a lot of mistakes from time to time (not without being able to fix them shortly after) but i am at a complete loss with this Discord bot that i'm coding, now i know that a decent amount is my code but this one area of my code i believe to possibly be the culprit of my discord bot cutting off the music stream around 20 seconds before the end. function play(guild, song) { const serverQueue = queue.get

Changing role hierarchy with discord.py

…衆ロ難τιáo~ 提交于 2020-07-21 11:26:34
问题 I want to create a new role in discord.py. But I want this role to be in the (let's say) 3rd spot of the roles. How can I achieve this? 回答1: You would use Role.edit, passing a position value, which must be lower than the position of your highest role. @bot.command() async def moverole(ctx, role: discord.Role, pos: int): try: await role.edit(position=pos) await ctx.send("Role moved.") except discord.Forbidden: await ctx.send("You do not have permission to do that") except discord.HTTPException

Changing role hierarchy with discord.py

佐手、 提交于 2020-07-21 11:21:08
问题 I want to create a new role in discord.py. But I want this role to be in the (let's say) 3rd spot of the roles. How can I achieve this? 回答1: You would use Role.edit, passing a position value, which must be lower than the position of your highest role. @bot.command() async def moverole(ctx, role: discord.Role, pos: int): try: await role.edit(position=pos) await ctx.send("Role moved.") except discord.Forbidden: await ctx.send("You do not have permission to do that") except discord.HTTPException

Python Bot use custom Emoji

徘徊边缘 提交于 2020-07-18 13:23:43
问题 How to make my bot use my custom emoji in any discord server. @bot.command(pass_context=True) async def ping(ctx): msg = "Pong :CustomEmoji: {0.author.mention}".format(ctx.message) await bot.say(msg) Example: If I upload some custom emojis on server 1 and when we use the !ping command (mentioned above) in server 2 or server 3 or any server where the bot has access to, it should use the custom emoji. Result Pong with :CustomEmoji: 回答1: From https://github.com/Rapptz/discord.py/issues/390: It's