zita epsilon
zita epsilon
CC#
Created by zita epsilon on 4/23/2023 in #help
❔ Bot is stops running when i close replit tab
9 replies
CC#
Created by zita epsilon on 4/19/2023 in #help
❔ I can't create migration
thanks for the advice ❤️
13 replies
CC#
Created by zita epsilon on 4/19/2023 in #help
❔ I can't create migration
hmm
13 replies
CC#
Created by zita epsilon on 4/19/2023 in #help
❔ I can't create migration
Severity Code Description Project File Line Suppression State Error CS5001 Program does not contain a static 'Main' method suitable for an entry point CodeFirst C:\Users\Can\Desktop\CodeFirst\CodeFirst\CSC 1 Active
13 replies
CC#
Created by zita epsilon on 4/19/2023 in #help
❔ I can't create migration
using Microsoft.EntityFrameworkCore;

public class ExampleDBContext : DbContext
{
public DbSet<Product> Products { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer("Server=localhost,1433;Database=DenemeDB;User Id=Umut;Password=mypass
");
}
}

public class Product
{
public int Id { get; set; }


}
using Microsoft.EntityFrameworkCore;

public class ExampleDBContext : DbContext
{
public DbSet<Product> Products { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer("Server=localhost,1433;Database=DenemeDB;User Id=Umut;Password=mypass
");
}
}

public class Product
{
public int Id { get; set; }


}
So where is the bug, I can't see anything wrong?
13 replies
CC#
Created by zita epsilon on 4/19/2023 in #help
❔ I can't create migration
Can anyone help me please?
13 replies
CC#
Created by zita epsilon on 4/17/2023 in #help
❔ Why it's not joining?
nothing happens in VS2022
10 replies
CC#
Created by zita epsilon on 4/17/2023 in #help
❔ Why it's not joining?
even i type !join
10 replies
CC#
Created by zita epsilon on 4/17/2023 in #help
❔ Why it's not joining?
lol
10 replies
CC#
Created by zita epsilon on 4/17/2023 in #help
❔ Why it's not joining?
no i didn't, let me check!
10 replies
CC#
Created by zita epsilon on 4/17/2023 in #help
❔ Why it's not joining?
Did i missed something in codes?
10 replies
CC#
Created by zita epsilon on 4/17/2023 in #help
❔ Why, I already imported it
okay thanks <3, prob i can solve it now
10 replies
CC#
Created by zita epsilon on 4/17/2023 in #help
❔ Why, I already imported it
I downloaded the nuget package and i google'd it and they said "use command.SetPrefix()" then i used it but it doesn't working
10 replies
CC#
Created by zita epsilon on 4/17/2023 in #help
❔ Why, I already imported it
How can I solve it?
10 replies
CC#
Created by zita epsilon on 4/17/2023 in #help
❔ Why, I already imported it
using System;
using System.Threading.Tasks;
using DSharpPlus;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.EventArgs;
using DSharpPlus.VoiceNext;
using Microsoft.Extensions.Logging;

public class Program
{
private DiscordClient discord;
private CommandsNextExtension commands;
private VoiceNextExtension voiceNext;

public static void Main(string[] args)
{
var program = new Program();
program.RunBotAsync().GetAwaiter().GetResult();
}

public async Task RunBotAsync()
{
discord = new DiscordClient(new DiscordConfiguration
{
Token = "TOKEN",
TokenType = TokenType.Bot,

});

discord.Ready += OnClientReady;

commands = discord.UseCommandsNext(new CommandsNextConfiguration
{
EnableDms = false
});

commands.RegisterCommands<Commands>();

commands.SetPrefix("!");

voiceNext = discord.UseVoiceNext();

await discord.ConnectAsync();
await Task.Delay(-1);
}

private async Task OnClientReady(DiscordClient sender, ReadyEventArgs e)
{
Console.WriteLine("Bot is ready.");
await Task.CompletedTask;
}

}

public class Commands : BaseCommandModule
{
[Command("join")]
public async Task Join(CommandContext ctx)
{
var user = ctx.Member;
var voiceChannel = user?.VoiceState?.Channel;

if (voiceChannel == null || voiceChannel.Type != ChannelType.Voice)
{
await ctx.RespondAsync("You must be in a voice channel to use this command.");
return;
}

var voiceNext = ctx.Client.GetVoiceNext();
var connection = await voiceNext.ConnectAsync(voiceChannel);

await ctx.RespondAsync($"Connected to {voiceChannel.Name}");
}

}
using System;
using System.Threading.Tasks;
using DSharpPlus;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.EventArgs;
using DSharpPlus.VoiceNext;
using Microsoft.Extensions.Logging;

public class Program
{
private DiscordClient discord;
private CommandsNextExtension commands;
private VoiceNextExtension voiceNext;

public static void Main(string[] args)
{
var program = new Program();
program.RunBotAsync().GetAwaiter().GetResult();
}

public async Task RunBotAsync()
{
discord = new DiscordClient(new DiscordConfiguration
{
Token = "TOKEN",
TokenType = TokenType.Bot,

});

discord.Ready += OnClientReady;

commands = discord.UseCommandsNext(new CommandsNextConfiguration
{
EnableDms = false
});

commands.RegisterCommands<Commands>();

commands.SetPrefix("!");

voiceNext = discord.UseVoiceNext();

await discord.ConnectAsync();
await Task.Delay(-1);
}

private async Task OnClientReady(DiscordClient sender, ReadyEventArgs e)
{
Console.WriteLine("Bot is ready.");
await Task.CompletedTask;
}

}

public class Commands : BaseCommandModule
{
[Command("join")]
public async Task Join(CommandContext ctx)
{
var user = ctx.Member;
var voiceChannel = user?.VoiceState?.Channel;

if (voiceChannel == null || voiceChannel.Type != ChannelType.Voice)
{
await ctx.RespondAsync("You must be in a voice channel to use this command.");
return;
}

var voiceNext = ctx.Client.GetVoiceNext();
var connection = await voiceNext.ConnectAsync(voiceChannel);

await ctx.RespondAsync($"Connected to {voiceChannel.Name}");
}

}
10 replies
CC#
Created by zita epsilon on 4/11/2023 in #help
❔ Can i develop a discord music bot or admin bot using C#?
thanks @🌈 Thinker 🌈
11 replies
CC#
Created by zita epsilon on 4/10/2023 in #help
❔ This code is bugged how can i solve it?
i used this way to solve it @x0rld
39 replies
CC#
Created by zita epsilon on 4/10/2023 in #help
❔ This code is bugged how can i solve it?
LogiwaEntities1 db = new LogiwaEntities1();
ProductData productData = new ProductData();
productData.ProductName = txtProductName.Text;
string productName = productData.ProductName;
var x = db.tblProduct.Where(p => p.PRODUCTNAME == productName)
.Select(p => p.PRODUCTID)
.FirstOrDefault();
label3.Text = Convert.ToString(x);
var y = db.tblProduct.Find(x);
db.tblProduct.Remove(y);
db.SaveChanges();
label3.Show();
MessageBox.Show("Product removed!", "Info",MessageBoxButtons.OK,MessageBoxIcon.Information);
LogiwaEntities1 db = new LogiwaEntities1();
ProductData productData = new ProductData();
productData.ProductName = txtProductName.Text;
string productName = productData.ProductName;
var x = db.tblProduct.Where(p => p.PRODUCTNAME == productName)
.Select(p => p.PRODUCTID)
.FirstOrDefault();
label3.Text = Convert.ToString(x);
var y = db.tblProduct.Find(x);
db.tblProduct.Remove(y);
db.SaveChanges();
label3.Show();
MessageBox.Show("Product removed!", "Info",MessageBoxButtons.OK,MessageBoxIcon.Information);
39 replies
CC#
Created by zita epsilon on 4/10/2023 in #help
❔ This code is bugged how can i solve it?
i've solved it
39 replies
CC#
Created by zita epsilon on 4/10/2023 in #help
❔ This code is bugged how can i solve it?
they want do everything with using ID not product name, we don't want to use product name
39 replies