Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moderation Commands (Discord bot, DSharpPlus) #2

Closed
Naamloos opened this issue Sep 28, 2017 · 13 comments
Closed

Moderation Commands (Discord bot, DSharpPlus) #2

Naamloos opened this issue Sep 28, 2017 · 13 comments
Labels
enhancement Enhancing existing features good first issue Good first issue to begin with hacktoberfest For hacktoberfest listing help wanted Issues that need help

Comments

@Naamloos
Copy link
Owner

We need way more commands for moderation. Creating a single command is good enough for a PR to be accepted ;)

@Naamloos Naamloos added enhancement Enhancing existing features good first issue Good first issue to begin with hacktoberfest For hacktoberfest listing help wanted Issues that need help labels Sep 28, 2017
@gaurav-gogia
Copy link

Are you using microsoft bot framework? What are the things I should be aware of before I can begin? I'm kinda new to bots but would like to try and get better.

@Yucked
Copy link

Yucked commented Sep 28, 2017

@DesmondANIMUS
This is a Discord bot and I believe there is no Microsoft Bot FX required.

This is the library that the bot is built upon: https://github.com/NaamloosDT/DSharpPlus

Documentation: https://dsharpplus.emzi0767.com

@Vetsoo
Copy link

Vetsoo commented Sep 28, 2017

Hey, when I pull the solution and build it, I get these errors: "Unable to find package DSharpPlus.CommandsNext with version (>= 3.1.3-beta-00273)"

Any idea?

Edit: Found out you I needed to add the nightly builds myget source: https://www.myget.org/F/dsharpplus-nightly/api/v3/index.json

It is working now!

@Vetsoo
Copy link

Vetsoo commented Sep 28, 2017

Could you give some more information on how to test this bot?

@uwx
Copy link
Collaborator

uwx commented Sep 28, 2017

To get the NuGet packages, simply use dotnet restore -s https://www.myget.org/F/dsharpplus-nightly/api/v3/index.json in the project root.

If you run the bot with no arguments it'll create a settings.json file with sample data, then you replace the token with a Discord bot token. Follow the instructions on the application page and on this handy page to add your instance of the bot to your own guild, and then use +help to show available commands.

@Vetsoo
Copy link

Vetsoo commented Sep 28, 2017

I get a nullreference when I start up on this line t.Namespace.StartsWith("ModCore") in the AsyncListenerHandler

@Naamloos
Copy link
Owner Author

@Vetsoo Where is that line at exactly?

@DesmondANIMUS The Microsoft Bot Framework isn't used in this project. as @Yucked said, this project uses DSharpPlus. It is a library for writing aps with the Discord API.

Sorry for being inactive, I was at work c:

@Vetsoo
Copy link

Vetsoo commented Sep 28, 2017

public static void InstallListeners(DiscordClient client, Bot bot)
{
// find all methods from ModCore with AsyncListener attr
ListenerMethods =
from a in AppDomain.CurrentDomain.GetAssemblies()
from t in a.GetTypes()
where t.Namespace.StartsWith("ModCore")
from m in t.GetMethods()
let attribute = m.GetCustomAttribute(typeof(AsyncListenerAttribute), true)
where attribute != null
select new ListenerMethod { Method = m, Attribute = attribute as AsyncListenerAttribute };

        foreach (var listener in ListenerMethods)
        {
            listener.Attribute.Register(bot, client, listener.Method);
        }
    }

@Naamloos
Copy link
Owner Author

Do you have a token setup in settings.json?

@Vetsoo
Copy link

Vetsoo commented Sep 28, 2017

Yes I do. My bot is also added in my server. Do I need anything else?

@Naamloos
Copy link
Owner Author

I'm taking a look at it. Errors for me as well.

@Naamloos
Copy link
Owner Author

@Vetsoo The latest commit fixes it. Please pull the new version off of GitHub c;

@Naamloos
Copy link
Owner Author

Naamloos commented Oct 9, 2017

No more responses. Guess it's time to close this one.

@Naamloos Naamloos closed this as completed Oct 9, 2017
Naamloos pushed a commit that referenced this issue Dec 29, 2017
jcryer added a commit that referenced this issue Dec 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancing existing features good first issue Good first issue to begin with hacktoberfest For hacktoberfest listing help wanted Issues that need help
Projects
None yet
Development

No branches or pull requests

5 participants