Giter Site home page Giter Site logo

skype4sharp's Introduction

Skype4Sharp

Updates

Login was fixed (check credits) however some endpoints remain broken or missing, and as always, I am not liable for anything that happens to your account as a result of using the library.

Simple Web Skype implementation for C#.

Best .NET Skype API (by default)

By reading this project's source code, compiling as a binary, redistributing assets found in this repository, etc, or ANY form of use, you must agree to the license enlisted below.

If you do anything cool with this library, be sure to tell me :)

License

See: https://github.com/lin-e/Skype4Sharp/blob/master/LICENSE.md

Bots running this API

I don't endorse any of them, mainly cause they're just bad.

  • SimpleSkype (I feel like I have to add this, cause it's my own plugin-based bot running this API)

Events

  • ChatMembersChanged
  • ContactReceived
  • ContactRequestReceived
  • MessageEdited
  • MessageReceived
  • TopicChange
  • CallStarted
  • UserRoleChanged
  • GroupPictureChanged
  • FileReceived
  • PictureReceived

Credits

yung trump has permission to skid aids code to c#

Dependencies

Usage

Look at the example bot for a working template, but if you really need full documentation, I'll provide it below. The example is in C# Console, but it should be easy enough to adapt.

Logging in

static Skype4Sharp.Skype4Sharp mainSkype;
static SkypeCredentials authCreds = new SkypeCredentials("USERNAME", "PASSWORD");
static void Main(string[] args)
{
  mainSkype = new Skype4Sharp.Skype4Sharp(authCreds);
  mainSkype.Login();
}

Setting events

mainSkype.messageReceived += MainSkype_messageReceived;
mainSkype.contactRequestReceived += MainSkype_contactRequestReceived;
// Do the rest of the events yourself, these are the two most important ones in my opinion
mainSkype.StartPoll();

Accepting a contact

private static void MainSkype_contactRequestReceived(ContactRequest sentRequest)
{
  sentRequest.Accept();
}

Declining a contact

private static void MainSkype_contactRequestReceived(ContactRequest sentRequest)
{
  sentRequest.Decline();
}

Sending a group message, editing it and more

private static void MainSkype_messageReceived(ChatMessage pMessage)
{
  ChatMessage rMessage = pMessage.Chat.SendMessage("Processing your message...");
  rMessage.Body = "Second message";
  rMessage.Type = MessageType.RichText;
  rMessage.Body = "<b>THIS IS BOLD</b>";
}

Messaging a user

ChatMessage rMessage = mainSkype.SendMessage("c0mmodity", "Hello me!");

Adding or removing a user

mainSkype.AddUser("c0mmodity", "I'd like to add you on Skype!");
mainSkype.RemoveUser("c0mmodity");

Interacting with a chat (put in context, so it's easier for me to explain)

private static void MainSkype_messageReceived(ChatMessage pMessage)
{
  Chat newChat = pMessage.Chat;
  Console.WriteLine("The chat's topic is {0}", newChat.Topic);
  newChat.Topic = "Skype4Sharp";
  Console.WriteLine("My role in this chat is '{0}'", newChat.Role.ToString());
  newChat.Add("c0mmodity");
  newChat.SetAdmin("c0mmodity");
  Console.WriteLine("c0mmodity is a(n) {0}", newChat.UserRole("c0mmodity").ToString());
  newChat.Kick("eroded");
  newChat.Leave();
}

Logging a call

private void MainSkype_callStarted(Chat originChat, User eventInitiator)
{
  Console.WriteLine("[EVENT]: CALL_STARTED > {0} ({1})", originChat.ID, eventInitiator.Username);
}

Contact

If you have any issues, feel free to message me on Skype ('c0mmodity') or eMail me. My eMail is on my profile.

FAQ

(Not actually questions I've been asked, just what I'd assume would be asked.)

Q : Why didn't you sell this?

A : It's not my code to sell. Also, as Skype4COM is bad enough as it is, you C# devs deserve options.


Q : This isn't working! I need help.

A : No. I don't offer formal support. If you really are stuck, message me on Skype (found in the Contacts section).


Q : I have a new feature I'd like for you to add.

A : Sure! Please raise it as an issue and I'll get back to you as soon as I can.


Q : Can I sell this code?

A : No. Read LICENSE.md if you want a more detailed answer, but you cannot sell my code as is, without any obvious modifications.


Q : feature is broken, what can I do?

A : Raise it as an issue, and I'll sort it out when I can. Please understand that I'm not paid for this, and I do have real world commitments.


Q : Wow! This is amazing, how can I help? (yeah, no-one's actually said this, but it'd be nice, y'know?)

A : You can donate to me via Bitcoin (1EugenekHHxybWkaeb566mnUKtpfEiyPSu), or just send me a nice message ๐Ÿ˜„


skype4sharp's People

Contributors

lin-e avatar commodities avatar knackrack615 avatar

Stargazers

Omid Nasri avatar

Watchers

James Cloos avatar Omid Nasri avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.