'How do I move the user in discord by a c# bot?
Im trying to make a discord command, where when you write "!moveme", it moves you to a specific channel. Currently it functions, BUT you have to define who should be moved (!moveme user_id). I want to make it so you dont have to write the ID.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Discord.Commands;
using Discord.WebSocket;
namespace R6debot.Modules
{
public class Commands : ModuleBase<SocketCommandContext>
{
[Command("ping")]
public async Task Ping()
{
await ReplyAsync("Pong");
}
[Command("moveme")]
public async Task Moveme(SocketGuildUser user)
{
await ReplyAsync("<@" + Context.Message.Author.Id + ">");
await user.ModifyAsync(x => { x.ChannelId = 936628852996833329; });
}
}
}
Thanks beforehand
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
